I found a small bug in an addin I developed for Inventor. I have buttons on the ribbon specific for the drawing environment that switch the size of the drawing sheet. If the user reaches the A4 paper, the downsize button is disabled and vice versa when reaching paper A0. That works all fine, except when the user switches between different drawing documents. Inventor "remembers" the button settings from the previous file. So when in document 1 the paper size is A4, the size down button is disabled. If you then switch to document 2, the button will still be disabled, even if the paper size is not A4.
So what I am looking for is a way to 'reset' the ribbon when switching between documents. As it is now, the disable ribbon buttons is done On Document Change.
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
Hi @gert-leonvanlier. I haven't worked with the OnDocumentChange Event that much before, but from the sounds of the situation, I would guess that the ApplicationEvents.OnDeactivateDocument Event might be a better choice for re-setting the ribbon. Then maybe use the ApplicationEvents.OnActiateDocument Event to set it back to custom again, when conditions are met. But I am not an expert on creating AddIns yet myself, so I may be wrong.
Wesley Crihfield
(Not an Autodesk Employee)
On Activate Document indeed did the trick. I hadn't found that method yet. Thank you!
Can't find what you're looking for? Ask the community or share your knowledge.