- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @eric.smyth. I see a couple things that could be improved upon to possibly avoid some potential problems. First of all, you should either declare your 'oRule' variable, and your 'oRuleExists' variable down within the loop, or re-set their values to False & Nothing at the start of the loop, to make sure a previous value does not carry over into the next loop. Next, the GetRule method will not throw an error if the rule is not found, which may break the functionality of your Try...Catch block. You need to check if oRule Is Nothing after using that method to make sure. Also, you may need to save your changes to those referenced documents after changing the text of their internal rules, or adding an internal rule. But you may be doing that manually, by saving the main assembly afterwards. Maybe just an AssemblyDocument.Update2() when done.
Wesley Crihfield
(Not an Autodesk Employee)