Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

A Note in NX7.5 with a substring of <W@$SH_PART_NAME> without "_dwg1" 1

Status
Not open for further replies.

PSI-CAD

Computer
Joined
Feb 13, 2009
Messages
997
Location
FR
Hi,

<W@$SH_PART_NAME> gave me drawing_part_name_dwg1 for example

I would like to have a note with "drawing_part_name" instead of "drawing_part_name_dwg1"

I found a grip programm in: to obtain attribut FILENAME

then CTRL-E

full_name = ug_askPartAttrValue( "FILENAME" )

name_without_dwg1 = replaceString( nom_complet, "_dwg1.prt", "" )

It's a little bit complex

Is it possible to have an easy method ?

TIA

Regards
Didier Psaltopoulos
 
If you are using the master model method and you want the name of the model (not the drawing), use <W@$SH_MASTER_PART_NAME>.

www.nxjournaling.com
 
You can eliminate the grip program by using ug_askcurrentworkpart().

Code:
name = replacestring(ug_askcurrentworkpart(), "_dwg.prt", "")

If/when the part name changes, you will need to run "update for external change" to update the expression.

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top