Align text in the rectangle for Python

Hi,

I’m trying to figure out how to get a text left alignment in a rectangle. I found only how to do it for Java and not for Python.
My code is

diagram = Diagram(my_puth + ‘Basic Shapes.vss’)
shapeId = diagram.add_shape(4.0, 9.0, 5, 3, ‘Rectangle’, 0)
shape = diagram.pages[0].shapes.get_shape(shapeId)
shape.text.value.add(Txt(’\n’.join(x)))

How to change center alignment to left alignment?
Thank you.

@e0377590
Please refer to the following code to set left alignment:

p = Para()
p.ix = 0
shape.paras.add(p)
shape.paras[0].horz_align.value = HorzAlignValue.LEFT_ALIGN;

Thanks.

1 Like