FromPoints Example

AEC Auto

FromPoints Example

Sub Example_FromPoints()

' This example will make a new profile from a set of points.

    On Error Resume Next
    Dim pointList(0 To 7) As Double
    pointList(0) = 0.5: pointList(1) = 0.5
    pointList(2) = 0.067: pointList(3) = -0.25
    pointList(4) = 0.933: pointList(5) = -0.25
    pointList(6) = 0.5: pointList(7) = 0.5

    Dim ring As AecRing
    Dim profile As New AecProfile

    Dim doc As AecArchBaseDocument
    Set doc = AecArchBaseApplication.ActiveDocument
    Dim cprofiles As AecProfileStyles
    Dim profileStyle As AecProfileStyle
    
    Set cprofiles = doc.ProfileStyles
    Set profileStyle = cprofiles.Item("FromPoints")
    If profileStyle Is Nothing Then
        Set profileStyle = cprofiles.Add("FromPoints")
    End If
    Set ring = profile.Rings.Add
    ring.FromPoints pointList
    Set profileStyle.profile = profile  

End Sub