add_auto_shape method

add_auto_shape

Creates a new auto shape with default formatting and adds it to the end of the shape collection.

Returns

The newly created IAutoShape.

def add_auto_shape(self, shape_type, x, y, width, height):
    ...
ParameterTypeDescription
shape_typeShapeTypeThe ShapeType of the auto shape to add.
xfloatThe x-coordinate of the shape’s frame, in points.
yfloatThe y-coordinate of the shape’s frame, in points.
widthfloatThe width of the shape’s frame, in points.
heightfloatThe height of the shape’s frame, in points.

add_auto_shape

Creates a new auto shape and adds it to the end of the shape collection, optionally initializing it with default template formatting.

Returns

The newly created IAutoShape.

def add_auto_shape(self, shape_type, x, y, width, height, create_from_template):
    ...
ParameterTypeDescription
shape_typeShapeTypeThe ShapeType of the auto shape to add.
xfloatThe x-coordinate of the shape’s frame, in points.
yfloatThe y-coordinate of the shape’s frame, in points.
widthfloatThe width of the shape’s frame, in points.
heightfloatThe height of the shape’s frame, in points.
create_from_templateboolTrue to apply default template styling (simple style, centered text, and non-empty name)

to the new shape; false to create the shape with all properties set to their default values.

See Also