Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Volume Block Association using Body Measurement

Status
Not open for further replies.

Axis2084

Automotive
Sep 11, 2012
10
0
0
US
Ok so let me set the ground work.
Using UG NX7.5. Master modeled dwgs

What I’m trying to do is to make my volume block that is on my drawing to be always associated or to show a “NA” value when not. I already callout the attribute for volume on my drawing <X0.2@VOLUME_CM> where the expression “VOLUME_CM” = Body measurement (volume) /1000. “Because of our unchangeable defaults are set at mm^3 we divided by 1000 to get cm.)
What I am using now is : <X0.2@VOLUME_CM> says either the correct volume or the string “NA”. With this new code I get even closer by being able to out put a value or a string in one expression.

(String) NA="NA"
(Boolean) VOLUME_BOOLEAN=if(VOLUME_INTO_CM>0)true else(false)
(String) VOLUME_CM=if(VOLUME_BOOLEAN=true)(format("%0.2f",VOLUME_INTO_CM))else(NA) //IF WANTING TO CHANGE THE PRECISION REPORTED, CHANGE THE "%0.2f" TO "%#f" WHERE # IS THE NUMBER OF DECIMALS YOU WANT
[mm^3]VOLUME_INTO_CM=p41/1000 // or CHANGE THE P41 TO WHATEVER IS THE VOLUME MEASUREMENT
[mm^3]p41=0 //CHANGE THIS TO THE VOLUME MEASUREMENT

The end goal or what I want is a way to call out within the expression a ever changing body measurement p-value. Meaning each time I insert the volume block I want it to look for the new p-value body measurement volume regardless of its p-number. In vb it would be something to do with the righthandside. But I want it to all be internal to the expression list and not needing the vb to be run every time you change the solid.
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top