- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a rule with some code I found online that resorts the hole chart on a drawing. I am trying to activate it to resort right before a save so that my sequence of letters/numbers is correct before it is saved and printed. My problem is I have tested the rule and it is running "I placed a message in it before and after the code and they both showed up" but the code is not doing the resort. The code is correct because it will resort every time if you run it manually (right click run rule) just not with a event trigger. Any suggestions? I have attached the code and showing I have it in my event trigger. Another wrench in it I found when testing is if I run it before the save and after the save it resorts perfectly just not if it is run only before.
Dim drawDoc As DrawingDocument drawDoc = ThisApplication.ActiveDocument Dim currentSheet As Sheet currentSheet = drawDoc.ActiveSheet ' Get the hole table to sort. Dim table As HoleTable table = currentSheet.HoleTables.Item(1) ' Add it to the select set. drawDoc.SelectSet.Clear drawDoc.SelectSet.Select(table) ' Get the re-sort command and execute it. ThisApplication.CommandManager.ControlDefinitions.Item("DrawingHoleTableResortCtxCmd").Execute
Solved! Go to Solution.