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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Convert a brep edge into a path object for a sweep

Message 1 of 6
796 Views, 5 Replies

Convert a brep edge into a path object for a sweep

I'm trying to create a sweep in my Python add-in. The sweepFeatures.createInput method take in a path object as its second argument. I currently have a Brep edge that I want to use as my path. How do I turn the Brep edge into a path object so that I can pass it into the createInput method?

Message 2 of 6
in reply to:

Features.createPath can take a brep edge object, and then return a Path object to you.
Message 3 of 6
in reply to: frankzhang

Thanks! One follow up question, when I try to create my sweep it keeps creating a zero distance sweep. Can you tell me what I'm doing wrong?

        prof =  sketch.profiles.item(0)
        sweeps = rootComp.features.sweepFeatures
        swInput = sweeps.createInput(prof, rootComp.features.createPath(edge, False), adsk.fusion.FeatureOperations.CutFeatureOperation)
        swInput.distanceOne = adsk.core.ValueInput.createByReal(1)
        swInput.distanceTwo = adsk.core.ValueInput.createByReal(0)

EDIT: So it appears that in some arbitrary situations the sweep works fine and in other it does not:
Why would the 2 sweeps on the left be working and the ones on the right not?

Message 4 of 6
in reply to:

There is no much context in your post, based on the code you posted, i guess you should not use adsk.fusion.FeatureOperations.CutFeatureOperation as your third parameter in createInput method, try using adsk.fusion.FeatureOperations.NewBodyFeatureOperation to see if it helps or not.

In addition, it is better you attach the image in this forum directly, due to some reasons, I am not able to see that image right now.
Message 5 of 6
in reply to: frankzhang

Here's The image, the left two loft's are successfull whereas the right two are not. I am intending to do a cut sweep and not a new body sweep. Here's a whole series of reptitions of my add-in:



 Here is my add-in on github:
I apologize for the messiness of my code ):.

The add-in creates "dogbone" fillets for wood milling and jointery. It take in an edge interior to a corner as an input. The user can select multiple such edges to create multiple dogbone fillets.

The methodology is as follows:
1) Create a construction plane on the end of the interior edge
2) Create a seketch on the plane
3) Identify the two edges that define the angle of the corner and project them into the sketch

4) Use the projected edges to sketch a constrained circle

5) Perform a sweep with the cut operation along the entire length of the interior edge

Message 6 of 6
in reply to:

Thanks for the patience, we found that there is a small error in the Path API, which will cause the sweep failure, since sweep uses a path object as its parameter. The good news is that the issue is fixed now, external clients would not see this issue in the next Fusion update.

Your addin should be able to create all the dogbones successfully then.

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