Skip to main content

ApiShape

Class representing a shape.

ApiShape is a subclass of ApiDrawing.

Methods​

The following table lists the available methods.

MethodReturnsDescription
CopyApiShapeCreates a copy of the current shape.
DeletebooleanDeletes the specified drawing object from the parent.
FillbooleanSets the fill formatting properties to the current graphic object.
GetClassType"shape"Returns the type of the ApiShape class.
GetContentApiDocumentContent | null | undefinedReturns the shape inner contents where a paragraph or text runs can be inserted.
GetDescriptionstring | nullGets the description of the current drawing.
GetDocContentApiDocumentContent | null | undefinedDeprecated in 6.2. Returns the shape inner contents where a paragraph or text runs can be inserted.
GetFillApiFill | nullGets the fill properties from the current shape.
GetFlipHboolean | nullGet horizontal flip of current drawing.
GetFlipVboolean | nullGet vertical flip of current drawing.
GetGeometryApiGeometryReturns the geometry object from the current shape.
GetHeightEMUReturns the height of the current drawing.
GetHyperlinkApiHyperlink | nullReturns the hyperlink from the current drawing object (shape or image).
GetInternalIdstringReturns an internal ID of the current drawing object.
GetLineApiStroke | nullGets the outline properties from the current shape.
GetLockAspectbooleanReturns whether the aspect ratio of the drawing is locked.
GetLockValuebooleanReturns the lock value for the specified lock type of the current drawing.
GetNamestringReturns the name of the current drawing.
GetParentApiSlide | ApiLayout | ApiMaster | nullReturns the drawing parent object.
GetParentLayoutApiLayout | nullReturns the drawing parent slide layout.
GetParentMasterApiMaster | nullReturns the drawing parent slide master.
GetParentSlideApiSlide | nullReturns the drawing parent slide.
GetPlaceholderApiPlaceholder | nullReturns a placeholder from the current drawing object.
GetPosXEMUGets the x position of the drawing on the slide.
GetPosYEMUGets the y position of the drawing on the slide.
GetRotationnumberReturns the rotation angle of the current drawing object.
GetShadowApiShadow | nullReturns the shadow of the current graphic object.
GetTextFitTextFitTypeReturns the text autofit type of the current shape.
GetTextRangeApiTextRange | nullReturns an ApiTextRange covering the full text content of the shape. Creates a text body if the shape does not yet have one.
GetTitlestring | nullGets the title of the current drawing.
GetVerticalTextAlignVerticalTextAlignGets the vertical alignment from the shape content where a paragraph or text runs can be inserted.
GetVisitorApiPresentationVisitorReturns a visitor object for traversing the text of the current drawing, including the drawings nested in a group.
GetWidthEMUReturns the width of the current drawing.
HasTextContentbooleanChecks whether the drawing has an associated text body.
RecalculateAutoFitbooleanRecalculates the text autofit of the current shape according to its text autofit type. The "autoFit" type resizes the shape to fit the text, the "normAutoFit" type reduces the font size and line spacing to fit the text into the shape. The recalculation is performed after the script is executed. <note>This method is not supported in the document builder and works only in the editor.</note>
ReplacePlaceholderbooleanReplaces the placeholder by a drawing on the slide.
SelectbooleanSelects the current graphic object.
SetDescriptionbooleanSets the description of the current drawing.
SetFillbooleanSets the fill properties to the current shape.
SetFlipHbooleanSets the horizontal flip of the current drawing.
SetFlipVbooleanSets the vertical flip of the current drawing.
SetGeometrybooleanSets a custom geometry for the current shape.
SetHyperlinkbooleanSets a hyperlink to the current drawing object (shape or image).
SetLinebooleanSets the outline properties to the current shape.
SetLockAspectbooleanSets whether the aspect ratio of the drawing is locked.
SetLockValuebooleanSets the lock value to the specified lock type of the current drawing.
SetNamebooleanSets the name of the current drawing.
SetOutLinebooleanSets the outline properties to the specified graphic object.
SetPaddingsbooleanSets the text paddings to the current shape.
SetPlaceholderbooleanSets the specified placeholder to the current drawing object.
SetPosXbooleanSets the x position of the drawing on the slide.
SetPosYbooleanSets the y position of the drawing on the slide.
SetPositionNoneSets the position of the drawing on the slide.
SetRotationbooleanSets the rotation angle to the current drawing object.
SetShadowbooleanSets the shadow to the current graphic object.
SetSizebooleanSets the size of the object (image, shape, chart) bounding box.
SetTextFitbooleanSets the text autofit type to the current shape.
SetTitlebooleanSets the title of the current drawing.
SetVerticalTextAlignbooleanSets the vertical alignment to the shape content where a paragraph or text runs can be inserted.
ToJSONJSONConverts the ApiDrawing object into the JSON object.
UnselectbooleanRemoves the current graphic object from the selection.