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

To an Engineer, the glass is twice as big as it needs to be.
 
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.

 
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

To an Engineer, the glass is twice as big as it needs to be.
 
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!
 
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

To an Engineer, the glass is twice as big as it needs to be.
 
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.
 
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

To an Engineer, the glass is twice as big as it needs to be.
 
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


 
 http://files.engineering.com/getfile.aspx?folder=d11bd6e8-7ff7-4891-a40e-7e321dfa1980&file=Blade-Excel.prt
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

To an Engineer, the glass is twice as big as it needs to be.
 
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
 
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
 
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).
 
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
 
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

To an Engineer, the glass is twice as big as it needs to be.
 
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!
 
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
 
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

To an Engineer, the glass is twice as big as it needs to be.
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor