How to check in SpaceClaim if a body is a surface body?
Andrew Stankovich
Member, Employee Posts: 10
✭✭✭
How can you use SpaceClaim scripting API to check if a body is a surface body or solid body?
Tagged:
0
Best Answer
-
In SpaceClaim and Discovery we can have a solid or surface design body. Any body with faces that form a completely closed (watertight) volume is considered a solid. Bodies with surfaces that do not "close" are considered as surface bodies.
There is API listed below to perform this check. Note, the IsClosed property only exists in the Shape of the DesignBody and not the instance IDesignBody so the GetMaster() script command is used.
all_bodies=GetRootPart().GetAllBodies() for body in all_bodies: is_solid=body.GetMaster().Shape.IsClosed body_name=body.GetName() print("Body name: %s is a solid body: %s"%(body_name,is_solid))
2