Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

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: 

Manipulating dirty model states

1 REPLY 1
Reply
Message 1 of 2
meGVGMF
251 Views, 1 Reply

Manipulating dirty model states

Hi,

 

Just wondering if there's a better way to access, for instance, the material of specific model states after they're changed but before save, that doesn't require activating each individually, which I assume is probably pretty intensive.

 

What I've found is that the model state's `.Document.ActiveMaterial` doesn't update until after save, but activating the model state and accessing the parent document's `.ActiveMaterial` does. But it seems like this would imply it's stored elsewhere, which might make it possible to avoid switching model states at all.

 

Thanks

1 REPLY 1
Message 2 of 2
WCrihfield
in reply to: meGVGMF

Hi @meGVGMF.  If you want to set different materials to different ModelStates, then the only way to do that is by 'activating' each ModelState before making the change, so that the change will be recorded by that ModelState.  The alternative might be to edit the ModelStatesTable directly, because that contains the settings of all ModelStates in the document.  You may be able to use Document.Update instead of Document.Save to induce the internal update too, but that may take a similar amount of time to saving it.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Autodesk Design & Make Report