' ****************************************************************
' Public Class Polyline
' Public Property Points As PolylineItemList (Polyline.Points)
' Public Structure PolylineItem (Polyline.Points.Item)
'*****************************************************************
'
'example: the Sub write the points coordinates ans bulge of all the polyline control points
'passed in argument

Sub main()

    ThisApplication.ClearLogMessages()

    Dim ent As Entity

    ' test if one and only one polyline is selected

    If CamBamUI.MainUI.ActiveView.SelectedEntities.Length = 1 Then

        For Each ent In CamBamUI.MainUI.ActiveView.SelectedEntities

            If TypeOf ent Is Polyline Then
                
                'call the sub to scan the polyline
                WritePolyData(CType(ent, Polyline))

            End If

        Next ent

    End If
End Sub

Sub WritePolyData(p As Polyline)

    Dim polypoint As Point3F    'XYZ coordinate of a polyline point
    Dim blg As Double   'bulge

    'scan the polyline for each item in the PolylineItemList
    For Each it As PolylineItem In p.Points

        polypoint = it.Point
        blg = it.Bulge

        ThisApplication.AddLogMessage("x= " & polypoint.X & "  y= " & polypoint.Y & "  z= " & polypoint.Z)
        ThisApplication.AddLogMessage("bulge= " & blg & vbNewLine)

    Next

End Sub