Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to check if a length is in increments of 0.5 CATIA V5 ADVISOR

Status
Not open for further replies.

eduardopinto07

Automotive
Feb 28, 2014
20
Hello colleagues,
I am trying to create a check using CATIA V5 knowledgeware advisor.
I have a length parameter and would like to check if it is in 0.5 increments.
Ex
100-true
102.5-true
102.3-false
100.1-false
305-true
I don't need macros(VB, VBA, CATScripts, etc...)
I need in EKL using advisor

Any help will be really appreciated!

Best regards

Eduardo
 
Replies continue below

Recommended for you

since the mod function in KWA only accepts integers, I looked into alternative representation of the modulo function
(see e.g. wikipedia "modulo operation"
implement below line as a check:
Length.1/1mm-0.5*floor(Length.1/1mm/0.5)==0

or prescribe that the length parameter is in increments of 0.5 (right click, change step, new value)

regards,
LWolf
 
Hi LWolf,

Thanks a lot for your comment!
Yes, I thought the same...in java you can use something like (Num % 0.5==0)...done.....in CATIA the Mod(Real, Integer)...no way...
Thanks a lot!
 
try multiplying the length by 10 and checking that it is in increments of 5 instead of 0.5?

(Length.1*10)/10mm-5*floor((Length.1*10)/1mm/0.5)==0
 
or multiply by 2 and compare with the int... like : int(length.1 /.5mm) - (length.1 /.5mm) ==0

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor