Skip to main content

ApiShape

Class representing a shape.

ApiShape is a subclass of ApiDrawing.

Methods​

The following table lists the available methods.

MethodReturnsDescription
AddBreakbooleanInserts a break at the specified location in the main document.
CopyApiShape | nullCreates a copy of the current shape.
DeletebooleanDeletes the current graphic object.
FillbooleanSets the fill formatting properties to the current graphic object.
GetAllowOverlapbooleanReturns whether the drawing object is allowed to overlap other drawing objects.
GetClassType"shape"Returns a type of the ApiShape class.
GetContentApiDocumentContent | null | undefinedReturns the drawing inner contents where a paragraph or text runs can be inserted if it exists.
GetDescriptionstring | nullGets the description of the current drawing.
GetDocContentApiDocumentContent | null | undefinedReturns 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.
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.
GetNextDrawingApiDrawing | nullReturns the next inline drawing object if exists.
GetNextShapeApiShape | nullReturns the next inline shape if exists.
GetParentContentControlApiBlockLvlSdt | nullReturns a parent content control that contains the graphic object.
GetParentParagraphApiParagraph | nullReturns a parent paragraph that contains the graphic object.
GetParentTableApiTable | nullReturns a parent table that contains the graphic object.
GetParentTableCellApiTableCell | nullReturns a parent table cell that contains the graphic object.
GetPrevDrawingApiDrawing | nullReturns the previous inline drawing object if exists.
GetPrevShapeApiShape | nullReturns the previous inline shape if exists.
GetRotationnumberReturns the rotation angle of the current drawing object.
GetShadowApiShadow | nullReturns the shadow of the current graphic object.
GetTextRangeApiRange | nullReturns a range that covers the whole text of the current drawing. Creates a text body if the drawing 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.
GetWidthEMUReturns the width of the current drawing.
HasTextContentbooleanChecks whether the drawing has an associated text body.
InsertInContentControlApiDrawing | ApiBlockLvlSdtWraps the graphic object with a rich text content control.
InsertParagraphApiParagraph | ApiDrawingInserts a paragraph at the specified position.
ScaleHeightbooleanScales the height of the figure using the specified coefficient.
ScaleWidthbooleanScales the width of the figure using the specified coefficient.
SelectbooleanSelects the current graphic object.
SetAllowOverlapvoidSets whether the drawing object is allowed to overlap other drawing objects.
SetDescriptionbooleanSets the description of the current drawing.
SetDistancesbooleanSpecifies the minimum distance which will be maintained between the edges of the current drawing object and any subsequent text.
SetDrawingPrFromDrawingbooleanSets the properties from another drawing to 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.
SetHorAlignbooleanSpecifies how the floating object will be horizontally aligned.
SetHorFlipbooleanFlips the current drawing horizontally.
SetHorPositionbooleanSets the absolute measurement for the horizontal positioning of the floating object.
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.
SetRelativeHeightbooleanSets the relative height of the object (image, shape, chart) bounding box.
SetRelativeWidthbooleanSets the relative width of the object (image, shape, chart) bounding box.
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.
SetTitlebooleanSets the title of the current drawing.
SetVerAlignbooleanSpecifies how the floating object will be vertically aligned.
SetVerPositionbooleanSets the absolute measurement for the vertical positioning of the floating object.
SetVertFlipbooleanFlips the current drawing vertically.
SetVerticalTextAlignbooleanSets the vertical alignment to the shape content where a paragraph or text runs can be inserted.
SetWrappingStylebooleanSets the wrapping type of the current object (image, shape, chart).
ToJSONJSONConverts the ApiDrawing object into the JSON object.
UnselectbooleanRemoves the current graphic object from the selection.