How can I extract basic geometry information for a body in SpaceClaim?
Nikos Kallitsis
Member, Employee Posts: 38
✭✭✭✭
in 3D Design
I have some bodies designed in SpaceClaim and want to extract some basic geometric information like body center and bounding box.
Tagged:
0
Best Answer
-
You can extract the requested information by using SpaceClaim scripting. Here is a sample script:
#Body Center bodySelection = BodySelection.Create(GetRootPart().Bodies[0]) designBodySelection = body.Bodies[0] bodyMassProp = designBodySelection.MassProperties bodyCenter = bodyMassProp.PrincipleAxes.Origin bodyCenterX = bodyCenter.X bodyCenterY = bodyCenter.Y bodyCenterZ = bodyCenter.Z #Body Bounding Box bodyBox = designBodySelection.Shape.GetBoundingBox(Matrix.Identity) bodyCenter2 = bodyBox.Center #Should be equal to bodyCenter from above bodyCorners = bodyBox.Corners bodyCornerPoint = bodyCorners[0] bodyCornerPointX = bodyCornerPoint.X
1