Curve lenght vb

Hi,

I am trying wirte a code as below, to calculate the lenght of all curves in a drawing.

  Dim curves = doc.Objects.GetObjectList(ObjectType.Curve)
    For Each cv As Rhino.DocObjects.RhinoObject In curves
        Dim crv As Rhino.Geometry.Curve = cv.Curve()

But i says Curve is not a mamber of “Rhino.DocObjects.RhinoObject”.

Thanks

A RhinoObject contains geometry, so you should use the Geometry property, instead of Curve().

Try this:

Dim curves = doc.Objects.GetObjectList(ObjectType.Curve)
For Each obj As RhinoObject In curves
  Dim crv As Curve = TryCast(obj.Geometry(), Curve)
  If (crv IsNot Nothing) Then
    ' Do to....
  End If
Next

Thank you very much, thats goood :slight_smile: