×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Size attribute in block...

Size attribute in block...

Size attribute in block...

(OP)
Hi. I am wondering if there is a way to get a block size attribute to automatically update when I change the block parameters.

Basically, I am making a new component and creating a block on layer 1. I am giving the file an attribute called "description" and I want the value to be the block size, and be able to have the value update if I change the block parameters.

Is this possible?

Thanks in advance.

RE: Size attribute in block...

Attached is an NX 5.0 Part file with a Part Attribute named 'DESCRIPTION' which contains the X,Y,Z lengths of a 'Block' (note that I also threw in an Attribute which reflects the MASS of the 'Steel' Block).  Just look at the Expression dialog and you will see how the 'Attribute Expressions' were formatted.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

(OP)
Thanks John. I am playing around with this in NX6. I am trying to get this attribute value (DESCRIPTION) to show up in the column "Description" and that column is still blank. Is there any way to get the x,y & z values to show up in the description column for exporting to a spreadsheet for ordering block sizes?

Thanks again!  

RE: Size attribute in block...

Attached is a Drawing of the same 'Block_with_Attribute' part and I had no problems getting the Description Attribute to be included in the Parts List.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

(OP)
Thanks John. I'm sorry, but I think I misled you on what I am looking for. What I would (ideally) like would to have the size description show up in the model tree (assembly navigator) under the column titled "File Description".
I am starting to think that this may not be possible.

I can get the description to show up in the partslist...



Thanks again.

RE: Size attribute in block...

Not a problem.  Just open the Assembly Navigator, place your cursor over some 'white space', press MB3 and select the...

Columns -> Configure...

...option.  When the dialog comes up, enter the name of the desired Attribute, such as 'DESCRIPTION', in the field at the bottom of the dialog labeled 'Attribute' and hit OK.  Now there will be an additional column added to your Assembly Navigator which will contain the 'value' of that Attribute for each Component in your Assembly.  Note that you can add as many user-defined Attribute columns as you wish, and once created, they can be toggled ON/OFF like any other column in the Navigator.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

(OP)
Sweet! Thanks so much John. This just solved a lot of problems for me!

RE: Size attribute in block...

(OP)
John, I am trying to get the same result with an inch file, 3 place decimal, and can't get the 3plc decimal to show up in the assembly navigator when I add the "DESCRIPTION" COLUMN. It is only showing the first number like "1" instead of 1.125

Is there a way to have 3 plc decimals show up in english?

Thanks again.
Adam

RE: Size attribute in block...

OK, in the Expression where you find the following string...

...("DESCRIPTION",format("Block: %0.0fmm X ",p18)+format(...

...wherever you see the string %0.0f, change it to %0.3f (the number after the period defines the number of decimal places shown in the resulting string).

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

(OP)
Got it. Thanks! Do you know if i can get a quantity to show up in the navigator? There is a quantity column, but it just shows 1 for everything?

Thanks for all your help!

RE: Size attribute in block...

The 'Quantity' column is the number of Components, and while single Components obviously only shows a '1', if it's an Assembly or Sub-Assembly, the column will show the number of components which makes up that particular Assembly/Sub-Assembly.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

John,
pushing the chanlange a little bit further, how would you get the X/Y/Z length of a solid if that solid X direction was continued by a flange?
I'm trying to figure-out how NX can extract the raw material dimensions of a plate not matter if that plate if flat or bent...  

RE: Size attribute in block...

Attached is an example of a part where I've created a 'Length' Measurement of the edges of this model (double click on the Measurement feature to see the edges being measured).  Granted, this would not be the flattened length but it could be computed using a neural axis calculation, or I could have created this as a sheet metal model and then I could have measured a flattened solid which would be accurate.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

Just wondering why using the approach above (...("DESCRIPTION",format("Block: %0.0fmm X ",p18)+format(...)
does not update when using interpart expressions? sad

RE: Size attribute in block...

You may have to force an update using...

Tolls -> Update -> Update for External Change

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

Excuse me, I meant:

Tools -> Update -> Update for External Change winky smile  

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

(OP)
Ok. Not trying to beat a dead horse here. I have been using this expression in all my designing and it works great for me. However, it would be even better if the "description"  showed the size attributes in order, regardless of xyz values.

Like 2.00 x 3.25 x 7.00 instead of  3.25 x 7.00 x 2.00

It just makes it easier for the steel vendors.

Is this at all possible John?

Thanks again.
Adam

RE: Size attribute in block...

You mean you want to 'sort' the order, smallest-to-largest, irrespective of whether the values represent 'Length (X)', 'Width(Y)' or 'Height(Z)', correct?

I'll have to think about that one.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

Hello John,

I have everything working quit well with this Expression formula, but I have a question, can you do something similar for a "STRING"-type of expression?

I want to eather have "COLDFORGED TUBE" versus "HOTFORGED TUBE" determed by a ug_setPartAttrValue.

Many thanks,
 


Best regards,

Pascal,

NX5.04+TC2007 (GM Toolkit) / NX7.5 native

RE: Size attribute in block...

Not sure exactly what it is that you're attempting to do nor what is controlled (triggered) by what.  Could you be a little more detailed in your description of what you're looking for?

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

Hello John,

I have this working to set a Part Attribute "MATERIAL", this can be:
   S235JRH | S275JOH/J2H | S355JOH/J2H for "Cold Forged Tube"
   or S355NH/J2H for "Warm Forged Tubes"

This is set by these Expressions:
   INPUT_MAT =235 or 275 or 355
   INPUT_C_W=0 or 1 (Where 0 is for Cold Forged Square Tube and 1 is for Warm Forged Square Tube)

A part of the Expression formula to set Part Attribute "MATERIAL" is:
   MATERIAL_Attribute=Ug_setPartAttrValue(if((INPUT_MAT ==235)&&(INPUT_C_W==0))(ug_setPartAttrValue("MATERIAL",format("S%0.fJRH",INPUT_MAT)))else(if((INPUT_MAT ==275)&&( INPUT_C_W ==0))(....)

I would now like have an Expression formula for "DESCRIPTION":
  Where if INPUT_C_W==0 then "COLD FORGED SQUARE TUBE" else "WARM FORGED SQUARE TUBE"
 


Best regards,

Pascal,

NX5.04+TC2007 (GM Toolkit) / NX7.5 native

RE: Size attribute in block...

Why are you not doing something for "DESCRIPTION" similar to what you did for "MATERIAL"?

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Size attribute in block...

Hello John,

I found the formula myself, I created the Expression as a "String" type because I thought it needed to be of this type because it was only text, that was my failure...

it must be "Numbers" type Expression, like this:
   DESCRIPTION_Attribute=if(INPUT_C_W==0)(ug_setPartAttrValue("DESCRIPTION",format("%-10s","COLDFORGED")))else(ug_setPartAttrValue("DESCRIPTION",format("%-10s","WARMFORGED")))

The tip is here to use: format("%-8S","aaa")


 


Best regards,

Pascal,

NX5.04+TC2007 (GM Toolkit) / NX7.5 native

RE: Size attribute in block...

Just as a references, here are the other formats:

Formatting strings
       format("%8s","aaa")            "     aaa"
       format("%-8s","aaa")           "aaa     "
Formatting integers
       format("%8d",123)              "     123"
       format("%08d",123)             "00000123"
       format("%d,123)                "123"
       format("%d",123.456)           "123"
Formatting numbers
       format("%8.1f",12.345)         "    12.3"
       format("%08.1f",12.345)        "000012.3"
       format("%8.0f",12.345)         "      12"
       format("%#8.0f",12.345)        "     12."
       format("%8.1e",334.3434)       "3.3e+002"
       format("%8.1E",334.3434)       "3.3E+002"
Adding spaces and text
       format("    %4d",12)           "      12"
       format("  %4d  ",12)           "    12  "
       format("X=%6.2f",12.1111)      "X= 12.11"
       format("%5.1f mm",12.1111)     " 12.1 mm"

Input Arguments:
str - Specify the string
value - Specify a value

Returns:
String - A formatted number string

 


Best regards,

Pascal,

NX5.04+TC2007 (GM Toolkit) / NX7.5 native

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources