Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with Combine Features Command

0 REPLIES 0
Reply
Message 1 of 1
jmperez6
402 Views, 0 Replies

Help with Combine Features Command

So I have the following code, however, I keep getting an error message saying "Some input argument is invalid" in the combineFeatures.add() section. I can't figure out what is wrong.
The purpose of this code is to create a copy of the current body, superimpose over the original and run a join function to combine the two, in order to get rid of some imperfections. I've done this through Fusion 360, now I just need to do it by Python.

app = adsk.core.Application.get()

product = app.activeProduct

design = adsk.fusion.Design.cast(product)

model = design.activeComponent

features = model.features

combineFeatures = features.combineFeatures

bodies = model.bRepBodies

body = bodies.item(0)

copyOfBody = body.copyToComponent(body.parentComponent)

bodyCollection = adsk.core.ObjectCollection.create()

bodyCollection.add(body)

bodyCollection.add(copyOfBody)

combineFeatureInput = combineFeatures.createInput(body, bodyCollection)

combineFeatureInput.operation = 0

combineFeatureInput.isKeepToolBodies = False

combineFeatureInput.isNewComponent = True

returnValue = combineFeatures.add(combineFeatureInput)

0 REPLIES 0

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report