Message 1 of 6
Python API Offset statement of 0.12 cm leaves dimension of 0.00 in drawing.

Not applicable
01-10-2019
08:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Condition:
Fusion 360 Build 20.5278
Windows 10, Startup License
Model file with a simple profile (location: https://a360.co/
Attached python script.
Run Python Script.
Expect the first sketch profile to be selected to which an offset (with a reference point) is created .12 cm (1.2 mm) to the outside of the profile. The reference point is assumed to be outside the profile (within the context of this usage).
Observation:
After running the script, the sketch was edited. There was a dimension applied to the offset which had a value of 0.00. The offset was measured at 1.2 mm with the Measure tool.
Comments:
My normal unit preferences are in mm.
-------------
#Author-mwinrock #Description-Locates first sketch profile in root compenet and attempts to create an offset. import adsk.core, adsk.fusion, adsk.cam, traceback bUpdateFusion=True def run(context): ui = None try: app = adsk.core.Application.get() ui = app.userInterface # at this point in time, the user must load the sketch profile. #doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType) design = app.activeProduct # Get the root component of the active design. rootComp = design.rootComponent sketch = rootComp.sketches.item(0) prof_1 = sketch.profiles.item(0) # create offset from profile line = sketch.sketchCurves.item(0) curves = sketch.findConnectedCurves(line) # Create the offset. dirPoint = adsk.core.Point3D.create(1000, 1000, 1000) offsetCurves = sketch.offset(curves, dirPoint, 0.12) prof_2 = sketch.profiles.item(1) if bUpdateFusion: # Call doEvents to give Fusion 360 a chance to react. adsk.doEvents() except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))