AssemblyComponentDefinition.AnalyzeInterference method crashes Inventor if called for collection of occurrences that includes at least one unresolved ... even when used within Try-Catch block!
The issue can be reproduced on any assembly with at leas one unresolved component with iLogic like:
If Not TypeOf ThisDoc.Document Is AssemblyDocument Then MsgBox("Return",, iLogicVB.RuleName) : Return
Dim aDoc As AssemblyDocument = ThisDoc.Document
Dim acd As ComponentDefinition = aDoc.ComponentDefinition
Dim oTOs As TransientObjects = ThisApplication.TransientObjects
Dim occCol As ObjectCollection = oTOs.CreateObjectCollection
For Each occ In acd.Occurrences
' co.ReferencedDocumentDescriptor.ReferenceMissing Then Continue For
occCol.Add(occ)
Next
Try
acd.AnalyzeInterference(occCol)
Catch ex As Exception
MsgBox("Fail:" & vbLf & ex.Message,, iLogicVB.RuleName)
End Try
MsgBox("Success",, iLogicVB.RuleName)
Dear @MjDeck could you, please, study this?
Hi,
try replacing
Dim acd As ComponentDefinition = aDoc.ComponentDefinition
with
Dim acd as AssemblyComponentDefinition = aDoc.ComponentDefinition
you can optionally add this to chek your test
Dim res As InterferenceResults = acd.AnalyzeInterference(occCol)
MsgBox ( res.count)
Hi Maxim - thanks for reporting this. I created internal issue INVGEN-76860 for it. I think we can fix it soon.
Can't find what you're looking for? Ask the community or share your knowledge.