AddCurve Example

Land Auto

AddCurve Example

Examples:

l Alignment

l Parcel


Sub Example_AddCurve_Alignment()
    
    ' This example adds an Alignment made up of a tangent,
    ' curve, and spiral entities.
    Dim aligns As AeccAlignments
    Dim align As AeccAlignment
    Set aligns = AeccApplication.ActiveProject.Alignments
    
    ' Add an Alignment named "Example Alignment" and starting at Station 50.0
    Set align = aligns.Add("Example Alignment", 50#)
    
    ' Add a tangent, curve, and spiral to the alignment
    Dim tangent As AeccAlignTangent
    Dim curve As AeccAlignCurve
    Dim spiral As AeccAlignSpiral
    
    Set tangent = align.AddTangent(0#, 0#, 150#, 0#)
    Set spiral = align.AddSpiral(150#, 0#, 388.069176379758, -5.83082052087824E-14, 250#, 100#, 0, 0, kClothoid)
    Set curve = align.AddCurve(250, 100#, 320.966940499621, 197.983470249737, 200#, 200#, False)
    
    MsgBox "The total number of entities in the Alignment is: " & align.AlignEntities.count , vbInformation, "AddCurve Example"
    
End Sub

Sub Example_AddCurve_Parcel()
    
    ' This example adds a Parcel made up of lines and an arc.
    ' The parcel is then imported into the drawing.
    Dim parcels As AeccParcels
    Dim parcel As AeccParcel
    Set parcels = AeccApplication.ActiveProject.parcels
    
    ' Add a new Parcel
    Set parcel = parcels.Add("New Parcel")
    
    ' Add lines and a curve to the Parcel
    parcel.AddLine 50#, 50#, 150#, 50#
    parcel.AddLine 150#, 50#, 150#, 200#
    parcel.AddCurve 150#, 200#, 100#, 200#, 50#, 200#, True
    parcel.AddLine 50#, 200#, 50#, 50#
    
    ' Import the new Parcel
    parcel.Import
    
    MsgBox "The total number of entities in the parcel is: " & parcel.ParcelEntities.Count, _
        vbInformation, "AddCurve Example"
    
End Sub