iLogic is being weird with numbers.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm currently writing some code that checks to see if an update is needed in a part. (This is to avoid having to check out a part if it remiains uneffected by an assembly change) But I'm noticing something very odd. The code doing the check is:
If Parameter("Shelf","Depth") <> UnitDepth - 26 Then RunRule("ShelfSpec")
This however doesn't work correctly, and runs the rule even if the parameter is already correct.
Experimenting I created a new parameter named "ShelfSetBack", set it's value to 26mm and rewrote the code:
If Parameter("Shelf","Depth") <> UnitDepth - ShelfSetBack Then RunRule("ShelfSpec")
This worked but I was annoyed that I had to create a new parameter for no apparent reason. Experimenting further I created another new parameter called "Test", set it's value to 0mm and rewrote the code again:
If Parameter("Shelf","Depth") <> UnitDepth - 26 - Test Then RunRule("ShelfSpec")
This again worked perfectly, but for no apparent reason. It seems that so long as the last part of the argument is a parameter and not a number it seems to work.
Can anyone shed any light of this? (I've also tried writing the vaules into brackets)
Thanks in advance
GavoGarmo