Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.

 

COE DISCUSSION FORUM
Subject: IF or ELSE statements

You are not authorized to post a reply.   
Author Messages
COE-FORUM-USER

21 Mar 2005 02:52 PM
Hi,
Can some body help me in writing if or else statement to the parameter when iam adding formula to it.
I have to write something like this, ID=if(OD-(H-E-F)*2<Thread_major_dia)(Thread_major_dia)else(OD-(H-E-F)*2)

I have the parameters created for OD, H, E, F, Thread_major_dia,Thread_major_dia

But after i say ok, iam getting error like this" invalid structure: Syntax error"
COE-FORUM-USER

22 Mar 2005 01:30 AM
I think you can't use if statement directly on formulas. You have to create a rule.

Rule syntax is
Statement
Parameters behaviour

Like this

IF A==5mm
{
B=A+2mm
C=A/2
}
ELSE
{
B=A+4mm
C=A/B
}

Check the statement operands from Online Documentation.
COE-FORUM-USER

19 Sep 2006 11:24 PM
Hi,

This is a pretty old mail i suppose, do we need KWE module for giving these types if rules?

Is this not possible for us to give these rules in Part design workbench?

Cheers,
Mah.
COE-FORUM-USER

19 Sep 2006 11:33 PM
maha,
yes, you need a KWE license to create rules and checks. You can creatre simple parameters and such in part design, but no Rules....


CLIFFJOHNSON


20 Sep 2006 04:34 PM
You need a KWA license (Knowledge Advisor) not a KWE license (Knowledge Expert).
COE-FORUM-USER

20 Sep 2006 09:15 PM
Thanks Mark & Cliff,

That was really informative, and cliff thanks that you are so precise in what you said, because some people say it as KWA and some KWE, so got confused with it already.

I tried out knowledge advisor, but there too i didnt know how it works. I entered the code in VB script dialog box that was opened, and there was an option called run in that, there were no errors, but nothing happened after that, i have to learn online help to find out what the problem was.

I also tried to create parameters in KWA, but i was not able to create as i do it in part design.

anyway if you have any basic material on KWA, do let me know.

Cheers,
Mah.
CLIFFJOHNSON


21 Sep 2006 06:12 AM
That code is for a KWA Rule, not a vbscript.
I'm a little suprised you didn't get an error, the operator "==" is not valid vbscript.
COE-FORUM-USER

21 Sep 2006 07:36 AM
Hi all,

No need of KWA and some KWE.

You can create "fog law" for this type of simple if and else statements.

Fog law can be created in Part design.



Thanks
Ram
COE-FORUM-USER

21 Sep 2006 09:28 PM
Hey cliff,

I did'nt use this program that is mentioned here, i tried out my own program, what i meant to say was, there it didnt give me any error in VBScript.

Cheers,
Mah.
COE-FORUM-USER

22 Sep 2006 03:11 AM
Is it possible to do this with a SIMPLE script for those without KWA?

If so, can someone submit such a simple example?
You are not authorized to post a reply.
Forums > COE Forums > CATIA V5 > IF or ELSE statements



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)