×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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.

 

RE: Exporting Splin or Curve Data Points to a text or Excel File

Do you have a GRIP execute license?

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

(OP)
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

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
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.

RE: Exporting Splin or Curve Data Points to a text or Excel File

(OP)
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.

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
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

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
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

RE: Exporting Splin or Curve Data Points to a text or Excel File

Could I get an actual NX Part file with a typical airfoil section in it?

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

(OP)
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.

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
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.

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
Yes, evenly spaced, at least 50 points if possible on a single spline for the upper and lower surfaces respectively.

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
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.

RE: Exporting Splin or Curve Data Points to a text or Excel File

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
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

(OP)
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?

RE: Exporting Splin or Curve Data Points to a text or Excel File

I just open your sample file, perform a 'Fit', execute the program and I have no problem whatsoever picking whichever pair of curves that I wish.

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

(OP)
John,

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

The 'Fit' option I was talking about was performing a Display 'Fit' in order to better see the part model.

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

(OP)
John,

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

The X,Y,Z values are based on the WCS as defined in your part file.  However, if you were to rotate the WCS 90° Y-to-X about the Z-axis and then rerun the program you should get the results that you're looking for.

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

(OP)
John,

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

It's not an issue of "getting around the coordinate system".  This is just how things work.  If possible, you should create your models in their correct orientation realtive to the absolute coordinate system.  This will give you the best results overall.  Barring that, then position the WCS (which is independent of the absolute coordinate system) so that it represents the desired spatial relationship for your existing model.  In this case (at least with the sample part file you provided), all I had to do was rotate the WCS 90° and we were good to go.  Now you can even create a CSYS (Coordinate System) object which you can later use to reorient the WCS whenever you need to.

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

Hi,

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

Attached is the revised GRIP program (plus the source code).  The program will now write the point data to a comma delimted text file for each pair of curves selected.  After creating and saving the Point Data File, the program will ask whether you wish to select another set of curve pairs or not. This will allow you to continue selecting curve pairs until you have completed the point data extraction activity.

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

(OP)
Didier,

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

(OP)
John,

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

I wouldn't worry about knot points (if there are any) because these will lie on the spline; poles however may or may not lie on the spline (usually not).

RE: Exporting Splin or Curve Data Points to a text or Excel File

Hi

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

The points extracted in the GRIP program are 'equal arc-length' distributed points along the length of the curve.  This is the most accurate scheme for getting an evenly distributed set of points.  It does not depend on knots points or the original creation method, it's totally independent of that.

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

(OP)
Thank you John and Didier, I really appreciate your input on this thread. This has been a good welcome introduction into the forum as a first time user. Will update you guys on how the program works for me. Thank you!

RE: Exporting Splin or Curve Data Points to a text or Excel File

(OP)
John,

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

There's no problem increasing the maximum number of points created to 1,000 (the attached GRIP program has been updated to allow a maximum of 1,000 points to be created per curve selected).

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

(OP)
John,

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

(OP)
John,

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources