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!

Internal Spreadsheet Question 1

Status
Not open for further replies.

cstauffe

Bioengineer
Apr 9, 2010
43
So I have used the internal spreadsheet to bring in part attributes, then make calculations based on that attribute. My question is, I now want to bring that calculated value into an expression, I am not sure how to read values from the internal spreadsheet? I tried using the path to the ug.xla but it gives me a memory error. Any ideas?
 
Replies continue below

Recommended for you

I know how to link this from an external spreadsheet, but I want to keep this data with the part, and the calculation cannot be done by expression.
 
There are NO 'links' between the Expression system and the 'internal' spreadsheet other than what is already provided for in the NX/Spreadsheet functionality.

It might help to understand that the 'internal' spreadsheet is just a scheme to use Excel as 'user inteface' to record and manipulate expression values and then those results are passed back to NX and the content of the spreadsheet is saved in a data record inside the NX part file. Therefore, except then the spreadsheet is actually open, there is NO spreadsheet to 'link' to.

Now please do not confuse this with the Expression system functions used with spreadsheets since these are intended to work with an 'external' Excel spreadsheet, which is NOT and can NOT be the 'interna'l spreadsheet.

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.
 
This is my problem. I have a attribute for a Date that gets loaded with the part. I am using an internal spreadsheet to calculate dates based off the date. And I need to pass these values back to an expression/attribute that starts off blank. You say, "manipulate expression values and then those results are passed back to NX", is this plausible then? Or are values in that internal spreadsheet for reporting only. I am not quite following your explanation.
 
So how would you modify and expression in the internal spreadsheet, or attribute for that matter? I cannot seem to find documentation for the internal spreadsheet other then ugattr and exprval.
 
Create all of your expressions in the part file that you're going to need including that 'empty' date expression. When you open the spreadsheet go to the set of commands under the tab titled 'Add-Ins' and select the item 'Extract Expr' and the expressions in your part file will be added the spreadsheet starting at the current selected cell. Now delete all of the expressions that are not important to you keeping only those that you want to either bring values into or out of the spreadsheet.

Now create your equations which do whatever you're doing and when you have the result that you want go back to those expression entries and set the 'date' express equal to your result. Now go back to the 'Add-Ins' tab and select the 'Update NX Part' item, at which point your part will update. Now exit Excel making user to say 'Yes' to saving your spreadsheet data, and when you're back in the NX part you expression(s) will have been updated based on the spreadsheet.

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.
 
Thanks John, this is helpful but not quite what I was hoping it would be. Unfortunately I was looking for a way to automate the process of shooting a value without opening the internal spreadsheet. The internal spreadsheet value will only update once.
 
Then you want to use an external spreadsheet which if you only need to read the value in a spreadsheet cell there are functions already built into the Expression system that will do that. Now if you wish to pass data in two directions, you will need to write some KF routines.

That being said, note that for NX 7.5 we have added a new capability where you can set up a parametric model in NX and then via the expression system pass values to a math-based 'spreadsheet-like' computational engine where it would automatically perform whatever you had programmed it to do and then return values back to NX as if it were a built-in function of NX, which could then cause your model to update using these new calculated values.

For this 'computational math engine' we have chosen to interface NX to the Maple product from Maplesoft Inc. Now we are NOT including Maple with NX 7.5, but rather are providing the interface (free of charge) however you will need to acquire a copy of Maple yourself from Maplesoft Inc. For more information about Maple, go to:


Anyway, this will expand significantly the types of 'problems' for which the solutions to can be fully imbedded inside an NX design 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.
 
As usual, Thanks for being so thorough John, we indeed are looking into NX 7.5 as an option for other reasons, this just helps make that decision easier.
 
John,
It would be a substantial benefit if a similar capability would be provided for Matlab, in addition to Maple. Matlab is a very powerful and widely used (both in industry and in academia) mathematics software package.
 
When we decided to implement this 'computational math engine' interface in NX 7.5 we looked at virtually all of the products out there, including Matlab. And while it would be possible to interface with more than one, it's not really practical since it would result in what would appear as redundant capabilities and could potentially be problematic, if not downright confusing, if we were to truly implement multiple interfaces as parallel functions, since what would prevent someone from attempting to use more than one 'solver' in the same part file?

That being said, there were other considerations which led to our choosing Maple, including both business and technical issues. While it might be true that Matlab has a larger presence in the industry, it turns out that their product is not considered to be the best or most comprehensive (we had access to some studies done at a university where Maple was compared to several other products and it was clear that it offered more in the long run). There were also business considerations and again the Maplesoft people proved to be more willing to work with us than did the others (in one case [not Matlab], we would have had to deal with a direct competitor and they told us to basically 'get lost').

So in the end, we based our decision on a combination of technical and business considerations, but not without first assuring ourselves that Maple would be more than adequate in providing the capabilities that we felt our customers would need in a package like this.

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.
 
MathCad is nicely integrated into Wildfire since WF4, but they can do that since PTC bougt Mathsoft. It is no wonder Siemens was told to 'get lost'. We had both Matlab and MathCad at a fomer company and there was a huge cost difference in the 2 programs. We had to always remind the users to use MathCad unless they absolutely needed Natlab. I think Maple is more along the pricing of MathCad, so that should be benefit to the customers, aas well.


"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
We just changed to NX6 from NX4. I have been paging through the threads and came upon this one. I am trying to create an expression controlled leaf spring/front axle geometry in Sketcher. I have bumbled along with Excel to get some control over the movement. If I am reading this thread accurately: there is not a way to have Expressions edited and saved with some of the dynamic "POINT" and "IF" formulae embedded in the Expression spreadsheet?
 
Not the internal, you can use an external spreadsheet just fine though, but in my case I that will not work as many users will be using this one spreadsheet at any given time.
 
This is an example I am currently using. I made reference to the location of the excel file as it is used multiple times, making it easier to change the file location if need be.

Expression[tab]Formula

EXCEL_LINK[tab]C:\Folders\Notes.xls"
NOTE1_IN[tab]1
NOTE_1[tab]if(NOTE1_IN = 1)(ug_cell_read(EXCEL_LINK,"A75"))Else("")
 
@looslib,
Mathcad is ~$1000; Matlab is ~$2000; not a huge difference in price really. (Of course you can inflate the cost by adding on options but the core functionality is all most people will ever use.)

@JohnRBaker,
You have other links to Matlab, for example, thru the NX Motion product, where Matlab can be used to provide control algorithms to motion simulations. I don't know if the work that's been done to make that happen would help in doing something similar to what's being done with Maple. At any rate, to the point about it being potentially confusing as far as which language (Maple or Matlab) to write the code in; NX already has set a precedent in this regard, by supporting a plethora of different scripting languages (Java, VB, C)...
 
potrero said:
At any rate, to the point about it being potentially confusing as far as which language (Maple or Matlab) to write the code in; NX already has set a precedent in this regard, by supporting a plethora of different scripting languages (Java, VB, C)...

Perhaps, but with languages the difference is really 'external' to NX whereas with one of these 'computational math engines', in order to make them truly effective for your typical engineering yet non-programming types, you have to provide an actual user interface with dialogs and such, and having virtually the same but different functions is always a source of confusion and additional complexity.

As for the cost of Maple, the latest version, Maple 14, lists for $1,895(USD) for a single-user commercial license for use in North America and most of Europe. For more information, go 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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor