- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @Jakob_Hamburg. When you say these iLogic rules get ran "at save", do you mean 'before' or 'after' the save? If these things are being done to the drawing 'after' the save, then those changes will not be saved. So, if your drawing gets closed after that, then those changes would get lost. This is one reason that it is usually recommended to make changes to documents before they save, rather than after they save.
Also, why are you using two different code phrases to set the values of two different variables at the start of the rule, but not 'declaring' either variable (using 'Dim' or similar), and not specifying that they will be 'Document' type variables? Then you are using one variable for checking DocumentType, while using the other variable when checking SubType. In some situations, those two code phrases can return different documents.
Also, I would suggest that you use a slightly different method for running your rules.
Instead of using this method: ILowLevelSupport.RunExternalRule Method (String) [iLogicVb.RunExternalRule(sExternalRuleName)], you should try using the very similar IiLogicAutomation.RunExternalRule Method [iLogicVb.Automation.RunExternalRule(oDoc, sExternalRuleName)], which allows you to specify a Document object for the external rule to focus on. This method gives us an extra step of control. However, your external rule must be set-up properly to be able to recognize that Document specification, in order for it to work properly. That usually means using the 'ThisDoc.Doument' code phrase to acquire/specify which Document you want your rule focused on, instead of the 'ThisApplication.ActiveDocument' code phrase.
Wesley Crihfield
(Not an Autodesk Employee)