Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

"Linking" excel to NX?

Status
Not open for further replies.

MartinMechEng

Mechanical
May 10, 2007
8
I was wondering if there is a way to have NX reference an excel file so that when the excel file is altered, the sketch in NX is automatically changed as well. This would greatly help with parametrizing shapes. For example, I have equations that define a curve for a NACA airfoil. I want to be able to change the chord length or thickness, or any other variable that pertains to the shape of the airfoil and have NX automatically update the sketch that I have made relating to the .dat files obtained from excel.
 
Replies continue below

Recommended for you

We've been able to do this for so time with KF routines, however, starting with UGS NX 3, we've also been adding these sort of functions (which are really pre-programmed KF applets) to the Expression system itself, In UGS NX 3 there was only a single simple 'read' a number from a specified cell of a specified spreadsheet, but that was expanded in UGS NX 4 to include support for strings as well as numbers and commands to perform horizontal and vertical table lookups.

Now what this means is that while you can't FORCE NX to perform an update when you edit a spreadsheet, you can edit the spreadsheet, save it and the next time NX updates your model, it will read any new or changed values from the spreadsheet.

To find these functions, with the Expression dialog open, select the icon in the lower left area with the ' f(x) ' label. When you find a function that looks interesting, just select it in the list and either read the short description at the bottom the dialog or hit the 'Help' icon or press the ' F1 ' key to get the appropriate section from the user documentation to appear.

Anyway, I hope this helps.


John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
 
Thanks but I'm not too sure that is exactly what I need, although it might help. I should clarify what I meant. I sketched a NACA airfoil using two splines. Each spline was generated from a seperate .DAT file. These .DAT files were obtained by taking results from an excel spreadsheet. The original excel spreadsheet has numerous equations to generate these points. I want to be able to change a few variables in the original excel spread sheet and have the .DAT file as well as the sketch update...or am I being to wishful?
 
okay, well I just figured out how to update the .DAT file directly. Now I would still like to figure out how to directly update the NX sketch if the values in the .DAT file were to change. wow, I'm getting long winded, sorry
 
If you're talking about numerical parameters, you could create your sketch and link individual values to cells in the spreadsheet which will get read every time the model updates. Once everything was linked up, any changes in the values in the spreadsheet, would be reflected in the model (sketch) the next time you updated the part file.

Now if you're talking about raw datapoints, you can also create both curves (splines) and b-surfaces by reading the points from a text file. Now there is no hard or even soft link between the NX part file and the data file, but you can update any existing spline/b-surface by editing the object and designating a new 'point definition file', which will then be used to update (not replace as an update will assure the user that all downstream relationships remain valid and associative).


John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
 
'you can't FORCE NX'

When is that bi-directionnal and live update foreseen with the good old NX ?
Many of the mid-range CAD software have the MS OLE for years now.
When we saw here what selfish direction NX took to manage tabulated notes on his own, the feeling was already that OLE could be forgotten for years ...
 
JohnRBaker,
I think your first option sounds what I might need....Im middly new to this software... how would I go about doing that? (and if you have time and the patience, could you also explain the methods for the 2nd option just in case?) thanks :)
 
As for using the Expression system to read a spreadsheet, like I said, just to the functions select, select on item of interest and hit F1 and it will show you the help files. Also, it's like Excel in that if you do want to use a particular function is has a sort of 'wizard' like interface that shows the fields that needs to be filled and what sort of units or dimensionality is required and so on.

As far creating splines from a data file, go to Insert -> Curve -> Spline... (not Studio SPline) and select the 'Through Points' option and at the bottom of the dialog it will say 'Points from File'. Now at this point if you hit F1, the curve help page will come up but you will have to surf the links from there, but eventually you'll get to where it describes the format of the data file. And once a spline is created (and it doesn't really care how it was created or how many points it had or anything) you can edit the spline using the same method of using points from a file.

The format of a curve file is just X, Y, Z values in a space delimited format with an optional 3 additional fields for slope control at the point, in I, J, K vector parameters.

For a surface from points it's similar except that the file is formated as series of curve sets defined as points.

Again, of this formating and rules are covered in the documentation.

Now these curves/surfacs are not smart except for the fact that we append information showing the name and location of the data file used to create or edit them, but the software does not use that information to attempt to update the curve/surface if the data files are edited or anything like that, but of course you force that update usign the editing options anytime you wish.

Anyway, I hope that helps you get started.




John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
 
Martin,

There's another way.
Use law curves and plug in your equations for the curve.
You'll get a smother result than fitting a spline through the points from the excel sheet.

Mark Benson
Aerodynamic Model Designer
 
A lot of thanks to both of you. I will try all those options today. Thanks for taking the time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor