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: 

Calling AssemblyComponentDefinition.AnalyzeInterference Method can crash Inventor even when used within Try Catch

2 REPLIES 2
Reply
Message 1 of 3
Maxim-CADman77
138 Views, 2 Replies

Calling AssemblyComponentDefinition.AnalyzeInterference Method can crash Inventor even when used within Try Catch

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?


2 REPLIES 2
Message 2 of 3
fcozzolino
in reply to: Maxim-CADman77

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)

 

 

Message 3 of 3
MjDeck
in reply to: Maxim-CADman77

Hi Maxim - thanks for reporting this. I created internal issue INVGEN-76860 for it. I think we can fix it soon.


Mike Deck
Software Developer
Autodesk, Inc.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report