Inventor 2023 crashes when iLogic saves a part with model states

Inventor 2023 crashes when iLogic saves a part with model states

martin_pedersen
Explorer Explorer
254 Views
1 Reply
Message 1 of 2

Inventor 2023 crashes when iLogic saves a part with model states

martin_pedersen
Explorer
Explorer

Inventor crashes when saving IPT with model states and iLogic rule as below.

It crashes when triggered by Rules On Events: "After Save Document".

 

ThisDoc.Document.ComponentDefinition.ModelStates.MemberEditScope = MemberEditScopeEnum.kEditAllMembers
'do something
ThisDoc.Document.ComponentDefinition.ModelStates.MemberEditScope = MemberEditScopeEnum.kEditActiveMember

If ThisDoc.Document.Dirty Then
	ThisDoc.Save
End If

Attached is IPT with the rule, and event trigger trigger set.

 

When rule dirties the document it requires a 2nd save...

Is there a workaround?

 

regards

Martin

0 Likes
255 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @martin_pedersen.  I am not 100% sure, but it looks to me like a rule like that, being triggered by the 'After Save Document' event in the Event Triggers dialog, could very likely be causing an endless loop situation, which leads to the crash.  Any rule that is triggered to run 'after' saving a document, should not then include code to save that document again, especially if that code includes actions that may be 'dirtying' the document every time it runs.  When changing the 'MemberEditScope' status, I believe that action alone is dirtying the document, even if nothing else happens in the rule.  Therefore it will attempt to save every time, which triggers the rule again, in an endless cycle.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes