Вы находитесь на странице: 1из 7

18/2/2017

18/2/2017 (//www.siemens.com/plm) Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523

Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523

Search the community

Navigation

« Previous

Options

Spreadsheet in text format

Spreadsheet in text format Hello, (/t5/user/viewprofilepage/user-id/35965)

Hello,

SIEMENS CREATOR

I can create an expression that loads data from excel:

ug_cell_read("D:\Data.xlsx","B98")

excel: ug_cell_read("D:\Data.xlsx","B98") But is there something similar that loads data from a *.txt

But is there something similar that loads data from a *.txt file?

My underlying problem is that loading from excel takes too long: my current test model has only 225 expressions, and it takes about 200 seconds to load.

In a real situation, I will have thousants of expressions like this.

My hope is that TXT will be much faster.

I would also be open for other methods to read expression values from a data file.

Thanks for any help,

Marcio

Labels:

18/2/2017

18/2/2017 (/t5/user/viewprofilepage/user-id/3495) Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523 Ken_A

Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523

ESTEEMED CONTRIBUTOR

ESTEEMED CONTRIBUTOR  Not sure about NX11 (I would assume it is still there,

Not sure about NX11 (I would assume it is still there, but I know they did change the expression dialog)

But in NX10 expressions dialog, in top-right corner, there are 2 icons to import/export expressions from a file.

This is going to look for (or create) and EXP file, which is just a text file. (export some sample expressions to figure out the format)

Perhaps if you create an EXP file and then import it, it would be faster.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.

Production: NX10.0.3.5 MP5 + patch/TC11.2 I'd rather be steemed than diseaseled

( / t 5 / u s e r / v i e w p (/t5/user/viewprolepage/user-id/2869)

PHENOM

9 ) cowski1 (/t5/user/viewprofilepage/user-id/2869) PHENOM  It should be noted that there is no associativity

It should be noted that there is no associativity maintained between the source file and the NX part file when importing expressions as @Ken_A (/t5/user/viewprofilepage/user-id/3495) described (in case that is important to you).

Ken_A,

Thanks for responding.

SIEMENS CREATOR

(/t5/user/viewprofilepage/user-id/35965) SIEMENS CREATOR  (Yes, the NX 11 Expressions window is overhauled. The

(Yes, the NX 11 Expressions window is overhauled. The "Import and Export Expressions" is not there anymore, but it still can be found under Menu / Tools.)

Anyway, it I can export something like this:

NAME FORMULA VALUE UNITS TYPE COMMENT FA_PT_UpperAArm_CG_Loc_x ug_cell_read("D:\Data.xlsx","B2") 0 mm Number

At this point, I do not care much if this file is TXT or XLSX. In either case it works for both Export and Import, but the problem is that the formula is this function ug_cell_read(), which is (I think) the culprit that is taking too long.

Note that the formula has the information of where the actual data resides: Data.xlsx. My hope was that having a text version of this data file would accelerate the process.

I actually was able to use ug_cell_read() with a tab-separated TXT file as an argument. It

18/2/2017

Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523

worked, but it took almost as long as when I specified an XLSX file.

Marcio

(/t5/user/viewprofilepage/user-id/35965) cowski1,

cowski1,

SIEMENS CREATOR

(/t5/user/viewprofilepage/user-id/35965) SIEMENS CREATOR  Yes, I know. Every time the excel data file is

Yes, I know. Every time the excel data file is modified, I have to click on the "Update for External Change" button. It sucks, but this is how it is currently.

Marcio

( / t 5 / u s e r / v i e w p (/t5/user/viewprolepage/user-id/2869)

PHENOM

9 ) cowski1 (/t5/user/viewprofilepage/user-id/2869) PHENOM Does the Excel file have to be external? Can you use

Does the Excel file have to be external?

Can you use the modeling spreadsheet for your calculations?

(/t5/user/viewprofilepage/user-id/35965) cowski1,

cowski1,

SIEMENS CREATOR

(/t5/user/viewprofilepage/user-id/35965) SIEMENS CREATOR The Data file must be external. The excel data worksheet is

The Data file must be external. The excel data worksheet is the result of operations in other worksheets.

For example, the user interface worksheet could be nicely formatted with place for a few inputs. Potentially complicated formulas and relationships might calculate what goes to the data worksheet. Modifying one input could modify several other parameters.

The data worksheet is a plain list of two columns, Name and Value, which is to be read by SimCenter. Currently, ug_cell_read() works fine; it is just too slow.

That is why I am looking for alternatives, such as TXT files. It would require an extra file saving, but that would still be better than the long wait.

Marcio

18/2/2017

Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523

( / t 5 / u s e r / v i e w p (/t5/user/viewprolepage/user-id/2869)

PHENOM

9 ) cowski1 (/t5/user/viewprofilepage/user-id/2869) PHENOM  The only other option that I can think of right

The only other option that I can think of right now is a custom journal that would read your Excel or text file and update the expressions accordingly. I suspect that NX is opening the Excel file for each "ug_cell_read" function; if this is the case, the journal would have an advantage in that it would open the file once and read all the necessary values. The downside is the journal would need to be told which cell value goes with which expression. One way to accomplish that would be to add the NX expression names in your Excel/text file.

( / t 5 / u s e r / v i e w p (/t5/user/viewprolepage/user-id/3651)

SIEMENS LEGEND

(/t5/user/viewprofilepage/user-id/3651) SIEMENS LEGEND  To be clear, "Import and Export Expressions"

To be clear, "Import and Export Expressions" are still there in NX 11. They're inside the "Import/Export" group in the left-side menu in the dialog. :-)

group in the left-side menu in the dialog. :-) Taylor Anderson NX Product Manager, Knowledge Reuse

Taylor Anderson NX Product Manager, Knowledge Reuse and NX Design Tel: +1 (602) 441-0683 taylor.anderson@siemens.com

Solution

Solution Accepted by topic author Marcio_Tokita (/t5/user/viewprofilepage/user-id/35965) 09-06-2016 04:20 PM

18/2/2017

18/2/2017 ( / t 5 / u s e r / v i e w p

(/t5/user/viewprolepage/user-id/3651)

Marcio --

Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523

SIEMENS LEGEND

(/t5/user/viewprofilepage/user-id/3651) SIEMENS LEGEND  If your data worksheet is really a simple list of

If your data worksheet is really a simple list of name/value pairs, then you might consider using one of the newer functions to read your list of values all at once.

ug_read_list() takes a starting cell and a direction (horizontal or vertical) as arguments, reads and collects values until it finds white space in the spreadsheet, and returns the entire set as one list expression.

ug_read_fixed_list() does just what it sounds like single list expression.

It reads in a fixed range of values as a

Once inside NX, you can easily reference the elements of this list expression with the nth() function.

And if the "chattiness" really is the issue, then this should reduce your Excel access to one instance per "external update."

For example, with an external spreadsheet like this:

For example, with an external spreadsheet like this: Reading in that first column of values might

Reading in that first column of values might look like this:

in that first column of values might look like this: and instead. then just by changing

and

instead.

then just by changing the starting cell to "C2", you could read in the second set of data

Does that make sense?

Does that help at all?

Taylor Anderson NX Product Manager, Knowledge Reuse and NX Design Tel: +1 (602) 441-0683 taylor.anderson@siemens.com

« Previous

Recommendations

Sp

 Sp Follow Siemens PLM Software 

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc

18/2/2017

Solved:Spreadsheetintextformat­SiemensPLMCommunity­363523