How to analyze interference between a component and a body from array?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
There are two components, Component1 (named as wp) and Component2 (wh). The Component2 is actually an array of bodies. This array is positioned relative to the Component1 with some overlap. Supposing that we iterate the bodies within the array from first to last, we need to identify the number of the first body that touched (intersected) with the Component1.
I tried to modify the sample from Fusion 360 API User’s Manual like this:
allOccs = rootComp.occurrences
wp = allOccs.item(0).bRepBodies.item(0)
wh = allOccs.item(1).bRepBodies
bodies = adsk.core.ObjectCollection.create()
for i in wh:
bodies.add(wp)
bodies.add(i)
input = design.createInterferenceInput(bodies)
results = design.analyzeInterference(input)
if results == True:
ui.messageBox('yes')
break
else:
ui.messageBox('no')
bodies.removeByItem(i)
It always returns ‘no’.
Could you please give me an idea how to solve this task?
Alexander.