Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to get the normal to a sketch, via the reference plane's geometry. But for the "Slots" sketch in the attached example, the referencePlane is a "Sketch" object. If I redefine the Slots sketch plane to the root XY plane, I get a "ConstructionPlane" as expected.
Here's the offending code:
import adsk.core, adsk.fusion, traceback def run(context): try: app = adsk.core.Application.get() ui = app.userInterface product = app.activeProduct design = adsk.fusion.Design.cast(product) comp = design.rootComponent refSketch = comp.sketches.itemByName("Slots") ui.messageBox("sketch plane is a: " + refSketch.referencePlane.classType()) rotAxis = refSketch.referencePlane.geometry.normal except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Solved! Go to Solution.