Thats how you do it using RhinoCommon sdk and python
# check if the object is a curve
if curve.IsCurve:
print("This is a curve")
else:
print("This is not a curve")
Thats how you do it without using Rhinocommon SDK
for selectable_object in selectable_objects:
if isinstance(selectable_object, Rhino.Geometry.Curve):
print("The object is a curve")
else:
print("The object is not a curve")
The isinstance function returns True if the object is an instance of the specified class or of a subclass of the specified class, and False otherwise. In this case, if selectable_object is an instance of Rhino.Geometry.Curve or a subclass of Rhino.Geometry.Curve , the code will print “The object is a curve”.
for selectable_object in selectable_objects:
if isinstance(selectable_object, CurveObject): #*CurveObject
print("The object is a curve")
else:
print("The object is not a curve")