Verifies that an object is a member of a specified group.
rhinoscriptsyntax.IsObjectInGroup ( object_id, group_name=None )
rhinoscript.object.IsObjectInGroup ( object_id, group_name=None )
object_id |
Required. String or Guid. The identifier of an object. |
group_name |
Optional. String. The name of a group. If omitted, the function verifies that the object is a member of any group. |
True |
The object is a member of the specified group. If a group_name was not specified, the object is a member of some group. |
False |
The object is not a member of the specified group. If a group_name was not specified, the object is not a member of any group. |
import rhinoscriptsyntax as rs
id = rs.GetObject("Select object")
if id:
name = rs.GetString("Group name")
if name:
result = rs.IsObjectInGroup(id, name)
if result:
print "The object belongs to the group."
else:
print "The object does not belong to the group."