Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Analyze Interference functio in assembly

manu.marjanen
Advocate

Analyze Interference functio in assembly

manu.marjanen
Advocate
Advocate

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

 

0 Likes
Reply
Accepted solutions (1)
211 Views
2 Replies
Replies (2)

dalton98
Collaborator
Collaborator

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

 

0 Likes

manu.marjanen
Advocate
Advocate
Accepted solution
This is exactly what I needed, thank you
0 Likes