Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I try to copy the bodys of occ2 to occ1.
I don't get an error message, but the bodys was not copied.
After this, the bodys in occ2 and occ2 itself should be deleted.
Best regards
Maurizio
comp1 = occ1.component
comp2 = occ2.component
tempBRepMgr = adsk.fusion.TemporaryBRepManager.get()
baseFeatures = comp1.features.baseFeatures
if baseFeatures.count == 0:
bfInput = baseFeatures.createInput()
baseFeature = baseFeatures.add(bfInput)
else:
baseFeature = baseFeatures.item(0)
try:
baseFeature.startEdit()
for body in comp2.bRepBodies:
if not body.isSolid:
continue
bodyCopy = tempBRepMgr.copy(body)
comp1.bRepBodies.add(bodyCopy, baseFeature)
body.deleteMe() # optional
finally:
baseFeature.finishEdit()
Solved! Go to Solution.