problem with IIF statement

Hello all,

I've written the following IIF statement:

"D1@Boss-Extrude1"=IIF("D2@Sketch1"/10<10,"D2@Sketch1"/10,10)

Which in english should mean:

#1 IF D2/10<10 then D1=10

#2 IF D2/10>10 then D1=D2/10

For some reason only the line #2 is working correctly the first condition is being ignored.

Thanks for the help,

Gil,

SolidworksApi macros