Click or drag to resize
BodyCollection Class
A collection of Body objects.
Inheritance Hierarchy
SystemObject
  ABB.Robotics.RobotStudio.StationsBodyCollection

Namespace:  ABB.Robotics.RobotStudio.Stations
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
public class BodyCollection : ICollection, 
	IEnumerable, IEnumerable<Body>

The BodyCollection type exposes the following members.

Properties
Methods
Examples
Body Collection.
Body Properties Example
Project.UndoContext.BeginUndoStep("BodyProperties");
try
{
    Station station = Station.ActiveStation;

    // Create a part to contain the bodies.
    Part p = new Part();
    p.Name = "My_Part";
    station.GraphicComponents.Add(p);

    // Create a solid box.
    Matrix4 matrix_origo = new Matrix4(new Vector3(Axis.X), 0.0);
    Vector3 size = new Vector3(0.5, 0.5, 0.5);
    Body b1 = Body.CreateSolidBox(matrix_origo, size);
    b1.Name = "Box";
    p.Bodies.Add(b1);

    // Log a summary of the bodies properties.
    Logger.AddMessage(new LogMessage("The body '" + b1.Name + "' has the following properties:"));

    Logger.AddMessage(new LogMessage("Center of gravity: x: " + b1.CenterOfGravity.x.ToString() +
                                                            " y: " + b1.CenterOfGravity.y.ToString() +
                                                            " z: " + b1.CenterOfGravity.z.ToString()));
    Logger.AddMessage(new LogMessage("Color: " + b1.Color.ToString()));

    Logger.AddMessage(new LogMessage("Moment of Inertia: x: (" + b1.MomentOfInertia.x.x.ToString() +
                                                                 ", " + b1.MomentOfInertia.x.y.ToString() +
                                                                 ", " + b1.MomentOfInertia.x.z.ToString() + ")" +
                                                             " y: (" + b1.MomentOfInertia.y.x.ToString() +
                                                                 ", " + b1.MomentOfInertia.y.y.ToString() +
                                                                 ", " + b1.MomentOfInertia.y.z.ToString() + ")" +
                                                             " z: (" + b1.MomentOfInertia.z.x.ToString() +
                                                                 ", " + b1.MomentOfInertia.z.y.ToString() +
                                                                 ", " + b1.MomentOfInertia.z.z.ToString() + ")"));

    Logger.AddMessage(new LogMessage("Has '" + b1.Shells.Count.ToString() + "' number of shells."));
    Logger.AddMessage(new LogMessage("Surface area: " + b1.SurfaceArea.ToString()));
    Logger.AddMessage(new LogMessage("Transform: X: " + b1.Transform.X.ToString() +
                                                    " Y: " + b1.Transform.Y.ToString() +
                                                    " Z: " + b1.Transform.Z.ToString() +
                                                    " Rx: " + b1.Transform.RX.ToString() +
                                                    " Ry: " + b1.Transform.RY.ToString() +
                                                    " Rz: " + b1.Transform.RZ.ToString()));
    Logger.AddMessage(new LogMessage("Visibility: " + b1.Visible.ToString()));
    Logger.AddMessage(new LogMessage("Volume: " + b1.Volume.ToString()));
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}
Version Information

Supported in: 1.0.0.0
See Also