Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Splin or Curve Data Points to a text or Excel File 2

Status
Not open for further replies.

KUAERO

Aerospace
May 9, 2010
29
I am currently working with UG NX 7.0 and I am trying to find out what is the best way or if there is any way where I can export spline data points to a file. I have a surface where I have created intersection curves so that I can analyze the airfoil characteristics at that specific section on the surface.

I would like to be able to either create points of that intersection curve to a text or Excel file so that it can be formatted as x,y,z coordinates for the airfoil and then feed it into a program where I can run CFD or XFOIL to get the airfoil aerodynamic characteristics.

Anyone who has valuable advice would be much appreciated.

 
Replies continue below

Recommended for you

I believe we purchased the liscense for that. We have the MAch 3 package that we are running for UG NX and I would have to check that when I get back to the office.

Are you suggesting to use GRIP to program a routine that will read spline/curve points out of UG and into a text or excel file? Also what would I have to check for specifically int he license file to see if we have the GRIP execute license.

Thanks
 
OK, attached is a simple GRIP program which when run using...

File -> Execute -> GRIP...

...will provide a list of all loaded fonts in the current work part. Let me know if it runs.

If it does, I'll whip up a little program which will create a text file of the X,Y,Z coordinates of a user specified number of points on a selected spline. I'll format the text file so that it can be easily imported into Excel if that's your desired final destination (I can't create an Excel file directly using GRIP).

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Thanks for your reply John, I will check to see we can execute GRIP in UG and let you know whether it worked as soon as I get to the office tomorrow.
 
John,

I do have the GRIP execute license and I am about to test the execution of the file you sent me.

By the way, is there a good resource that I can find to code or learn how to set up GRIP executable so that we can create custom parametrized models in UG. This would allow us to increase productivity by changing design variables on the fly and have a base model update to become our design part. Your kind advice would be appreciated.
 
Actually GRIP would NOT be the route to go for something like that (it's an old and all but obsolete language used mostly for simple model and drawing related tasks). For today's tools, I would look at NX Open (AKA, User Function) and perhaps some KF (Knowledge Fusion).

As for your 'points from a spline' program, give me a day or so and I'll see what I can whip up for you. A few questions first.

If you have more than one spline that you wish to extract points from, do you wish to have a different file for each spline or a single file organized so as to have a 'section' of data for each selected spline?

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
John,

Thank you for your reply.

Firstly, I am trying to extract spline points that define the points on that curve and not the poles or knot points. Indeed, I would ideally want to extract the points from an airfoil located at several stations on a wing. So to answer your question, I would like to get section data for the upper and lower coordinates of an airfoil section curve/spline in two separate files with the section name as the file name and an upper or lower surface identifier, respectively. I really appreciate your help on this.

Second, is NX OPen or KF found in the UG NX environment window and are there valuable sources I could go to for a head start?

Kindly,

Ken
 
You can read the user documentation but you will probably need to talk to someone who has written applications using test tools (which I have not) if you're looking for something with any degree of sophistication.

Could you provide a sample file of at least one airfoil section?

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Attached is a preview of the file with the lower surface airfoil coordinates saved in the format x,y,z that I would use to loft the lower surface of a wing at the z_location specified in the name of the file. Multiple files in this format are then used to loft the entire surface of the wing.

Also, I was able to execute and run that GRP file taht you had provided.

Kind Regards,

Ken Lee
 
 http://files.engineering.com/getfile.aspx?folder=2ef8fbe7-4a97-44c8-a60a-8424721554ab&file=Z10300Pressure.dat
Unfortunately, I cannot send you a part file of the model for the wing that we have worked on because it is proprietary information. Would you be able to specify the requirements for a dummy part file perhaps and I would try to provide that to you.
 
Then just send me something which resembles a section of one of your airfoils. Enough so that I could see what these splines will look like and something that I could use to test so that if I get you some results you could indicate if it was what you expected or not.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Attached is a dummy file that I created with the red curves shown. those red curves were made by creating curves from bodies by intersection the given section of the part. I need to extract airfoil coordinates off the red curves (top and bottom) at each specific station. Hope this helps. Thanks.
 
 http://files.engineering.com/getfile.aspx?folder=77ff6e10-2d7c-49be-af65-685a775dc306&file=Blade-Dummy.prt
That should work OK. Just as a check, how many points per spline would you consider as being adequate to get the job done? I assume you expect the points to also be as evenly spaced as practical, correct?

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Yes, evenly spaced, at least 50 points if possible on a single spline for the upper and lower surfaces respectively.
 
OK, attached is a 'cheap & dirty' version of a program that will first ask you how many points you wish to define, which is defaulted at 50, but can't be set to more than 100 (this limit can be increased). It then asks you to select first the 'Upper Pressure Curve' and then the 'Lower Pressure Curve'. Note that despite the fact that the section curve is a single feature, this program will only be selecting the underlying 'splines' which will be two different curves (at least that's how your sample file was configured). After making these selections the X,Y,Z coordinates of the points will be calculated and printed to the listing window.

Now at this point you can either do a...

File -> Save As...

...from the listing window's pull-down menu and get a space-delimited text file, or you could 'copy & paste' the data points directly into an Excel spreadsheet and then use the 'Text to Columns' function to separate the data into 3 columns setting the delimiter to 'Space' only.

Anyway, give it a try and let me know what you think. Now if you wish, I could enhance the program so that it actually writes out the data to a text file and saves it. I could also have it loop back and ask you to select another set of upper and lower curves, creating a data file for each pair, until the user indicates that there are no additional section curves to be selected.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
John,

Thank you for sending me this file. Ideally, if this feature works I would have the data written to a text file and saved for each section on the wing. Also, have the routine loopp back to prompt me for another set of curves to extract data from and so on and so forth to reate a data file for each pair, exactly what you have suggested.

The file that you sent me is executable in UG NX 7.0 but it does not allow me to select the curve when it asks for that input. I made sure that the selection filter was indeed listed as 'CURVE'. This happened when I tried to execute the GRIP in two different part files.
 
Did you try it only your 'sample' file as it worked fine for me? Note that you will not be able to actually see it highlight or even preview the selection of the splines contained in the 'Section Curve' feature, so you may have to be careful when you're doing the selection.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Yes, I tried it on the sample file i sent you. I was not able to see it highlight at all and i tried selecting all the other curves in the part. Should I be able to select them right after I specify the number of points?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor