Class SweepOptions
Provides options for Body.Sweep and Body.Extrude.
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public class SweepOptions
Constructors
SweepOptions()
Create a new SweepOptions object with default settings.
Declaration
public SweepOptions()
Properties
MakeSolid
If true the sweep will create a solid body. If false the sweep will create a sheet body.
Declaration
public bool MakeSolid { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Sweep Options.
Project.UndoContext.BeginUndoStep("BodyExtrude");
try
{
Station station = Station.ActiveStation;
// Create a part.
#region BodyExtrudeStep1
Part p = new Part();
p.Name = "My_Extruded_Bodies";
station.GraphicComponents.Add(p);
#endregion
// Create a solid box and add it to My_Part1.
#region BodyExtrudeStep2
Body b = Body.CreateSolidBox(new Matrix4
(new Vector3(0.0, 0.0, 0.0)), new Vector3(0.5, 0.5, 0.5));
b.Name = "Box";
p.Bodies.Add(b);
#endregion
// Create face.
#region BodyExtrudeStep3
Face f = b.Shells[0].Faces[0];
#endregion
// Create a wire.
#region BodyExtrudeStep4
Body wirebody = Body.CreateLine
(new Vector3(0.0, 0.0, 0.0), new Vector3(1.0, 1.0, 1.0));
wirebody.Name = "Wirebody";
p.Bodies.Add(wirebody);
Wire w = wirebody.Shells[0].Wires[0];
#endregion
// Set the sweep option to solid.
#region BodyExtrudeStep5
SweepOptions so = new SweepOptions();
so.MakeSolid = true;
#endregion
#region BodyExtrudeStep6
Vector3 vec = new Vector3(1.0, 1.0, 1.0);
#endregion
// Extrude face along wire.
#region BodyExtrudeStep7
Body[] bds = Body.Extrude(f, vec, w, so);
foreach (Body bd in bds)
{
bd.Name = "Face extruded along wire";
p.Bodies.Add(bd);
}
#endregion
// Create a second wire.
#region BodyExtrudeStep8
Body wirebody2 = Body.CreateLine
(new Vector3(0.0, 0.0, 0.0), new Vector3(1.0, 1.0, -1.0));
wirebody2.Name = "Wirebody 2";
p.Bodies.Add(wirebody2);
Wire w2 = wirebody2.Shells[0].Wires[0];
#endregion
// Extrude the first wire along the second.
#region BodyExtrudeStep9
Body[] bds2 = Body.Extrude(w, vec, w2, so);
foreach (Body bd in bds2)
{
bd.Name = "Wire extruded along wire";
p.Bodies.Add(bd);
}
#endregion
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Steps
Specifies to convert a circular sweep path into the specified number of linear segments.
Declaration
public int Steps { get; set; }
Property Value
Type | Description |
---|---|
Int32 |