Moving a sketch dimension with the Fusion API

Moving a sketch dimension with the Fusion API

autodesk.comGX2RW
Explorer Explorer
330 Views
1 Reply
Message 1 of 2

Moving a sketch dimension with the Fusion API

autodesk.comGX2RW
Explorer
Explorer

Hi,

 

I would like to create an addin that let's me snap a dimension to the grid.

 

The problem is that Fusion 360 is crashing when I am trying to set SketchDimension.textPosition. Setting textPosition.x or moving the textPosition with textPosition.translateBy does not crash Fusion but also doesn't change the position of the dimension.

 

The code that is crashing Fusion is the following (I've attached the complete code of the addin).

 

 

from adsk.core import *
from adsk.fusion import *

app = Application.get()
ui = app.userInterface

selections = ui.activeSelections

for i in range(0, selections.count):
    selection = selections.item(i)
    dimension = selection.entity

    if isinstance(dimension, SketchDimension):
        dimension.textPosition = Point3D(10, 10, 10)

 

 

 

Is there anything I am doing wrong or is this a bug in Fusion?

0 Likes
331 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor

I'm able to reproduce the crash with a very simple test case. I'll make sure a bug is logged.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com