Looking for some sample code on how to move a specified point on a spline in a sketch. This could be really useful for editing existing sketch geometry instead of always creating new, Like in the Fusion gear program I am always having to create a new component instead of editing the existing on. Thanks,
Hello,
The following is the sample how to edit start point on a spline in a sketch. You can give a try and see if it is what you wanted. In addition, we do provide the functionality to edit existing sketch geometry and other objects. Please let me know if anything you need for edit is missing.
PS: you need create a spline and pre-select it to run the sample.
#Author- #Description- import adsk.core, adsk.fusion, adsk.cam, traceback def run(context): ui = None try: app = adsk.core.Application.get() ui = app.userInterface spline = adsk.fusion.SketchFittedSpline.cast(ui.activeSelections.item(0).entity) startpt = spline.startSketchPoint startpt.move(adsk.core.Vector3D.create(1, 0, 0)) except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Thanks,
Marshal