Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hola!
I am having some problems with a script that will slice a part with a plane, then project the intersection of the part with the plane on a sketch. Finally, it will extrude those profiles (as surfaces).
The script works fine for most geometries but occasionally crashes giving the error: "input curves are not on the same plane". I don't understand how this is happening since the input curves were created by the plane to begin with.
Any ideas? Is this a bug?
I am attaching a sample file where this problem occurs as well as the script where this occurs (it is attached as txt because it wouldn't let me upload a .py file).
Thanks!
Sebastian
#Author- #Description- import adsk.core, adsk.fusion, adsk.cam, traceback app = adsk.core.Application.get() if app: ui = app.userInterface def run(context): try: activeDoc = adsk.core.Application.get().activeDocument design = activeDoc.design rootComp = design.rootComponent rootComp.occurrences.addNewComponent (adsk.core.Matrix3D.create()).component.name=("extrusions") modelMinZ=rootComp.boundingBox.minPoint.z+0.002 planes=rootComp.constructionPlanes planeInOff=planes.createInput() planeInOff.setByOffset(rootComp.xYConstructionPlane,adsk.core.ValueInput.createByReal(modelMinZ)) planeMin=planes.add(planeInOff) planeMin.isLightBulbOn=False sketches= rootComp.sketches sketch = sketches.add(planeMin) body = rootComp.bRepBodies.item(0) sketch.projectCutEdges(body) extrudesComp = rootComp.occurrences.itemByName("extrusions:1").component extrudes = extrudesComp.features.extrudeFeatures distance = adsk.core.ValueInput.createByReal(2) curves=sketch.sketchCurves.item(0) profileCollection = adsk.core.ObjectCollection.create() profileCollection.add(rootComp.createOpenProfile(curves)) extrudeInput = extrudes.createInput(profileCollection, adsk.fusion.FeatureOperations.NewBodyFeatureOperation) extrudeInput.isSolid = False extrudeInput.setDistanceExtent(False, distance) extrude = extrudes.add(extrudeInput) except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Solved! Go to Solution.