Message 1 of 5
Not applicable
06-04-2019
12:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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()))
Solved! Go to Solution.