Help for API Script to create a pipe with spheres at both ends along a selected path

Help for API Script to create a pipe with spheres at both ends along a selected path

2way3dtext
Contributor Contributor
1,000 Views
2 Replies
Message 1 of 3

Help for API Script to create a pipe with spheres at both ends along a selected path

2way3dtext
Contributor
Contributor

.

 

The code is then supposed to create a sweep along the unchained selected edge, however,

 the sweep body appears along a chained path despite using:

 

sel = ui.selectEntity('Select a path to create a pipe', 'Edges,SketchCurves')
selObj = sel.entity
 
feats = comp.features
chainedOption = adsk.fusion.ChainedCurveOptions.noChainedCurves
path = adsk.fusion.Path.create(selObj, chainedOption)
path = feats.createPath(selObj)

 

The following code creates a sketch of a semi-circle at the ends of the selected path. The profiles are revolved, creating two spheres at the end of the selected path. Next, the code creates a circle at one end of the selected path

 

I will be very grateful for any suggestions or feedback on fixing this issue.

 

Is there a method to create a pipe body along an unchained path using a loft in API?

 

 

0 Likes
Accepted solutions (1)
1,001 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor
Accepted solution

Hi @2way3dtext .

 

I had overwritten Path.

        # create path
        feats = comp.features
        chainedOption = adsk.fusion.ChainedCurveOptions.noChainedCurves
        path = adsk.fusion.Path.create(selObj, chainedOption)
        # path = feats.createPath(selObj) # <- It's here.
        
        # create profile_1
        planes = comp.constructionPlanes

 

Message 3 of 3

2way3dtext
Contributor
Contributor

Thank you so much for your help!

0 Likes