
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey
I'm trying to build some automated tool with the Fusion 360 API. At the moment I find it very hard to find clear documentation on all the functions.
Here is where I'm stuck, when trying to create a pipe for a selection of lines the .createInput() function keeps trowing me the error like below.
Traceback (most recent call last): File "/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/testGrid/testGrid.py", line 159, in run draw_path(path) File "/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/testGrid/testGrid.py", line 132, in draw_path pipeInput = pipeDraw.createInput() File "/Library/Application Support/Autodesk/webdeploy/production/078c0152f608cb87272eeb7be2226a5f77176092/Autodesk Fusion 360.app/Contents/Api/Python/packages/adsk/fusion.py", line 18063, in <lambda> __getattr__ = lambda self, name: _swig_getattr(self, PipeFeatures, name) File "/Library/Application Support/Autodesk/webdeploy/production/078c0152f608cb87272eeb7be2226a5f77176092/Autodesk Fusion 360.app/Contents/Api/Python/packages/adsk/fusion.py", line 57, in _swig_getattr raise AttributeError(name) AttributeError: createInput
This looks to me that the design.rootComponent.features.pipeFeatues has no atribute named createInput. Where can I find the functions/atributes that design.rootComponent.features.pipeFeatues does have? All other design.rootComponent.features seem to work with the createInput.
Here is my code:
def draw_path(path): app = adsk.core.Application.get() design = app.activeProduct # Get the root component of the active design. rootComp = design.rootComponent # Create a new sketch on the xy plane. sketches = rootComp.sketches xyPlane = rootComp.xYConstructionPlane sketch = sketches.add(xyPlane) # Draw two connected lines. lines = sketch.sketchCurves.sketchLines h = path[0] for point in path: lines.addByTwoPoints(adsk.core.Point3D.create(h[0], h[1], 0), adsk.core.Point3D.create(point[0], point[1], 0)) # in cm h = point pipeDraw = rootComp.features.pipeFeatues
# Error occurs in the next line -> pipeInput = pipeDraw.createInput() # Also tried: pipeDraw.createInput( lines, adsk.fusion.FeatureOperations.NewBodyFeatureOperation) rev = pipeDraw.add(pipeInput)
*ps there seems to be a typo in the API pipeFeatues instead of pipeFeatures
Any help or links to the documentation I seek are highly appreciated!
Steven
Solved! Go to Solution.