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: 

how to use MultiLineTextDefinition.rectangleLines ?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
lionel.courgnaud
74 Views, 2 Replies

how to use MultiLineTextDefinition.rectangleLines ?

Hello

 

I've got a multiline text set like this. variables are not important.

 

        textInput.setAsMultiLine(cornerPoint,
                                 diagonalPoint,
                                 horizontalAlignment,
                                 verticalAlignment,
                                 characterSpacing)
        textInput.isHorizontalFlip = False
        textInput.isVerticalFlip = False
        textInput.fontName = 'Arial'
        myTextc1 = texts.add(textInput)

 

 

I need to constraint the bottom of the bounding box of this text to a sketchline (skLine1). It Seems I can access bounding box through MultiLineTextDefinition.rectangleLines, but I don't know how.

If it's easier, I could constraint one of the point (from bounding box) to a sketch point (skPt1).

 

Any example ? thank for your precious help.

 

 

 

2 REPLIES 2
Message 2 of 3

Hi @lionel.courgnaud -San.

 

Check the type of the rectangleLines property.

    print(type(myTextc1.definition.rectangleLines))

 

The output will look like this.

<class 'adsk.fusion.SketchLineVector'>

 

In the case of the Fusion360 API, anything that is a ~Vector can be cast as a List.

    rectangleLines = list(myTextc1.definition.rectangleLines)

After that, you should be able to handle it as a normal SketchLine.

 

It is also possible to handle it directly without casting it to a list.

    line = myTextc1.definition.rectangleLines[0]
Message 3 of 3

thanks.

this helped me 🙂

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