Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Bug?] Inconsistency between Sketch.transform documentation and actual behavior

0 REPLIES 0
Reply
Message 1 of 1
nnikbin
110 Views, 0 Replies

[Bug?] Inconsistency between Sketch.transform documentation and actual behavior

Based on Sketch.transform documentation:

 

it "Gets and sets the transform of the sketch with respect to model space."  and "Setting the transform will fail in the case where the sketch is parametric"

 

But setting it actually multiplies the existing matrix in the new matrix.

 

Here is a code block showing this inconsistency:

 

import adsk.core, adsk.fusion, traceback

def run(context):
    try:
        ui = adsk.core.UserInterface.cast(None)
        app :adsk.fusion.Application = adsk.core.Application.get()
        ui = app.userInterface
        des :adsk.fusion.Design = app.activeProduct
        root :adsk.fusion.Component = des.rootComponent


        baseFeature = root.features.baseFeatures.add()
        baseFeature.startEdit()

        sketch = root.sketches.add(root.xYConstructionPlane)

        matrix1 = adsk.core.Matrix3D.create()
        matrix1.translation = adsk.core.Vector3D.create(2, 0, 0)
        sketch.transform = matrix1

        matrix2 = adsk.core.Matrix3D.create()
        matrix2.translation = adsk.core.Vector3D.create(0, 3, 0)
        sketch.transform = matrix2

        sketch.sketchCurves.sketchCircles.addByCenterRadius(adsk.core.Point3D.create(0, 0, 0), 1)
        baseFeature.finishEdit()

        ui.messageBox(str(sketch.transform.asArray()))

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

and the result:

55.png

Tags (2)
Labels (1)
  • bug
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report