×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Rule in CATIA V5 - odd/even number

Rule in CATIA V5 - odd/even number

Rule in CATIA V5 - odd/even number

(OP)
Hi.
I need some help with Knowledge Advisor module.

I am trying to make a rule for odd-number and even-number.

Here is my way of thinking:

If X/Y = even-number - I dont know how to creat this part, the result should be Integer but I can make a "CHECK" for that
{
`Construction Elements\Offset_X\Offset` =0
}
else
{
`Construction Elements\Offset_X\Offset`=Y/2
}

I saw some function in c++, but it doesnt work for Catia, can You help me ?
"if ( integer % 2== 0 )

// if the integer when divided by 2 has no remainder then it's even.

cout << integer << " is even "
<<endl;
else

// the integer is odd"

RE: Rule in CATIA V5 - odd/even number

you can use mod function for that.

mod((x/y),2)==1) will be true if (x/y) is even
mod((x/y),2)==0) will be true if (x/y) is odd

Eric N.
indocti discant et ament meminisse periti

RE: Rule in CATIA V5 - odd/even number

(OP)
Thanks a lot, it works. Here is my code, maybe it will be helpfull for somebody

If mod((X/Y),2)==1

{
`Construction Elements\Offset_X\Offset`=Y /2
}

if mod((X/Y),2)==0

{
`Construction Elements\Offset_X\Offset`=0*1mm
}

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources