Shape
A shape that can appear on a slide. Corresponds to thep:sp element that can appear in any of the slide-type parts (slide, slideLayout, slideMaster, notesPage, notesMaster, handoutMaster).
AutoShapes are distinctive shapes that can contain text and have adjustable geometry parameters.
Properties
Read-only reference to |AdjustmentCollection| instance for this shape. Provides access to adjustment values that control the shape’s geometry, such as the corner radius of a rounded rectangle.
Enumeration value identifying the type of this auto shape, like
MSO_SHAPE.ROUNDED_RECTANGLE. Raises ValueError if this shape is not an auto shape.|FillFormat| instance for this shape. Provides access to fill properties such as fill color.
Always
True for an AutoShape, indicating this shape can contain text.|LineFormat| instance for this shape. Provides access to line properties such as line color and width.
Unique integer identifying the type of this shape. Returns:
MSO_SHAPE_TYPE.PLACEHOLDERif the shape is a placeholderMSO_SHAPE_TYPE.FREEFORMif the shape has custom geometryMSO_SHAPE_TYPE.AUTO_SHAPEif the shape is an autoshapeMSO_SHAPE_TYPE.TEXT_BOXif the shape is a text box
Read/write. Text in shape as a single string.The returned string will contain:
- A newline character (
"\\n") separating each paragraph - A vertical-tab (
"\\v") character for each line break (soft carriage return)
text replaces any text previously contained in the shape, along with any paragraph or font formatting applied to it.|TextFrame| instance for this shape. Contains the text of the shape and provides access to text formatting properties.
Methods
Returns the
a:ln element containing the line format properties XML for this shape.Returns: CT_LinePropertiesAdjustmentCollection
Sequence of |Adjustment| instances for an auto shape. Each represents an available adjustment for a shape of its type. Supportslen() and indexed access.
Usage
Methods
Provides indexed access to adjustment values.Parameters:
idx(int): Index of the adjustment to retrieve
float - The normalized effective value of the adjustmentProvides item assignment via an indexed expression.Parameters:
idx(int): Index of the adjustment to setvalue(float): The new normalized value for the adjustment
Returns the number of adjustments in the collection.Returns:
intAdjustment
An adjustment value for an autoshape. An adjustment value corresponds to the position of an adjustment handle on an auto shape. Adjustment handles are the small yellow diamond-shaped handles that appear on certain auto shapes and allow the outline of the shape to be adjusted. For example, a rounded rectangle has an adjustment handle that allows the radius of its corner rounding to be adjusted. Values arefloat and generally range from 0.0 to 1.0, although the value can be negative or greater than 1.0 in certain circumstances.
Properties
Read/write float representing normalized adjustment value for this adjustment.Actual values are expressed in shape coordinates (nominally between 0 and 100,000). The effective value is normalized to a corresponding value nominally between 0.0 and 1.0. This represents the proportion of the width or height of the shape at which the adjustment value is located from its starting point.For simple shapes such as a rounded rectangle, this intuitive correspondence holds. For more complicated shapes and at more extreme shape proportions (e.g. width is much greater than height), the value can become negative or greater than 1.0.
AutoShapeType
Provides access to metadata for an auto-shape type. Instances are cached, so no more than one instance for a particular auto shape type is in memory.Properties
MSO_AUTO_SHAPE_TYPE enumeration member uniquely identifying this auto shape type.
Base part of shape name for auto shapes of this type. For example,
Rounded Rectangle becomes Rounded Rectangle 99 when the distinguishing integer is added to the shape name. This value is escaped because at least one autoshape-type name includes double quotes (‘“No” Symbol’).Preset geometry identifier string for this auto shape. Used in the
prst attribute of a:prstGeom element to specify the geometry to be used in rendering the shape, for example 'roundRect'.Class Methods
Returns sequence of (name, value) pair adjustment value defaults for a preset autoshape-type.Parameters:
prst(MSO_AUTO_SHAPE_TYPE): The preset autoshape type
tuple[AdjustmentValue, ...]Select auto shape type with matching preset geometry keyword.Parameters:
prst(str): Preset geometry keyword like"rect"
MSO_AUTO_SHAPE_TYPE - For example, MSO_SHAPE.RECTANGLE corresponding to preset geometry keyword "rect"