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: 

Moving a sketch dimension with the Fusion API

1 REPLY 1
Reply
Message 1 of 2
autodesk.comGX2RW
110 Views, 1 Reply

Moving a sketch dimension with the Fusion API

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?

1 REPLY 1
Message 2 of 2

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

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