Click or drag to resize
BodyCreateSolidBox Method
Creates a new Body consisting of a solid box.

Namespace:  ABB.Robotics.RobotStudio.Stations
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
public static Body CreateSolidBox(
	Matrix4 origin,
	Vector3 size
)

Parameters

origin
Type: ABB.Robotics.MathMatrix4
Defines the origin position and rotation of the box.
size
Type: ABB.Robotics.MathVector3
Defines the length, height and width of the box.

Return Value

Type: Body
The new Body.
Examples
Create Solid Box.
Body CreateSolids Example
Project.UndoContext.BeginUndoStep("BodyCreateSolids");
try
{
    Station station = Station.ActiveStation;

    // Create a part to contain the bodies.
    #region BodyCreateSolidsStep1
    Part p = new Part();
    p.Name = "My_Solid_Bodies";
    station.GraphicComponents.Add(p);
    #endregion

    // Create a solid box.
    #region BodyCreateSolidsStep2
    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);
    #endregion

    // Create a cone.
    #region BodyCreateSolidsStep3
    Body b2 = Body.CreateSolidCone(matrix_origo, 1.0, 1.0);
    b2.Name = "Cone";
    p.Bodies.Add(b2);
    #endregion

    // Create a cylinder.
    #region BodyCreateSolidsStep4
    Body b3 = Body.CreateSolidCylinder(matrix_origo, 0.5, 0.5);
    b3.Name = "Cylinder";
    p.Bodies.Add(b3);
    #endregion

    // Create a pyramid.
    #region BodyCreateSolidsStep5
    Body b4 = Body.CreateSolidPyramid(matrix_origo, 1.0, 1.0, 6);
    b4.Name = "Pyramid";
    p.Bodies.Add(b4);
    #endregion

    // Create a sphere.
    #region BodyCreateSolidsStep6
    Vector3 vector_origo = new Vector3(0.0, 0.0, 0.0);
    Body b5 = Body.CreateSolidSphere(vector_origo, 0.75);
    b5.Name = "Sphere";
    p.Bodies.Add(b5);
    #endregion

    // Create a torus.
    #region BodyCreateSolidsStep7
    Body b6 = Body.CreateSolidTorus(matrix_origo, 1.0, 0.5);
    b6.Name = "Torus";
    p.Bodies.Add(b6);
    #endregion
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}
Version Information

Supported in: 1.0.0.0
See Also