Formula help needed
Formula help needed
(OP)
What I have is an angle that needs to be <10° and it's driven by another dimension. What I want is for the driving dimension to grow by 100mm until the angle drops under 10°. I tried a nested IF statement, but that didn't work.
This is what I tried to use, unsuccessfully: =if("Bridge Angle@Driving Sketch">10, 450, If("Bridge Angle@Driving Sketch">10,550,If("Bridge Angle@Driving Sketch">10, 650,304.8)))
It changed the driving dimension to 450 and stayed there even though the angle remained <10°.
Any thoughts?
This is what I tried to use, unsuccessfully: =if("Bridge Angle@Driving Sketch">10, 450, If("Bridge Angle@Driving Sketch">10,550,If("Bridge Angle@Driving Sketch">10, 650,304.8)))
It changed the driving dimension to 450 and stayed there even though the angle remained <10°.
Any thoughts?
Jeff Mirisola, CSWE
My Blog






RE: Formula help needed
=if("Bridge Angle@Driving Sketch">10, "Bridge Distance@Driving Sketch" + 100, "Bridge Distance@Driving Sketch")
This should add 100 each rebuild until the angle is <= 10.
What you have is equivalent to:
CODE
If ("Bridge Angle@Driving Sketch">10) Then "Bridge Distance@Driving Sketch" = 450 Else If ("Bridge Angle@Driving Sketch">10) Then "Bridge Distance@Driving Sketch" = 550 Else If ("Bridge Angle@Driving Sketch">10) Then "Bridge Distance@Driving Sketch" = 650 Else "Bridge Distance@Driving Sketch" = 304.8 End If End If End IfSo when the angle is greater than 10, the distance would get set to 450, and none of the other if conditions would be evaluated. If the angle was less than 10, all of the if conditions would fail and the distancewould be set to 304.8.
RE: Formula help needed
Jeff Mirisola, CSWE
My Blog
RE: Formula help needed
RE: Formula help needed
In the attached picture, everything that is named corresponds to a field in DriveWorksXpress that we'll fill out per a data sheet our customer fills out. On the middle-bottom right, just above the 'Castable' dimension is the driving dimension (Σ500)I've been talking about. The angle that I'm trying to control, the one that needs to be =<10.2°, currently shows 10.91°. I still need to apply more controls to some of the other dimensions, but if I can't get past this current hurdle, the rest won't matter anyway.
I'm going to auto-running a macro (from EEnd) via an equation, something I didn't know you could do, and see how that goes.
Jeff Mirisola, CSWE
My Blog
RE: Formula help needed
I get a compile error when I try to run the macro. I changed the bridge distance reference to the dim's actual name, but don't believe I caused any other changes. Thoughts?
CODE -->
Sub main() If ("Bridge Angle@Driving Sketch" > 10) Then "FromCastable@Driving Sketch" = 450 Else If ("Bridge Angle@Driving Sketch" > 10) Then "FromCastable@Driving Sketch" = 550 Else If ("Bridge Angle@Driving Sketch" > 10) Then "FromCastable@Driving Sketch" = 650 Else "FromCastable@Driving Sketch" = 304.8 End If End If End If Set swApp = Application.SldWorks End SubJeff Mirisola, CSWE
My Blog
RE: Formula help needed
CODE
=if("Bridge Angle@Driving Sketch">10, 450, If("Bridge Angle@Driving Sketch">10,550,If("Bridge Angle@Driving Sketch">10, 650,304.8)))would not give the result that you desired. It was not intended as something that would work.
Eric
RE: Formula help needed
Jeff Mirisola, CSWE
My Blog
RE: Formula help needed
- Create a construction line from corner that the 10.91 dimension is attached to down to the construction line that the Σ500 dimension is on.
- Add an angular dimension so that it is at 10.2 degrees.
- Create a driven dimension that would be what Σ500 would be if you did not have to have the length be 450 + n*100. Call it FromCastableRaw.
- The equation for Σ500 would then be =ceiling(("FromCastableRaw@Driving Sketch" - 450) / 100, 1) * 100 + 450.
Eric