Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
manu.marjanen
212 Views, 2 Replies

Analyze Interference functio in assembly

Analyze Interference functio in assembly

I would like to find which of these green parts (part:2, part:3, part:4...etc) cut into the blue part (Part:1) and remove them, is that possible?

 

manumarjanen_0-1659453371413.png

 

dalton98
in reply to: manu.marjanen

Here is an example that i modified from  the api helper. It can be found... Top right > (?) icon > "help" > "api helper" >

search "Analyze" an you should be able to find it.

This is very cool though, didn't know about it.

Dim oAss As AssemblyDocument = ThisApplication.ActiveDocument

Dim oSelectedOccs As ObjectCollection
oSelectedOccs = ThisApplication.TransientObjects.CreateObjectCollection
Dim oOcc As ComponentOccurrence
For Each oOcc In oAss.ComponentDefinition.Occurrences
	If Not oOcc.Name =  "blue part:1"
	oSelectedOccs.Add(oOcc)
	End If
Next

Dim oCheckSet As ObjectCollection
oCheckSet = ThisApplication.TransientObjects.CreateObjectCollection
Dim obj2 As ComponentOccurrence
obj2 = oAss.ComponentDefinition.Occurrences.ItemByName("blue part:1")
oCheckSet.Add(obj2)

Dim oResults As InterferenceResults
oResults = oAss.ComponentDefinition.AnalyzeInterference(oSelectedOccs, oCheckSet)


MessageBox.Show(oResults.Count)
Dim oResult As InterferenceResult
For Each oResult In oResults
	oResult.OccurrenceOne.Delete
Next

 

manu.marjanen
in reply to: dalton98

This is exactly what I needed, thank you