Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

getting the attribut without the first 11 letters 2

Status
Not open for further replies.

Suslik1987

Computer
Mar 18, 2011
17
Hello i need your help,
is it possible to get an attribute in the drafting application in a table but get only for example the attribute value without the fiorst 11 letters. For example in the part is an attribute abc = 11111111111abcdef.
I want in the drafting application getting the attribute but without the first 11 letters. Íf yes, how is the code to make this?
Thanks
 
Replies continue below

Recommended for you

What version of NX?
Assuming NX 9 (will be similar in other versions), open the expressions dialog, switch the listed expressions to "attribute expressions", look for the expression that references your desired attribute (let's assume it is p1). Now make a new string expression with the formula subString(p1, 12,1000). The 12 tells the function to start with the 12th character in the given string, the 1000 can be any number equal to or larger than the number of characters in the given string.

www.nxjournaling.com
 
Cowski, Glad to see that you can use more characters in the substring command than are in the actual string. PTC Creo does not and errors on that command if the initial string lnegth is longer than the last character it is looking for.

A solution is to use the length() function in combination with the substring function.

name = substring(p1,12,length(p1)) will always return the 12th through the end of the p1 string.
If p1 is 11111111111abcdefghi, then name will be abcdefghi



"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
Nice - I wanted to use the length() function, but the wording of the function parameters made it sound like it would only work with a list.

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

Part and Inventory Search

Sponsor