Message 1 of 2
Ilogic - Model State - Event trigger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having trouble with event trigger when using model state :
We are 4 designer and we use a Shared Project, Inventor 2024
We use an ilogic rule to automate check in of the document. The ilogic rule is trigger for All document using the "Close Document"
The issue we face : the rule is trigger when switching model state. Most of the time the rule fail. Is there a way to avoid the rule to be triggered when switching model state ?
We also notice that the rule fail sometime, only with document using model state, and especially model state that was previously "level of details".
When using the File Status interface and launching the command "check in tree", all the check in are done properly.
Here is a copy of the ilogic code.
Dim oDoc As Document Try If ThisDoc.Document.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then oDoc = ThisDoc.Document Else oDoc = ThisDoc.FactoryDocument End If 'Logger.Debug(oDoc.DisplayName & " : Affectation réussi") Catch Logger.Debug(ThisDoc.Document.DisplayName & " : " & ThisDoc.ActiveModelState & " : Affectation Catch") Exit Sub End Try Try If oDoc.ReservedForWriteByMe = True Then 'Logger.Debug("Document : " & ThisDoc.Document.DisplayName) If oDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then Try oDoc.RevertReservedForWriteByMe Catch 'Logger.Debug(oDoc.DisplayName & " : Drawing Catch") End Try ElseIf oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Or oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then Try oDoc.RevertReservedForWriteByMe Catch Try oDoc.ReservedForWriteByMe = False Catch 'Logger.Debug(oDoc.DisplayName & " : Part and assembly Catch") End Try End Try End If If oDoc.ReservedForWriteByMe = False Then 'Logger.Debug(oDoc.DisplayName & " : Succès check in") Else Logger.Info(oDoc.DisplayName & " : Échec check in") End If End If Catch 'Logger.Debug(oDoc.DisplayName & " : Main Catch") End Try