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: 

combine cut feature problem

1 REPLY 1
SOLVED
Reply
Message 1 of 2
brad.bylls
160 Views, 1 Reply

combine cut feature problem

I am having trouble with a combine cut feature.

I have used similar code in other components without problems (simple cut and paste), but this one doesn't work and the exception error tells me nothing to help.

Debugging both codes step by step didn't reveal anything either. Pretty much identical.

A video is attached.

Here is my code in question:

# Create body with combine
    bushingBody = headExt.bodies[0]
    bodyCollection = adsk.core.ObjectCollection.create()
    bodyCollection.add(bushingPFODExt.bodies[0])
    bodyCollection.add(bushingSFODExt.bodies[0])
    model = design.activeComponent
    features = model.features
    combineFeat = features.combineFeatures
    combineInput = combineFeat.createInput(bushingBody, bodyCollection)
    combineFeatur = combineFeat.add(combineInput)

    # Create the ID
    bushingIdSketch = sketches.addWithoutEdges(xyPlane)
    bushingIdCircle = bushingIdSketch.sketchCurves.sketchCircles.addByCenterRadius(center, numBushingID / 2)
    bushingIdSketch.sketchDimensions.addDiameterDimension(bushingIdCircle, adsk.core.Point3D.create(110))
    bushingIdSketch.name = 'I.D. Sketch'
    bushingIdProf = bushingIdSketch.profiles[0]
    bushingIdExtInput = extrudes.createInput(bushingIdProf, adsk.fusion.FeatureOperations.CutFeatureOperation)
    distance4 = adsk.fusion.DistanceExtentDefinition.create(adsk.core.ValueInput.createByReal(numBushingLength))
    distance4A = adsk.fusion.DistanceExtentDefinition.create(adsk.core.ValueInput.createByReal(numBushingLength * -1))
    deg0 = adsk.core.ValueInput.createByString("0 deg")
    bushingIdExtInput.setTwoSidesExtent(distance4, distance4A, deg0, deg0)
    bushingIdExtInput.participantBodies = [combineFeatur.bodies.item(0)]
    bushingIdExt = extrudes.add(bushingIdExtInput)  <<<< line 297 in the exception
    bushingIdExt.name = 'Bushing ID'
Brad Bylls
1 REPLY 1
Message 2 of 2
brad.bylls
in reply to: brad.bylls

Figured it out.

I had to make both distance4 and distance4A positive, even though they were going in opposite directions.

Brad Bylls

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