Airfoil Import & Scale V2.2 macro

Need help, or want to share a macro? Post here!
old-flyer
Posts: 6
Joined: Tue Jan 01, 2019 6:00 pm

Airfoil Import & Scale V2.2 macro

Postby old-flyer » Sat Mar 16, 2019 8:59 pm

Good day,
Last week I updated the V2.1 macro to V.2.2 (attached to this topic), after running in to some problems.
This latest version worked perfectly for about a week and then started turning down legitimate *.dat files,
which it had excepted without a problem upto that moment.

I'm working on Windows 10, with both FC v0.17 and v0.18
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Dutch/Netherlands (nl_NL)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15969 (Git)
Build type: Release
Branch: master
Hash: 4765b7e2fe6d3609e9fbf3e3eb6648d7af1dd526
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)

I have the *.dat files (downloaded from UIUC) stored in ~users/old-flyer/AppData/Roaming/FreeCad/Airfoil_DAT's.

Can you help me solve this problem, as it is a very useful macro to me.
Regards, Old Flyer
Airfoil Import & Scale V2.2 macro.txt
(3.97 KiB) Downloaded 3 times
Syres
Posts: 151
Joined: Thu Aug 09, 2018 11:14 am

Re: Airfoil Import & Scale V2.2 macro

Postby Syres » Sun Mar 17, 2019 11:51 am

old-flyer wrote:
Sat Mar 16, 2019 8:59 pm
This latest version worked perfectly for about a week and then started turning down legitimate *.dat files,
which it had excepted without a problem upto that moment.
Morning @Oldflyer, as there's some different formats, I tried NACA0012 as a Lednicer format and Selig format using your attached macro so it was a definite like for like test and I couldn't get an error, all imported fine. If you could attach one of the DAT files that fails it would be best (you'll probably have to rename it as txt) or at the very leat copy the first few lines into your reply with them in Code Tags like below it might help.

Code: Select all

NACA 0012 AIRFOILS
       66.       66.

  0.000000  0.000000
  0.000584  0.004260
  0.002334  0.008429
  0.005247  0.012501

Also when the macro did work was the folder 'Airfoil_DAT's' with the apostrophe as I would never recommend anyone to use characters like that in a folder name even though Windows allows it.
old-flyer
Posts: 6
Joined: Tue Jan 01, 2019 6:00 pm

Re: Airfoil Import & Scale V2.2 macro

Postby old-flyer » Sun Mar 17, 2019 8:23 pm

Hello Syres,
Thank you for your rapid reply.
I've run the macro again, this time without using a "," in the chord length and it's ok.
It seem the macro only accepts length in whole mm's.
Knowing this, I'll be able to work around it.
Regards, Old Flyer.
Syres
Posts: 151
Joined: Thu Aug 09, 2018 11:14 am

Re: Airfoil Import & Scale V2.2 macro

Postby Syres » Mon Mar 18, 2019 10:47 am

old-flyer wrote:
Sun Mar 17, 2019 8:23 pm
I've run the macro again, this time without using a "," in the chord length and it's ok.
It seem the macro only accepts length in whole mm's.
The macro does work with chord lengths that are decimal fractions but using full stop as the separator. It's easy to make the macro handle both "." and "," as separators, just change the two lines (42 and 57) that are currently :

Code: Select all

                scalefactor=float(self.s1.text())
to

Code: Select all

                scalefactor=float(self.s1.text().replace(',', '.'))