Cancel
Showing results for 
Search instead for 
Did you mean: 

NX8 drafting automated text: can I split the resulting string using some form of expression?

PLM World Member Experimenter PLM World Member Experimenter
PLM World Member Experimenter

Hello, I'm new to the community and don't know if this is the right place to post my question. There does not seem to be a forum dedicated to NX modeling or drafting...

 

I'm creating a template for drawings in NX8. In the drafting application I have found there are automated text values that one can use on drawings. For instance the <W@ $SH_PART_NAME> variable can be used to print the filename on a drawing.

In my company the filename always is built up from the part number and a descriptive name eg.

123.45678.90 - description.prt

I would like to split the value of the above mentioned variable and display the part number in one cell of a table and the description in another.

I have found a function called subString that allows you to do this, but it is only available in the expression editor. The expression editor is only available in modeling. But: the variable <W@ $SH_PART_NAME> is not available in modeling.

 

Does anyone have a bright idea how to solve this?

 

Thank you in advance. Kind regards,

Maurits Hermans

4 REPLIES

Re: NX8 drafting automated text: can I split the resulting string using some form of expression?

Siemens Phenom Siemens Phenom
Siemens Phenom

There is an option in Customer Defaults which will allow you to access the Expression Editor while in the Drafting module as you currently can do while in Modeling.  Simply go to...

 

Customer Defaults -> Drafting -> Drawing -> General

 

...and at the bottom of the page there is an option titled 'Allow Expression'.  Simply toggled this option ON, hit OK, exit your session of NX, launch a new session of NX and when you enter the Drafting module you will now have access to the Expression editor under the Tools menu.

 

Also note that there will soon be a new forum added to this site dedicated to 'NX Design' which will provide a more appropriate place to post technical questions dealing with the design and modeling aspects of NX.

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA

Re: NX8 drafting automated text: can I split the resulting string using some form of expression?

PLM World Member Experimenter PLM World Member Experimenter
PLM World Member Experimenter

Thank you John!

I was able to enable the Espression editor. Which is defenitely going to be usefull.

But... when I use the variables from the automatic text entry in the drafting documentation I still get a error:

"No such variable: SH_PART_NAME"

 

It seems the variables are only available in text fields (or tables) on the drawings and not for expressions.

 

Any idea's on how to takle this? Are there other variables that contain filename information. Should I resort to journaling and visual basic to create the required functionality?

 

Thank you in advance.

Maruits Hermans

Re: NX8 drafting automated text: can I split the resulting string using some form of expression?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

You can create a temporary expression (string type and type in  ug_askCurrentWorkPart()  in the Formula field).

It will give you a string containing the full part name which you can segregate later on and store it in a different expression using substring function ( you have already mentioned it). This final expression can be used in your drafting tables.

Best Regards

Kapil Sharma

Re: NX8 drafting automated text: can I split the resulting string using some form of expression?

Experimenter
Experimenter

Just thinking loud, if your company also run teamcenter, can¨t you just use DB_PART_NAME,DB_PART_NO and DB_PART_REV? But that will only read attributes form the current loaded part/drawing. It might be missing some brackets.