• Welcome aboard HomebuiltAirplanes.com, your destination for connecting with a thriving community of more than 10,000 active members, all passionate about home-built aviation. Dive into our comprehensive repository of knowledge, exchange technical insights, arrange get-togethers, and trade aircrafts/parts with like-minded enthusiasts. Unearth a wide-ranging collection of general and kit plane aviation subjects, enriched with engaging imagery, in-depth technical manuals, and rare archives.

    For a nominal fee of $99.99/year or $12.99/month, you can immerse yourself in this dynamic community and unparalleled treasure-trove of aviation knowledge.

    Embark on your journey now!

    Click Here to Become a Premium Member and Experience Homebuilt Airplanes to the Fullest!

Importing airfoil dat files into Sketchup

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

SkyPirate1982

Member
Joined
Oct 24, 2014
Messages
15
Location
Sugar Creek, MO
For those of you that use Sketchup for concept design or just drawing, making airfoils is a pain. I found a plugin that will draw the airfoil from a dat file but it is old and doesn't work on new versions of Sketchup. After some digging I found a way to get it to work.

In Sketchup open the Ruby console and paste this in:

def airfoil_dat_main
model = Sketchup.active_model
entities = model.active_entities


c = 1 # used to skip first line in file
vert = []


filename = UI.openpanel "Import Airfoil data points","C:\","*.dat"


IO.foreach(filename){
|x|
if c == 1
c = 2
elsif
data = x.split
vert.push [data[0].to_f, data[1].to_f, 0.to_f]
end
}


new_line = entities.add_face vert

Sketchup.send_action("viewTop:")
Sketchup.send_action("viewZoomExtents:")
end


if( not file_loaded?("airfoil_dat.rb") )
add_separator_to_menu("Plugins")
UI.menu("Plugins").add_item("Airfoil data loader") { airfoil_dat_main }
file_loaded("airfoil_dat.rb")
end

This does need some help and if any of you know Ruby, please feel free to help finish this. My coding skills are slow and will take time to complete.

Here are some issues that I have found/not finished yet:

This is session based so much be done every time Sketchup is opened. Needs to be a real plugin.
Will create an airfoil with a 1" chord. This can be scaled but there needs to be a way to set the chord length
 
Back
Top