Class FreeformBuilder (Excel VBA)

The class FreeformBuilder represents the geometry of a freeform while it's being built. To use a FreeformBuilder class variable it first needs to be instantiated, for example


Dim fbr as FreeformBuilder
Set fbr = Application.ActiveChart.Shapes

AddNodes

Adds a point in the current shape, and then draws a line from the current node to the last node that was added.

MsoEditingType cannot be msoEditingSmooth or msoEditingSymmetric. If SegmentType is msoSegmentLine, EditingType must be msoEditingAuto.

AddNodes (SegmentType, EditingType, X1, Y1, X2, Y2, X3, Y3)


Set myDocument = Worksheets(1) 
With myDocument.Shapes.BuildFreeform(msoEditingCorner, 360, 200) 
    .AddNodes msoSegmentCurve, msoEditingCorner, _ 
        380, 230, 400, 250, 450, 300 
    .AddNodes msoSegmentCurve, msoEditingAuto, 480, 200 
    .AddNodes msoSegmentLine, msoEditingAuto, 480, 400 
    .AddNodes msoSegmentLine, msoEditingAuto, 360, 200 
    .ConvertToShape 
End With

Arguments

The following arguments are required:

SegmentType (Office.MsoSegmentType) - The type of segment to be added.

EditingType (Office.MsoEditingType) - The editing property of the vertex.

X1 (Single) - If the EditingType of the new segment is msoEditingAuto, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the end point of the new segment. If the EditingType of the new node is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the first control point for the new segment.

Y1 (Single) - If the EditingType of the new segment is msoEditingAuto, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the end point of the new segment. If the EditingType of the new node is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the first control point for the new segment.

Optional arguments

The following arguments are optional

X2 (Long) - If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

Y2 (Long) - If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

X3 (Long) - If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

Y3 (Long) - If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

ConvertToShape

Creates a shape that has the geometric characteristics of the specified FreeformBuilder object. Returns a Shape object that represents the new shape.

You must apply the AddNodes method to a FreeformBuilder object at least once before you use the ConvertToShape method.


Dim shpConvertToShape As Shape
Set shpConvertToShape = ActiveChart.Shapes.BuildFreeform.ConvertToShape()