how to build pipe with sketch

how to build pipe with sketch

Anonymous
1,212 Views
4 Replies
Message 1 of 5

how to build pipe with sketch

Anonymous
Not applicable

I have use  sketch command to build sketch . and then use fusion 360 button to build 3D PIPE in "Create  ➡️Pipe" with help of mouse as following. But I want to finish all the design in fusion 360 API (python),I  can't find example in Pipe Feature    ,i need your help. 

 

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try: 
        app = adsk.core.Application.get()
        ui = app.userInterface

        doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        design = app.activeProduct

        # Get the root component of the active design.
        rootComp = design.rootComponent

        # Create a new sketch on the xy plane.
        sketch = rootComp.sketches.add(rootComp.xYConstructionPlane)

        # Create an object collection for the points.
        points = adsk.core.ObjectCollection.create()

        # Define the points the spline with fit through.
        points.add(adsk.core.Point3D.create(0, 0, 0))
        points.add(adsk.core.Point3D.create(5, 1, 0))
        points.add(adsk.core.Point3D.create(6, 5, 3))
        points.add(adsk.core.Point3D.create(5, 6, 6))
        points.add(adsk.core.Point3D.create(2, 3, 0))
        points.add(adsk.core.Point3D.create(0, 1, 0))

        # Create the spline.
        sketch.sketchCurves.sketchFittedSplines.add(points)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

1.png

 

2.png

 

3.png

 

4.png

 

0 Likes
Accepted solutions (1)
1,213 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

In pipe command , i find just need to choice path and profile type(for example circle),and it could direct build pipe. But I don't know how to do it in Fusion 360 with python 

0 Likes
Message 3 of 5

JeromeBriot
Mentor
Mentor

Hello,

 

AFAIK, the API provides limited access to Pipe features.

You can access solids that are already created in a design but you can't create a new one.

There is no "add" or "createInput" properties for the PipeFeatures object.

 

0 Likes
Message 4 of 5

JeromeBriot
Mentor
Mentor
Accepted solution

There is a sample script called Pipe under the ADD-INS tab:

pipe-script.PNG

0 Likes
Message 5 of 5

Anonymous
Not applicable

@JeromeBriot wrote:

There is a sample script called Pipe under the ADD-INS tab:

pipe-script.PNG


thank you .

i would try method build vertical  plane, build sketch ,sweep to meet the requirment

0 Likes