OdgShape
OfficeIMO.OpenDocument
A Draw shape backed by its original XML, including elements outside the editable profile.
Inheritance
- OdfShape
- OdgShape
Usage
Explore 16 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 13
- Method OdgShapes.AddConnector
- Method OdgShapes.AddEllipse
- Method OdgShapes.AddGroup
- Method OdgShapes.AddImage
- Method OdgShapes.AddLine
- Method OdgShapes.AddPath
- Method OdgShapes.AddPolygon
- Method OdgShapes.AddPolyline
- Method OdgShapes.AddRectangle
- Method OdgShapes.AddRoundedRectangle
- Method OdgShapes.AddTextBox
- Method OdgShapes.GetEnumerator
- Property OdgShapes.Item
Accepted by parameters 3
- Method OdgShape.AttachEndToShape
- Method OdgShape.AttachStartToShape
- Method OdgShape.RouteOrthogonalAroundShapes
Methods
public OdgGluePoint AddGluePoint(OdgGluePointAlignment alignment = Center, OdfLength? offsetX = null, OdfLength? offsetY = null) #Adds an attachment point with absolute offsets from the selected edge or corner. Bottom uses a native relative point because ODF has no bottom-center alignment token; its offsets must be zero.
Parameters
- alignment OfficeIMO.OpenDocument.OdgGluePointAlignment = Center
- offsetX OfficeIMO.OpenDocument.OdfLength? = null
- offsetY OfficeIMO.OpenDocument.OdfLength? = null
Returns
OdgGluePointpublic OdfTextList AddList(bool ordered = false) #Appends a native ordered or unordered list with its own automatic list style.
Parameters
- ordered bool = false
Returns
OdfTextListpublic OdfTextParagraph AddParagraph(string? text = null) #Appends a native paragraph while retaining existing text, lists and shape metadata.
Parameters
- text string? = null
Returns
OdfTextParagraphpublic void AttachEnd(OdgGluePoint? point) #Attaches the end to a glue point. Null detaches it while retaining its current position.
Parameters
- point OfficeIMO.OpenDocument.OdgGluePoint?
public void AttachEndToShape(OdgShape? shape) #Attaches the end using automatic selection among the shape's four edge centers. Null detaches it.
Parameters
- shape OfficeIMO.OpenDocument.OdgShape?
public void AttachStart(OdgGluePoint? point) #Attaches the start to a glue point. Null detaches it while retaining its current position.
Parameters
- point OfficeIMO.OpenDocument.OdgGluePoint?
public void AttachStartToShape(OdgShape? shape) #Attaches the start using automatic selection among the shape's four edge centers. Null detaches it.
Parameters
- shape OfficeIMO.OpenDocument.OdgShape?
public void BakeConnectorTransform() #Bakes a free connector's own affine transform into its endpoints and saved route, including curve controls. Clears the transform and native routing offsets; preserves the routing kind, declared stroke and other styles. Scaling changes geometry without scaling the declared stroke width. Attached ends, transformed parents and rotated, scaled or sheared connector labels are outside this profile. Translation retains labels. Unsupported input leaves the document unchanged.
public byte[]? GetImageBytes() #Returns embedded image bytes without resolving external image references.
Returns
byte[]?public IReadOnlyList<OfficeDocumentModelLink> InspectHyperlinks() #Detached hyperlink descriptors from this shape's native text story, without accessing targets.
Returns
IReadOnlyList<OfficeDocumentModelLink>public void RouteOrthogonal(OdgConnectorRouteOrientation orientation = Auto, double offset = 0) #Replaces the route with three orthogonal segments and selects Standard routing. Offset is in connector-local points. This method does not avoid obstacles or enforce escape directions. Native applications can subsequently recalculate the route.
Parameters
- orientation OfficeIMO.OpenDocument.OdgConnectorRouteOrientation = Auto
- offset double = 0
public void RouteOrthogonalAroundShapes(IEnumerable<OdgShape> obstacles, double padding = 6, int maxLanes = 12) #Searches a bounded set of orthogonal lanes avoiding the declared bounds of unrelated shapes. Padding is in connector-local points, before transforms. Up to 4096 bounded shapes and 32 lanes per direction are accepted. Attached shapes and line/connector obstacles are ignored; groups must be supplied as individual bounded children. No clear lane, unsupported input, or invalid geometry leaves the previous route intact. Native applications can reroute it.
Parameters
- obstacles System.Collections.Generic.IEnumerable<OfficeIMO.OpenDocument.OdgShape>
- padding double = 6
- maxLanes int = 12
public void RouteOrthogonalAroundShapes(IEnumerable<OdgShape> obstacles, bool respectEscapeDirections, double padding = 6, int maxLanes = 12) #Optionally enforces explicit glue-point escape directions while avoiding obstacles and attached shape bounds. With constraints enabled, routes, padding and departure directions use page coordinates; the saved route is mapped back into the connector's coordinate space. Free, automatic and standard glue endpoints allow all directions. Every route must remain orthogonal, retain its departures and match its attachments within 0.1 page point after native-grid rounding. Unsupported input or an exhausted bounded search leaves the document unchanged. Native applications may subsequently reroute it.
Parameters
- obstacles System.Collections.Generic.IEnumerable<OfficeIMO.OpenDocument.OdgShape>
- respectEscapeDirections bool
- padding double = 6
- maxLanes int = 12
public void SetConnectorRoute(IEnumerable<OfficePathCommand> commands) #Replaces the saved open route with commands in connector-local points. Free endpoints follow the route; attached endpoints within 0.1 point of their glue positions are snapped to those positions before native-grid rounding. Native applications can subsequently reroute it.
Parameters
- commands System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficePathCommand>
public void SetPathCommands(IEnumerable<OfficePathCommand> commands) #Replaces native path data using bounded shared Drawing commands.
Parameters
- commands System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficePathCommand>
public void SetPoints(IEnumerable<OfficePoint> points) #Replaces polygon/polyline vertices. Coordinates must be signed 32-bit integers; at most 20,000 vertices are accepted.
Parameters
- points System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficePoint>
public XElement ToXml() #Returns a detached copy of the native element for inspection.
Returns
XElementpublic void TransformChildren(string transform) #Applies an affine transform to existing group children in their parent coordinate space. Nested groups remain groups; free connector and line coordinates are baked. Attached connectors and unknown elements are rejected before any child changes. Connector labels permit translation only; baking free connector geometry preserves the declared stroke width rather than scaling it.
Parameters
- transform string
public void UseNativeThreeSegmentRouting() #Encodes the saved three-segment route as native Lines routing, departure directions and segment offsets. Both ends must attach to untransformed rectangles, frames or full ellipses/circles with declared SVG bounds. The outer segments must be horizontal or vertical and nonzero; the middle segment may be diagonal. Equivalent directional glue points are reused, otherwise cloned without altering shared points. The connector's own transform is baked into the route; transformed parents and transformed connector text are rejected. Native applications may adjust bends for painted bounds, strokes or subsequent shape edits. Unsupported input leaves the document unchanged.
Inherited Methods
Properties
public IReadOnlyList<OfficePathCommand> ConnectorRouteCommands { get; } #Returns a detached route in connector-local points, before the connector and parent transforms. Saved routes must match the resolved endpoints; non-straight connectors without a saved route require native routing.
public bool IsConnector { get; } #Whether this element is a native connector.
public IReadOnlyList<OdgGluePoint> GluePoints { get; } #Explicit glue points on this shape.
public OdgConnectorKind ConnectorKind { get; set; } #Native connector routing style.
public string? StartShapeId { get; } #Identifier of the shape attached to the start, or null for a free endpoint.
public string? EndShapeId { get; } #Identifier of the shape attached to the end, or null for a free endpoint.
public string ElementName { get; } #Native element name, for example rect, ellipse, frame, line, or g.
public OdgShapes Children { get; } #Children of a group. Access on other shapes throws.
public string? Layer { get; set; } #Layer name. Layer definitions and visibility remain preserved in the document XML.
public override OdfRect Bounds { get; set; } #Geometry for rectangular shapes. Lines use endpoints; groups use child geometry and transforms.
public string Text { get; set; } #Plain text of paragraphs, headings and lists in the selected text container, including text boxes and image captions. Assignment replaces their rich formatting.
public OdfLength? FontSize { get; set; } #Uniform font size for the shape's plain text profile.
public string? FontFamily { get; set; } #Uniform font family for the shape's plain text profile.
public OdfColor? TextColor { get; set; } #Uniform text color for the shape's plain text profile.
public OdfViewBox ViewBox { get; set; } #Local coordinate canvas for a path, polygon, or polyline. Changing bounds scales this canvas.
public string PathData { get; set; } #Native SVG path data. Assignment validates the bounded shared path grammar and retains the supplied notation.
public IReadOnlyList<OfficePathCommand> PathCommands { get; } #Parsed path commands in view-box coordinates; SVG arcs and shorthand are normalized by the shared Drawing parser.
public IReadOnlyList<OfficePoint> Points { get; } #Polygon or polyline vertices in integer view-box coordinates. The returned list is detached.
public OdfLength? CornerRadius { get; set; } #Circular rectangle corner radius. Setting this clears the alternate elliptical radii.
public OdfLength? CornerRadiusX { get; set; } #Horizontal rectangle corner radius. When only one elliptical radius is present it supplies both axes.
public OdfLength? CornerRadiusY { get; set; } #Vertical rectangle corner radius. Setting this clears the circular radius.
public override string? Transform { get; set; } #Native transform for a leaf shape. Use TransformChildren to transform a group.
public OdfInsets? Crop { get; set; } #Image crop offsets in intrinsic image lengths, ordered top, right, bottom, left.
public OdfImageMirror? Mirror { get; set; } #Mirrors image pixels through the native graphic style without changing the resource.
public string? ImagePath { get; } #Authored image reference, including external targets which inspection never fetches.
public IReadOnlyList<OdfTextParagraph> Paragraphs { get; } #Native paragraphs and headings in reading order, including list items. Excludes other text stories.
public IReadOnlyList<OdfTextList> Lists { get; } #Direct native lists in this shape's text container.