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: 

how to build pipe with sketch

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
BobWumaker
729 Views, 4 Replies

how to build pipe with sketch

I have use  sketch command to build sketch . and then use fusion 360 button to build 3D PIPE in "Create  :right_arrow: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

 

4 REPLIES 4
Message 2 of 5
BobWumaker
in reply to: BobWumaker

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 

Message 3 of 5
JeromeBriot
in reply to: BobWumaker

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.

 

Message 4 of 5
JeromeBriot
in reply to: BobWumaker

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

pipe-script.PNG

Message 5 of 5
BobWumaker
in reply to: JeromeBriot


@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

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