We use the snippets from iLogic on all of our parts to measure the length, width or height of our parts. However, we have noticed that when a 'Move Face' operation or a 'Replace Face' operation is used, the length measured does not seem to take into account the Move/Replace operations.
Has anyone encountered this before?
And, does this make sense? Are the Move/Replace operations different than other features like Extrude/Revolve? Is there something "ghost-like" about them??? 🙂 The edges work fine on the drawing side, so I'm not sure what is different. Maybe it is the iLogic snippet?
In regards to it being the snippet, is there another code I can use that doesn't require specific feature or part information built in?
Thanks!
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
The Measure.Extents functions should take all features into account. But the part has to be up to date if you want an accurate measure. You should have the statement:
InventorVb.DocumentUpdate()
at the top of your rule, or right before using the Measure.Extents functions.
Also, are you sure the rule is running? How do you trigger the rule?
Mike,
That update code was the key! The routine was running (set to run on save or a Parameter change), and I had tried running it myself manually with no success.
However, I put in the InventorVb.DocumentUpdate() line and it works like a charm.
Out of curiosity, though, what is it updating? The update icon (lightning bolt) wasn't active, so what does this update?
Regardless, though, it works now so thank you very much.
The function is updating the part features and geometry, the same as the lighting bolt icon does. The icon might not be active after you change a parameter and the entire operation finishes. But at the particular time when the rule runs (during that overall operation), the part is not guaranteed to be up to date.