Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

attribute from part of "part name"

Status
Not open for further replies.

studiotreccani

Mechanical
Nov 28, 2012
80
I need to have my own "callout" that is a part of the "name part"
com0000_000_P001_EXAMPLE.PRT
i need to create a attribute MYCALLOUT= 001
inside the part for all the part of the assembly.
i find this thread but i don't know how modify this.
thread561-365279
thread561-316998
I need to do that to create some exploded view of some subassembly
without lose a univocal "callout"

NX 7.5 64bit
NX 9.0.3.4 MP4 64bit

 
Replies continue below

Recommended for you

Do you want this attribute added at the component level so it can be unique in each assembly, or added at the part level?

com0000_000_P[highlight #FCE94F]001[/highlight]_EXAMPLE.PRT

Is the callout location consistent within the part name? From your example, I'd guess it starts after "_P" and ends at the next "_". Is this always the case?

I see you have NX 7.5 and 9 listed in your signature, which version will this code be run on?

www.nxjournaling.com
 
Hi,
1)To be clear, when after the command i will open the single "component/part"(example a "...screw.prt")
I'll need to see MYCALLOUT, so to see the univoque callout at every level of the
assembly (and decide later where to create the explode view)

2)Yes is always the case, keep in mind that a case of name could be COM0000_000_P001[highlight #FCE94F]_P[/highlight]LATE.PRT

3)The best is both but if is not possible NX9

Thank in advance.

NX 7.5 64bit
NX 9.0.3.4 MP4 64bit

 
Here is one way to do it in the expression editor:
[ol 1]
[li]get the name of the current work part[/li]
[li]split the name at the underscore character[/li]
[li]get the third section of the part name[/li]
[li]remove the first character of the resulting string[/li]
[/ol]

In the picture below, I created 4 expressions and named them so they would show up in order. The names can be whatever you want; you could even combine them into a single (large) expression. If the part name changes, you will have to use "update for external change" to update the expressions (they won't update automatically).

Once you have the callout as an expression, you can create a callout attribute and link to this value. If you use the parts list command, you can set it up to use your attribute for the callout instead of the default value.

download.aspx


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

Part and Inventory Search

Sponsor