Exporting Splin or Curve Data Points to a text or Excel File
Exporting Splin or Curve Data Points to a text or Excel File
(OP)
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.
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.





RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
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
RE: Exporting Splin or Curve Data Points to a text or Excel File
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
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
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.
RE: Exporting Splin or Curve Data Points to a text or Excel File
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
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
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
RE: Exporting Splin or Curve Data Points to a text or Excel File
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
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
Also, I was able to execute and run that GRP file taht you had provided.
Kind Regards,
Ken Lee
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
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
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
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.
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
I amy have been skipping a step, do you suggest I create poiunts on the curve first using the fit option and then only exporting those points by executing the GRIP file? I am sorry for my amatuer type questions but I may have caught myself not doing it correctly.
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
I managed to make it work and I am glad that you had helped figure this out for me. The only thing I have to note is that the X is suppose to be the Y for the airfoil in cartesian coordinate and the same for Y being the X. This should not be a big problem as I would have to manually sort the data after importing it into Excel but I would love to program it to do a chain of curves one after the other in the model.
Again, thanks so much!
RE: Exporting Splin or Curve Data Points to a text or Excel File
As for 'enhancing' the program, it might be a day or two as I'm busy tonight (I wrote the one you've got now last night while watching 'Law & Order' reruns ;-)
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
You must be a big fan of Law and Order. +)
Thank you very much for your kind help. I really appreciate it. I could get around the coordinate system that way to output the results I want. I will probably play around with the program again this afternoon.
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
Find attached a part with another solution by using the following function inside the spreadsheet:
EVALCRV( "object_name", eval_type, param1, param2, steps)
Returns curve evaluation information for a number of steps along a curve between two parameter values param1 and param2.
1°) give a name to a curve : ex curve1
2°) tools/spreadsheet
3°) select Cell A1 to D50
4°) type the formula =EVALCRV("CURVE1";1;0;1;50)
5°) CTRL-SHIFT-ENTER to populate the cell
As a first column exist before the coordinates I created a second sheet to have only the coordinate.
It's more easy than the program to change the number of points or to get coordinate for many curves. you juste have to duplicate lines in the spreadsheet
I hope this help also
Regards
Didier
RE: Exporting Splin or Curve Data Points to a text or Excel File
Let me know how this works out for you.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
Thank you for the file attached and coming up with an alternate solution, will put it to test tomorrow and let you know how it works. Can you explain what param 1 and param 2 does and why the value for evaluation type is 1?
Also, does the function return defining points along the curve that I have selected to analyse? I want to make sure it is not returning knot or pole points along a curve or spline.
Thanks,
KUAERO
RE: Exporting Splin or Curve Data Points to a text or Excel File
Thank you for replying at this hour with the modified version of the GRIP file you sent me, would love to put it to test first thing tomorrow at the office. By the way, does the program extract points that are the defining points on a spline/curve or are they returning values for knot pts or poles?
KUAERO
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
Find herewith the description of the different parameters
----------------------------------------------------------
EVALCRV( "object_name", eval_type, param1, param2, steps)
Returns curve evaluation information for a number of steps along a curve between two parameter values param1 and param2.
Parameter values range from 0.0 to 1.0, and the number of steps can be from 1 to 100. Curve evaluation types are:
Type Values Description
1 3 Point
2 1 Curvature
3 1 Normalized curvature
4 3 Tangent
5 3 Binormal
6 3 Principal Normal
7 1 Torsion
8 3 Derivative
When multiple steps are used between parameter values the first column will contain the evaluated parameter value, and the column(s) to the right will contain the data value(s), so that the data is in a form acceptable to the graphing functions in the spreadsheet.
As with ARCLEN, this function will work on any curve type and will return an error message if the object is not a curve.
-------------------------------
The given coordinates are on the curve. They are not knots or poles.
You can check with the results of the
proogram given by John
Regards
Didier
RE: Exporting Splin or Curve Data Points to a text or Excel File
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
RE: Exporting Splin or Curve Data Points to a text or Excel File
It has been a while since I posted on this thread.
I have put the GRIP program that you created and sent me last month to a lot of good use. I had a question on this forum specific to your program and that I would like to expand it if need be.
At the moment with the GRIP program you created, I believe that I am able to select as many section curves as I want on the upper and lower surface along the span of a wind blade. The program gives me an option to reslect a new set of section curves at the next station of the blade after extracting points off one station. At the moment, I want to extract more than the maximum of 100 points on a single spline for a particular station. I am hoping I could change that maximum to about 500 to 1000 points on a single spline for the upper and lower surface. This is to enable us to feed spline points back into an FEA program for structural meshing and analysis.
On top of that, we have to extract spline points off a intersection curve on the upper/lower surface of the blade along the span in steps of 25 mm. This would mean that I have to come up with some automated routine everytime the GRIP program asks for reselecting the next set of section curves as the process would have to be repeated at the very most 1000 over intersection curves over the span of the blades we designed. Is the GRIP porgram you created able to select 1000 intersection curves on the top surface then output those spline coordinates and the same for the lower surface?
Your kind advise would really be appreciated.
KUAERO
RE: Exporting Splin or Curve Data Points to a text or Excel File
However, automating the selection of multiple curves is a bit more problematic since there is no way to know which curves to select, or to even select them in a logical order or in your case, which were the upper and which were the lower curves. The truth of the matter is that it would be easier for the GRIP program to create the up-to-1,0000 section curves and then extract the points of each as the program would know, since it created them, which curve was which. It's something to think about.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.
RE: Exporting Splin or Curve Data Points to a text or Excel File
Thank you for your input and for updating the current GRIP program to extract up to 1000 points from a spline/section curve.
Your suggestions sound like a very feasible method to get around what I had described earlier in my previous posting. I wish we had the license to write a GRIP program as you have described in addition, resources that would guide me through programming such a feature in the GRIP program. I believe that the current GRIP program could be modified since it is already programmed to extract coordinates to be able to create up to 10,000 section curves along the length of a wind blade in steps of every 10mm or 25mm or as user specified only for the upper surface and then the same process for the lower surface.
Looking for your input John as to where I could actually find a GRIP user guide. Thanks.
RE: Exporting Splin or Curve Data Points to a text or Excel File
I just tested the program that you updated, it gives me an error if I chose to extract 500 points from a spline curve. I looked at the source code for the GRIP program and it looks identical to the one you sent me in May.
KUAERO
RE: Exporting Splin or Curve Data Points to a text or Excel File
Attached are the correct files.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/
To an Engineer, the glass is twice as big as it needs to be.