Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
DRoam
433 Views, 1 Reply

How to enable/disable add-in commands for appropriate environment(s)

I've noticed that Inventor commands will disable themselves if you're not in the appropriate environment. For example, if you place a Parts List in a drawing, then switch to an Assembly and right-click, "Repeat Parts List" in the context menu will be grayed out.

 

I know how to disable a control definition with its "Enabled" property, and I guess I could handle the environment switch event and enable/disable my commands with that. But is that the right way to do it? Or is there a better way? Such as a way to tell Inventor, "this is a Part command", "this is an Assembly command", etc.?