Solved - Spreadsheet List Expression

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523

(//www.siemens.com/plm)
(https://salesforce.industrysoftware.automation.siemens.com/WebkeyLogin/LithiumLogin?
Browse Community
omation.siemens.com/WebkeyLogin/LithiumLogin?
s.com%2Ft5%2Fforums%2Fv3_1%2Fforumtopicpage%2Fboard-url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fcommunity.plm.automation.siemens.com%2Ft5%2Fforums%2Fv3_1%2Fforumtopicpage%2Fboard-
hread-id%2F8117%2Fpage%2F1) id%2FNXDesignForum%2Fthread-id%2F8117%2Fpage%2F1)

Search the community Register


(https://www2.industrysoftware.automation.siemens.com/webkey/lithiumaddAccount?
url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fcommunity.plm.automation.siemens.com%2F)

Navigation

Siemens PLM Community (https://community.plm.automation.siemens.com/)


NX Design (https://community.plm.automation.siemens.com/t5/NX-Design/ct-p/NXforDesign)
NX Design Forum (https://community.plm.automation.siemens.com/t5/NX-Design-Forum/bd-p/NXDesignForum) Spreadsheet in text format

Options

Previous 1 2 (https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/board-id/NXDesignForum/thread-id/8117/page/2)

Next (https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/board-id/NXDesignForum/thread-id/8117/page/2)

Solved! Go to solution (/t5/NX-Design-Forum/Spreadsheet-in-text-format/m-p/363921#M8178)

Spreadsheet in text format

(/t5/user/viewprolepage/user-id/35965) Marcio_Tokita (/t5/user/viewprolepage/user-id/35965)


SIEMENS CREATOR

Hello,

I can create an expression that loads data from excel:


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

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

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

Thanks for any help,


Marcio

Me too (https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.externalratingdisplay.ratingenumerationdisplay.link:rating/rating-enum/0/rating-system/

Labels:

Simcenter 3D_ (/t5/forums/lteredbylabelpage/board-id/NXDesignForum/label-name/simcenter%203d_)

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363523?t:ac=boardid/NXDesignForum/threadid/8117

11 REPLIES

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 1/7
18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523


(/t5/user/viewprolepage/user-id/3495) Ken_A (/t5/user/viewprolepage/user-id/3495)
ESTEEMED CONTRIBUTOR

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 le.
This is going to look for (or create) and EXP le, which is just a text le. (export some sample
expressions to gure out the format)

Perhaps if you create an EXP le 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

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363539?t:ac=boardid/NXDesignForum/threadid/8117

(/t5/user/viewprolepage/user-id/2869) cowski1 (/t5/user/viewprolepage/user-id/2869)


PHENOM

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

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363546?t:ac=boardid/NXDesignForum/threadid/8

(/t5/user/viewprolepage/user-id/35965) Marcio_Tokita (/t5/user/viewprolepage/user-id/35965)


SIEMENS CREATOR

Ken_A,

Thanks for responding.

(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 le 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 le would accelerate the process.

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

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 2/7
18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523
worked, but it took almost as long as when I specied an XLSX le.

Marcio

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363548?t:ac=boardid/NXDesignForum/threadid/8

(/t5/user/viewprolepage/user-id/35965) Marcio_Tokita (/t5/user/viewprolepage/user-id/35965)


SIEMENS CREATOR

cowski1,

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

Marcio

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363550?t:ac=boardid/NXDesignForum/threadid/8

(/t5/user/viewprolepage/user-id/2869) cowski1 (/t5/user/viewprolepage/user-id/2869)


PHENOM

Does the Excel le have to be external?


Can you use the modeling spreadsheet for your calculations?

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363561?t:ac=boardid/NXDesignForum/threadid/8

(/t5/user/viewprolepage/user-id/35965) Marcio_Tokita (/t5/user/viewprolepage/user-id/35965)


SIEMENS CREATOR

cowski1,

The Data le 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 ne; it is just too slow.

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

Marcio

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 3/7
18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363562?t:ac=boardid/NXDesignForum/threadid/8

(/t5/user/viewprolepage/user-id/2869) cowski1 (/t5/user/viewprolepage/user-id/2869)


PHENOM

The only other option that I can think of right now is a custom journal that would read your
Excel or text le and update the expressions accordingly. I suspect that NX is opening the Excel
le for each "ug_cell_read" function; if this is the case, the journal would have an advantage in
that it would open the le 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 le.

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363568?t:ac=boardid/NXDesignForum/threadid/8

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


SIEMENS LEGEND

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. :-)

Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Tel: +1 (602) 441-0683
[email protected]

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363902?t:ac=boardid/NXDesignForum/threadid/8

Solution

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

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 4/7
18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523

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



SIEMENS LEGEND

Marcio --

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 nds white space in the spreadsheet, and returns the entire set as
one list expression.

ug_read_xed_list() does just what it sounds like... It reads in a xed range of values as a
single list expression.

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:

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

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

Does that make sense?

Does that help at all?


Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Tel: +1 (602) 441-0683
[email protected]

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 5/7
18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523

Me too (https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.externalratingdisplay.ratingenumerationdisplay.link:rating/rating-enum/0/rating-syste

(https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage.kudosbuttonv2.kudoentity:kudoentity/kudosablegid/363921?t:ac=boardid/NXDesignForum/threadid/8

Previous 1 2 (https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/board-id/NXDesignForum/thread-id/8117/page/2)

Next (https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/board-id/NXDesignForum/thread-id/8117/page/2)

Recommendations

(/t5/NX-Design-Forum/Problem-with-text-formatting-in-drawings/m-p/291351#M2158) Problem with text formatting in drawings (/t5/NX-Design-


Forum/Problem-with-text-formatting-in-drawings/td-p/291351)

(/t5/NX-Design-Forum/Update-Point-From-Spreadsheet/m-p/375023#M9339) Update Point From Spreadsheet (/t5/NX-Design-Forum/Update-Point-From-


Spreadsheet/td-p/375023)

(/t5/NX-Design-Forum/quot-Result-le-is-in-wrong-format-quot/m-p/351909#M7017) "Result le is in wrong format" (/t5/NX-Design-Forum/quot-Result-le-is-


in-wrong-format-quot/td-p/351909)

(/t5/NX-Design-Forum/Create-Text/m-p/309488#M3743) Create Text (/t5/NX-Design-Forum/Create-Text/td-p/309488)

(/t5/NX-Design-Forum/Die-Design-Standard-Part-Library-and-Advanced-Spreadsheet/m-p/356828#M7388) Die Design - Standard Part Library and Advanced


Sp... (/t5/NX-Design-Forum/Die-Design-Standard-Part-Library-and-Advanced-Spreadsheet/td-p/356828)

Follow Siemens PLM Software

(https://twitter.com/siemensplm) (https://www.linkedin.com/company/siemens-plm-software) (https://www.youtube.com/user/SiemensPLM)


(https://plus.google.com/u/0/112072058779539562010/posts)

siemens.com/plm (http://www.plm.automation.siemens.com/) 2017 Siemens Product Lifecycle Management Software Inc


Corporate Information (http://www.siemens.com/corporate_info) Privacy Policy (http://www.plm.automation.siemens.com/en_us/legal.shtml)
Terms of Use (http://www.siemens.com/terms_of_use) Digital Id (http://www.siemens.com/digital_id_en)
Report Piracy (http://www.plm.automation.siemens.com/en_us/about_us/piracy/index.shtml)

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 6/7
18/2/2017 Solved:SpreadsheetintextformatSiemensPLMCommunity363523

https://community.plm.automation.siemens.com/t5/forums/v3_1/forumtopicpage/boardid/NXDesignForum/threadid/8117/page/1 7/7

You might also like