Export (0) Print
Expand All

ShapeGuide class

Shape Guide. When the object is serialized out as xml, its qualified name is a:gd.

Namespace:  DocumentFormat.OpenXml.Drawing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public class ShapeGuide : OpenXmlLeafElement

[ISO/IEC 29500-1 1st Edition]

gd (Shape Guide)

This element specifies the precense of a shape guide that is used to govern the geometry of the specified shape. A shape guide consists of a formula and a name that the result of the formula is assigned to. Recognized formulas are listed with the fmla attribute documentation for this element.

[Note: The order in which guides are specified determines the order in which their values are calculated. For instance it is not possible to specify a guide that uses another guides result when that guide has not yet been calculated. end note]

[Example: Consider the case where the user would like to specify a triangle with it's bottom edge defined not by static points but by using a varying parameter, namely an guide. Consider the diagrams and DrawingML shown below. This first triangle has been drawn with a bottom edge that is equal to the 2/3 the value of the shape height. Thus we see in the figure below that the triangle appears to occupy 2/3 of the vertical space within the shape bounding box.

<a:xfrm>
  <a:off x="3200400" y="1600200"/>
  <a:ext cx="1705233" cy="679622"/>
</a:xfrm>
<a:custGeom>
  <a:avLst/> 
  <a:gdLst>
    <a:gd name="myGuide" fmla="*/ h 2 3"/>
  </a:gdLst>
  <a:ahLst/>
  <a:cxnLst/>
  <a:rect l="0" t="0" r="0" b="0"/>
  <a:pathLst>
    <a:path w="1705233" h="679622">
      <a:moveTo>
        <a:pt x="0" y="myGuide"/>
      </a:moveTo>
      <a:lnTo>
        <a:pt x="1705233" y="myGuide"/>
      </a:lnTo>
      <a:lnTo>
        <a:pt x="852616" y="0"/>
      </a:lnTo>
      <a:close/>
    </a:path>
  </a:pathLst>
</a:custGeom>

If however we change the guide to half that, namely 1/3. Then we see the entire bottom edge of the triangle move to now only occupy 1/3 of the toal space within the shape bounding box. This is because both of the bottom points in this triangle depend on this guide for their coordinate positions. The triangle and corresponding DrawingML shown below illustrate this point.

<a:gdLst>
  <a:gd name="myGuide" fmla="*/ h 1 3"/>
</a:gdLst>

end example]

Parent Elements

avLst (§20.1.9.5); gdLst (§20.1.9.12)

Attributes

Description

fmla (Shape Guide Formula)

Specifies the formula that is used to calculate the value for a guide. Each formula has a certain number of arguments and a specific set of operations to perform on these arguments in order to generate a value for a guide. There are a total of 17 different formulas available. These are shown below with the usage for each defined.

('*/') - Multiply Divide Formula

Arguments: 3 (fmla="*/ x y z")

Usage: "*/ x y z" = ((x * y) / z) = value of this guide

('+-') - Add Subtract Formula

Arguments: 3 (fmla="+- x y z")

Usage: "+- x y z" = ((x + y) - z) = value of this guide

('+/') - Add Divide Formula

Arguments: 3 (fmla="+/ x y z")

Usage: "+/ x y z" = ((x + y) / z) = value of this guide

('?:') - If Else Formula

Arguments: 3 (fmla="?: x y z")

Usage: "?: x y z" = if (x > 0), then y = value of this guide,

else z = value of this guide

('abs') - Absolute Value Formula

Arguments: 1 (fmla="abs x")

Usage: "abs x" = if (x < 0), then (-1) * x = value of this guide

else x = value of this guide

('at2') - ArcTan Formula

Arguments: 2 (fmla="at2 x y")

Usage: "at2 x y" = arctan(y / x) = value of this guide

('cat2') - Cosine ArcTan Formula

Arguments: 3 (fmla="cat2 x y z")

Usage: "cat2 x y z" = (x*(cos(arctan(z / y))) = value of this guide

('cos') - Cosine Formula

Arguments: 2 (fmla="cos x y")

Usage: "cos x y" = (x * cos( y )) = value of this guide

('max') - Maximum Value Formula

Arguments: 2 (fmla="max x y")

Usage: "max x y" = if (x > y), then x = value of this guide

else y = value of this guide

('min') - Minimum Value Formula

Arguments: 2 (fmla="min x y")

Usage: "min x y" = if (x < y), then x = value of this guide

else y = value of this guide

('mod') - Modulo Formula

Arguments: 3 (fmla="mod x y z")

Usage: "mod x y z" = sqrt(x^2 + b^2 + c^2) = value of this guide

('pin') - Pin To Formula

Arguments: 3 (fmla="pin x y z")

Usage: "pin x y z" = if (y < x), then x = value of this guide

else if (y > z), then z = value of this guide

else y = value of this guide

('sat2') - Sine ArcTan Formula

Arguments: 3 (fmla="sat2 x y z")

Usage: "sat2 x y z" = (x*sin(arctan(z / y))) = value of this guide

('sin') - Sine Formula

Arguments: 2 (fmla="sin x y")

Usage: "sin x y" = (x * sin( y )) = value of this guide

('sqrt') - Square Root Formula

Arguments: 1 (fmla="sqrt x")

Usage: "sqrt x" = sqrt(x) = value of this guide

('tan') - Tangent Formula

Arguments: 2 (fmla="tan x y")

Usage: "tan x y" = (x * tan( y )) = value of this guide

('val') - Literal Value Formula

Arguments: 1 (fmla="val x")

Usage: "val x" = x = value of this guide

[Note: Guides that have a literal value formula specified via fmla="val x" above should only be used within the avLst as an adjust value for the shape. This however is not strictly enforced. end note]

The possible values for this attribute are defined by the ST_GeomGuideFormula simple type (§20.1.10.27).

name (Shape Guide Name)

Specifies the name that is used to reference to this guide. This name can be used just as a variable would within an equation. That is this name can be substituted for literal values within other guides or the specification of the shape path.

The possible values for this attribute are defined by the ST_GeomGuideName simple type (§20.1.10.28).

[Note: The W3C XML Schema definition of this element’s content model (CT_GeomGuide) is located in §A.4.1. end note]

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft