Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

using weight in expressions

Status
Not open for further replies.

druzil69

Mechanical
Jun 18, 2012
16
I am new to this site but haven't found anything on what i am trying to do yet. Basically I have a final unit assembly i need to put a base under. The base is created from I-Beam. I want to set up an expression that either changes the dimensions of the i-beam according to the unit weight or suppresses/un-suppresses different size i-beams. Either is fine. However i can't seem to get the i-beams to change either way after the weight changes. Below are examples of the different expressions i created but dont seem to work. Any ideas what i am doing wrong?

Beam_Heighta if(A_Unit_Weight<=1000)(12.25)else(Beam_Heightb)
Beam_Heightb if(A_Unit_Weight>=1001&&A_Unit_Weight<=5000)(18.59)else(Beam_Heightc)
Beam_heightc if(A_Unit_Weight>=5001&&A_Unit_Weight<=10000)(24.3)else(Beam_Heightd)
Beam_Heightd if(A_Unit_Weight<=10001)(36)else(Beam_Heightb)

12" I-Beam if(A_Unit_Weight<1000)(1)else(0)
18" I-Beam if(A_Unit_Weight>1001&&A_Unit_Weight<5000)(1)else(0)
 
Replies continue below

Recommended for you

Is this exactly what you have so far? If so, I'm surprised it even let you enter the equation for Beam_Heightd because there is a cyclic reference in there. Perhaps the Beam_{h|H}eightc typo let it through.

www.nxjournaling.com
 
thats exactly what i had in there. I saw that reference and meant to change it before posting this and forgot. I have since changed my expression.
 
Also, you will have problems if 1000 < A_Unit_Weight < 1001 or 10000 < A_Unit_Weight < 10001.
These formulas would catch all values up to 10000:

Code:
Beam_Heighta if(A_Unit_Weight<=1000)(12.25)else(Beam_Heightb)
Beam_Heightb if(A_Unit_Weight>1000&&A_Unit_Weight<=5000)(18.59)else(Beam_Heightc)
Beam_Heightc if(A_Unit_Weight>5000&&A_Unit_Weight<=10000)(24.3)else(Beam_Heightd)


www.nxjournaling.com
 
You want one part in your assembly to drive geometry in another part in the assembly, to do so make sure interpart modeling is turned on (customer defaults -> Assemblies -> General -> Interpart Modeling) assuming the site standard allows it. If you are working across levels of the assembly, you may need to force an update (Tools -> Update -> Interpart Update -> Update All).

What version of NX?

www.nxjournaling.com
 
ok i will have to try that. Is there anyway i can do it all inside the same part file?? the final unit assembly is like an "automation". I have about 10 parts in it all done with sketches. I change 6 inputs and all the sketches update accordingly through expressions. Now I need to make the I-beam base update with it as well but it will be based on the size & weight of the unit assembly. I hope that makes sense.
 
druzil69 said:
I have about 10 parts in it all done with sketches.

Just to be clear: do you have 10 separate part files added as components to this assembly, or do you have 1 file with 10 different sketches in it representing 10 different parts?

www.nxjournaling.com
 
10 different sketches, representing 10 different parts. i would like to either keep the base in the same file if possible.
 
I tried to recreate your expressions in your first post, but NX would not accept the formula for Beam_Heightd, it gave a cyclic reference error.
Make sure the delayed after update option is turned off (Tools -> Update).

Are you using units on any of these expressions? Perhaps if the units don't work out it won't apply the values (ie trying to drive a length in a sketch with an expression that has units for pressure).

www.nxjournaling.com
 
The expressions do not evaluate correctly because NX is trying to compare a constant with a weight value (technically a mass value, but we'll ignore that for now).

Create an expression such as weight_condition_1 and give it a value of 1000 lbm (you will have to use the dropdowns to assign the units on the expression). Now change your beam height expressions to be something like:
Beam_Heighta if(A_Unit_Weight<=weight_condition_1)(12.25)else(Beam_Heightb)
You'll see that it now updates correctly when the weight (mass) of the cylinder changes.

Optionally, you might also want to assign the Beam_height expressions unit values of inch to better capture your design intent.

www.nxjournaling.com
 
Well look at that. Its exactly what i was trying to do. Thank you so much!!!! Just a question i guess, why do i need that intermediate step "weight condition". why can't i just link the beam height directly to the unit weight value??
 
The expression A_Unit_Weight is defined in terms of units, the number 1000 in your equation has no units associated with it. To create a logical comparison, both items you are comparing must have equivalent units. Is 500 lbs > 8? Well, that depends on the units associated with the value of 8: 8 grams? 8 tons? 8 amps? A true, false, or you can't do that! answer depends on the units.

I created an intermediate expression that had the same units as A_Unit_Weight. This is a quick & easy way to create a consistent comparison. Perhaps there is a way to add units to a value directly within your equation. I have not tried that.

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

Part and Inventory Search

Sponsor