Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Excel spreadsheet driving sketches in NX8

Status
Not open for further replies.

scotts1964

Industrial
Aug 22, 2012
7
I created an excel spreadsheet with all different stress calculations for a track roller bearing and was wondering if there is a way to import the file into UG NX8 and have it drive my sketches and fill in information in my notes.
 
Replies continue below

Recommended for you

Do you want to just do a 'one-time' load of the Spreadsheet data INTO NX or would you rather link NX to the external spreadsheet so that you can continue to make changes and updates to the Spreadsheet data and have these changes drive your NX model?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
I am basically trying to create a UG "template" file of a track roller that has a spreadsheet in it (already created in Excel) that drives the sketches/solids. I want to be able to save the UG file with the spreadsheet in it under different names and then go into the spreadsheet and change the specific design requirements and have all my load calculations/dimensions/solids update. I do not know which is the easiest way, but I prefer it to be internal to UG. If it is easier to to have it associated to the external spreadsheet, that's OK too.
 
No, it's basically 'six-of-one, halfdozen of the other', just that NX supports both approaches.

OK for a fully standalone part containing all of the spreadsheet logic, if you have an existing spreadsheet with a full set of formulas which resolve to the values that you would now like to drive your NX model, what you need to do is first create your model with all the varibles (expressions) needed to drive the parameters of your Sketch or modeling features as desired. Now go to...

Tools -> Spreadsheet...

...and when the Excel window opens, go to the 'Office Button' and Open your existing spreadsheet. Now select either the whole page or just the cells that you wish to reuse and hit 'Copy'. Now close YOUR spreadsheet and Paste the contents of your Copy into the Spreadsheet which was opened by NX. Now you have your data in the NX part file, however you still need to hook it up to your model. So select some random cell near where your formulas/data is located and select the 'Add-Ins' tab at the top of the Excel window, and from the list of function on that tab, select the one titled 'Extract Expr' and all of your expressions from your model will be inserting into the spreadsheet. If there any expressions which there is no need to create links to, you can simply delete them. Of the expressions that you do wish to link to, simply edit the 'value' cells so that they are set equal to the appropriate cells of your original spreadsheet data.

Now to force the NX model to update using the new data go back to the 'Add-Ins' tab and select the item titled 'Update NX Part'. Once that the update has finished you can simply exit/close the Excel window, but when you do you will be asked if you wish to save your spreadsheet data or not. You will want to select OK so that it's saved INSIDE the NX Part file. Remember, you must always perform the 'Update NX Part' operation from within the spreadsheet for the NX model to update. If you do not, when you leave the spreadsheet and return to the Part file nothing will have changed.

Now when you wish to make future changes using your spreadsheet data, simply go back to...

Tools -> Spreadsheet...

...and you will find all of your data is still there in the Excel window. Simply make your changes, select the 'Update NX Part' option once more and then return to the NX session by exiting/closing the Excel window (always remembering to select OK when you exit so that the spreadsheet changes are saved).

Anyway, I hope this helps you accomplish what you looking to do.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
I opened my existing excel spreadsheet as suggested and then opened my UG file. I cut and pasted the excel spreadsheet into UG (breaking the link so I didn't have to save the spreadsheet in another location)and then extracted my expressions. I just associated my extracted expression cells to what I wanted from the excel spreadsheet and it worked. Thank you for your assistance.
 
Everything worked fine when I used a template file that had the spreadsheet in it. How do you add a new spreadsheet to a brand new (non-template file)that doesn't have a spreadsheet?
 
You do that same thing, just open your file and go to...

Tools -> Spreadsheet...

...and go from there as previously described.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
I created a new file - selected model - and UG opens a new model. I tried tools - spreadsheet and I get a message "failed to create new workbook". Does it matter what version of Excel we are using or am I missing a setting somewhere? My previous "templates" (NX5) already had a spreadsheet in them - done by someone that is no longer here.
 
What versions of Microsoft Office (Excel) are you running?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Yep, I suspect that that's your problem. I'm currently using Office 2007 and that works fine. I'm not sure that the minimum supported version is at the moment, but as I said Office 2007 is supported by the current versions as well as NX 8.5 which will be released in October.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
If you want an alternative... (ugly and a bit rigged but it works)

Open a file that you currently have expressions in. (Make sure all your expressions have no spaces in the names.)

Export your current expressions (use the icon next to the excel icon on the expressions tab that shows P1= P2=)
& Open the exp file in notepad
(This is just to get a feel of what the expression import needs to look like)

Create an excel spreadsheet like the one attached
(Cell A is the unit, name, and equal sign all in one cell and no spaces. Cell B is the value)

Export the excel file as a .txt
(Use Save As and from the Save as type: drop downselect "Text (MS-Dos) (*.txt)

Close the excel sheet

Open the .txt file in Notepad

Find and replace all the tabs or spaces (" ") with nothing or blanks (no spaces) to remove all the spaces.

Click Save As and make sure the encoding is set to ANSI and save.

Import your expressions in NX (use the icon next to the excel icon on the expressions tab that shows P1= P2=)

Done.


You can see how you can modify this method to use this with your existing excels sheets. It may not be the best practice in the world but a huge time saver. (I had issues doing it other ways).

 
 http://files.engineering.com/getfile.aspx?folder=6314dc98-6b54-4d60-84a8-bc17abd74801&file=Test.zip
Status
Not open for further replies.

Part and Inventory Search

Sponsor