Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Conditional formula "AND" & "OR" Commands

Status
Not open for further replies.

rba032

Marine/Ocean
Jul 19, 2012
3
0
0
EU
Hi All,
I need some help with the positioning & quantity of brackets when writing Conditional formula "AND" & "OR" Commands.

I'm looking to create a variable part model to replace 28 single plates,
The plate is circular with a starting inside dia of 50 up to dia 320.
The size of the holes and the quantities of the holes change at set points.
I have written these Conditional formulas (which work) as:

[-HOLE QTY-] =ABS(4*( INSIDE_DIA <110)OR(6*( INSIDE_DIA <190)AND( INSIDE_DIA >=110)OR(8*( INSIDE_DIA <330)AND( INSIDE_DIA >=190))))

[-HOLE DIA/DRILL SIZE-] =ABS(13*( INSIDE_DIA <70)OR(19*( INSIDE_DIA <240)AND( INSIDE_DIA >=70)OR(26*( INSIDE_DIA <330)AND( INSIDE_DIA >=240))))

but when I repeat this formula for the (P.C.D'S and) outer diameter the model is not adjusting and only correct for the max size 330:

=ABS(164*( INSIDE_DIA <60)OR(174*( INSIDE_DIA <70)AND( INSIDE_DIA >=60)OR(220*( INSIDE_DIA <80)OR(230*( INSIDE_DIA <90)AND( INSIDE_DIA >=80)OR(240*( INSIDE_DIA <100)OR(250*( INSIDE_DIA <110)AND( INSIDE_DIA >=100)OR(260*( INSIDE_DIA <120)OR(270*( INSIDE_DIA <130)AND( INSIDE_DIA >=120)OR(280*( INSIDE_DIA <140)OR(300*( INSIDE_DIA <150)AND( INSIDE_DIA >=140)OR(310*( INSIDE_DIA <160)OR(320*( INSIDE_DIA <170)AND( INSIDE_DIA >=160)OR(330*( INSIDE_DIA <180)OR(340*( INSIDE_DIA <190)AND( INSIDE_DIA >=180)OR(350*( INSIDE_DIA <200)OR(360*( INSIDE_DIA <210)AND( INSIDE_DIA >=200)OR(370*( INSIDE_DIA <220)OR(380*( INSIDE_DIA <230)AND( INSIDE_DIA >=220)OR(390*( INSIDE_DIA <240)OR(405*( INSIDE_DIA <250)AND( INSIDE_DIA >=240)OR(415*( INSIDE_DIA <260)OR(425*( INSIDE_DIA <270)AND( INSIDE_DIA >=260)OR(435*( INSIDE_DIA <280)OR(445*( INSIDE_DIA <290)AND( INSIDE_DIA >=280)OR(455*( INSIDE_DIA <300)OR(465*( INSIDE_DIA <310)AND( INSIDE_DIA >=300)OR(485*( INSIDE_DIA <320)OR(495*( INSIDE_DIA <330)AND( INSIDE_DIA >=320)))))))))))))))))))))))))))))

This is the original link used to reference:

I want the part model to be written with Conditional formula so when placed into an assembly it can be adjusted to suit with a single adjustable dimension entry. The inside diameter.

Thanks
 
Replies continue below

Recommended for you

Quote -" I'm looking to create a variable part model to replace 28 single plates."

You can't.
Part models are not variable in the way you are suggesting.
You can create a Family of Parts, but I don't think all your formulae will help with that.

Other than that the only thing I can advise is the number of Left-facing brackets = the number of Right-facing brackets.

bc.
Core i5-3570 @3.4GHz , 8GB RAM
Quadro FX4600. W7 Pro 64-bit.
 
Thanks for your post. I’ve not accepting that "it can't" be done, because “it can”:

The equal brackets makes sense, but the example link “soliddna” have double brackets in their formula post. How I have posted the formula is exactly how it pastes into the Variable table, different and it will be rejected. I wanted to see if anyone could rewrite the formula differently in a way which would also be accepted by the Variable table and correctly adjust.

This previous short formulas work for the hole quantities and the hole sizes on the plate, for the 28 sizes.

The problem is the plates do not have a consistent increase in overall diameter and P.C.D.’s
If they did I could write simple formula example INSIDE_DIA +50 in the Variable table.
I’ve now re written a much shorter formula for the same overall diameter formula in first post by creating a fixed dimension of the bore from the INSIDE_DIA a formula can now be written for this at the sizes where the non consistencies occur:

New typed variable bore into table [Rad_Hgt_OD] =ABS(94*( INSIDE_DIA <70)OR(130*( INSIDE_DIA <140)AND(INSIDE_DIA >=70)OR(140*( INSIDE_DIA <240)AND(INSIDE_DIA >=140)OR(145*( INSIDE_DIA <310)AND(INSIDE_DIA >=240)OR(155*( INSIDE_DIA <330)AND(INSIDE_DIA >=310))))))

[OVERALL DIAMETER] = INSIDE_DIA +(2* Rad_Hgt_OD )


As suggest by work colleague/boss. Thank you!
One part to replace 28 non consistent parts – one dimension ‘the id size’ required for assembly entry.
No family of parts.
 
When I said it can't be done, I was referring to using only one model for 28 different options.
(This you can do in SolidWorks with part configurations.)

You can, however, generate one model and set up your variable table as required, then COPY this part 27 more times. In each one you then only need to modify one or two variables to generate the correct size.
This is the method I use for many of our standard parts.

This method was not what you implied in your original post.
Sorry if I misunderstood.

bc.
Core i5-3570 @3.4GHz , 8GB RAM
Quadro FX4600. W7 Pro 64-bit.
 
Don’t copy anything. It can be done, 1 to replace 28, I posted the answer as courtesy/reference in the previous post as there is limited information available as to how this can be done.

One part, one adjustable dimension for assembly placement.
The remaining information is written using conditional formula in the 1 par file with non consistent Outer-diameters, PCD’s, Hole Qty’s & Hole sizes.

Here it is again screen dumped from my variable table:
Dim ANGLE 15.00
Dim ANGLE_FLUSH_CUTOUT 360.00
Dim BORE_B 70.0 Formula = SEAL_SIZE +20
Dim DIM_A 164.0 Formula = BORE_B +( Rad_Hgt_OD )
Dim DIM_C 142.0 Formula = BORE_B +( Rad_Hgt_PCD_C )
Dim DIM_D 142.0 Formula = BORE_B +( Rad_Hgt_PCD_D )
Var DIM_G 12.0 Formula & Limit =ABS(12*( SEAL_SIZE <70)OR(18*( SEAL_SIZE <240)AND( SEAL_SIZE >=70)OR(22*( SEAL_SIZE <330)AND( SEAL_SIZE >=240))))
Dim ExtrudedProtrusion_7_FiniteDepth 25.0
Var Hole_11_Diameter 30.0 Limit
Dim Hole_11_FiniteDepth 1.0
Var Hole_12_Diameter 6.0 Limit
Dim Hole_12_FiniteDepth 16.0
Var Hole_12_VBottomAngle 118.00 Limit
Var Hole_2_Diameter 12.0 Limit
Var Hole_3_Diameter 13.8 Limit
Dim Hole_3_FiniteDepth 20.0
Var Hole_3_ThreadDepth 15.0 Limit
Var LIFT_PCD 4.000 Limit
Var MOUNTING_PCD_F 4.000 Formula & Limit =ABS(4*( SEAL_SIZE <110)OR(6*( SEAL_SIZE <190)AND( SEAL_SIZE >=110)OR(8*( SEAL_SIZE <330)AND( SEAL_SIZE >=190))))
Var Rad_Hgt_OD 94.000 Formula =ABS(94*( SEAL_SIZE <70)OR(130*( SEAL_SIZE <140)AND( SEAL_SIZE >=70)OR(140*( SEAL_SIZE <240)AND( SEAL_SIZE >=140)OR(145*( SEAL_SIZE <310)AND( SEAL_SIZE >=240)OR(155*( SEAL_SIZE <330)AND( SEAL_SIZE >=310))))))
Var Rad_Hgt_PCD_C 72.000 Formula =ABS(72*( SEAL_SIZE <70)OR(95*( SEAL_SIZE <110)AND( SEAL_SIZE >=70)OR(100*( SEAL_SIZE <240)AND( SEAL_SIZE >=110)OR(105*( SEAL_SIZE <310)AND( SEAL_SIZE >=240)OR(115*( SEAL_SIZE <330)AND( SEAL_SIZE >=310))))))
Dim Radial_Diameter_1 164.0
Dim Radial_Diameter_2 50.0
Dim Radial_Diameter_3 142.0
Dim Radial_Diameter_4 142.0
Dim Radial_Diameter_5 12.0
Dim Radial_Diameter_6 70.0
Dim REFERENCE_C 142.0 Formula = BORE_B +( Rad_Hgt_PCD_C )
Dim RefPlane_4_FiniteAngle 22.50
Dim SEAL_SIZE 50.0

Make SEAL_SIZE the adjustable dimension “please enter the required seal size Range 50-329.9”
Then enter your required size when prompted in assembly.

One command from one part to replace 28.
Note: There were more PCD’s and Hole information in the screen dump but removed for part protection and simplification.
 
OK, so you can achieve this with an adjustable part.
BUT - its technically still only one part and will show as such in a parts list.
If the different 'configurations' need different part numbers then they have to be different part files.

bc.
Core i5-3570 @3.4GHz , 8GB RAM
Quadro FX4600. W7 Pro 64-bit.
 
Status
Not open for further replies.
Back
Top