Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor Drawing View Dialog Box

1 REPLY 1
Reply
Message 1 of 2
rcasper
384 Views, 1 Reply

Inventor Drawing View Dialog Box

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?

1 REPLY 1
Message 2 of 2
adam.nagy
in reply to: rcasper

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,



Adam Nagy
Autodesk Platform Services

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report