Community
Hello All,
Looking for a little iLogic help. Currently have an iLogic rule in my drawing template that base on user input brings up the Drawing View dialog box (as though you click on base view). I want to know if there is some coding I can do to control or handle what happens if the user clicks the cancel command inside this dialog box. Possibly show a message box. Or even run another rule after the cancel button has been clicked?
Hi,
You could run the "Base" command synchronously and check if the number of views on the sheet changed once the command finished. If it's the same then you can assume that the command got cancelled.
oCM = ThisApplication.CommandManager oDefinition = oCM.ControlDefinitions("DrawingBaseViewCmd") oSheet = ThisApplication.ActiveDocument.ActiveSheet count = oSheet.DrawingViews.Count MsgBox("before - " + Str(count)) oDefinition.Execute2(True) ' synchronous = True If count = oSheet.DrawingViews.Count Then MsgBox("after - " + Str(oSheet.DrawingViews.Count) + _ " - Base command got cancelled") Else MsgBox("after - " + Str(oSheet.DrawingViews.Count) + _ " - Base command succeeded") End If
I hope this helps.
Cheers,