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!

CATIA V5 Conditional Statements

Status
Not open for further replies.

filospinato

Mechanical
Dec 1, 2006
8
0
0
US
Hi,
I can't seem to figure out the syntax, or if this is even possible. I'm working in the Law Editor.
I would like to write a conditional statement that will change an angle in a part based on a string type parameter.

Ex. IF `valve` = closed, THEN angle = 90deg

Any help/examples/syntax pointers would be appreciated.
Thanks,
Jake
 
Replies continue below

Recommended for you

Thanks, getting closer. I was able to get the angle to snap to 90 by getting back into the rule and hitting 'apply' and 'ok' but it wouldn't update when I changed the parameter from 'open' to 'closed'. Ideally it would snap the valve arm over when the parameter was changed in its drop down menu. Also, should I create two rules, one for open and one for closed, or can I do an if/else statement?
Thanks,
Jake
 
Still not working like I had hoped. When I pick the string parameter from the drop down list under Parameters in the tree, the angle fails to update according to the rule.
Anything else I should be doing?
 
I think a little of both. I can switch the parameter in the tree and nothing happens, no update swirl, nothing. I can go into the law and hit apply, ok and when the law editor closes, it will update. I'm trying to get it to update simply by changing the parameter in the tree. I fooled around with it some more yesterday without any success.
 
Try starting from scratch. Create a new part and in that part create the multi value Valve parameter and an Angle parameter set to 45°

create a simple sketch that you can link Angle to.

create rule
if Valve == "closed"
{
Angle=0deg
}
else
{
Angle=90deg
}

this will prove the concept
 
Status
Not open for further replies.
Back
Top