Class Coedge
A coedge is closely related to an edge. A coedge stores its relationships with adjacent edges and
with superior owning entities. (In some contexts, the coedge may be viewed as the use of an edge
by a face or wire.) The data structures formed by these relationships (stored as pointers) and their
interpretation depend upon the nature of the owning entity.
Implements
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class Coedge : ProjectObject, IHasGeometry
Remarks
The Coedge object is generated on demand and is not stored in the station file; therefore Attributes cannot be used to persist attributes.
Properties
View SourceBody
Declaration
public Body Body { get; }
Property Value
| Type | Description |
|---|---|
| Body |
Examples
Get Body.
Project.UndoContext.BeginUndoStep("CoedgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
myCoedge.Edge.Name = "MyEdge";
// Output some info of the coedge.
Logger.AddMessage(new LogMessage($"The body of the coedge is: {myCoedge.Body.Name}"));
Logger.AddMessage(new LogMessage($"The edge of the coedge is: {myCoedge.Edge.Name}"));
Logger.AddMessage(new LogMessage($"The coedge is reversed: {myCoedge.Reversed}"));
Logger.AddMessage(new LogMessage(
$"The start vertex of the coedge is: ({myCoedge.StartVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
Logger.AddMessage(new LogMessage(
$"The end vertex of the coedge is: ({myCoedge.EndVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
Edge
Declaration
public Edge Edge { get; }
Property Value
| Type | Description |
|---|---|
| Edge |
Examples
Get Edge.
Project.UndoContext.BeginUndoStep("CoedgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
myCoedge.Edge.Name = "MyEdge";
// Output some info of the coedge.
Logger.AddMessage(new LogMessage($"The body of the coedge is: {myCoedge.Body.Name}"));
Logger.AddMessage(new LogMessage($"The edge of the coedge is: {myCoedge.Edge.Name}"));
Logger.AddMessage(new LogMessage($"The coedge is reversed: {myCoedge.Reversed}"));
Logger.AddMessage(new LogMessage(
$"The start vertex of the coedge is: ({myCoedge.StartVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
Logger.AddMessage(new LogMessage(
$"The end vertex of the coedge is: ({myCoedge.EndVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
EndVertex
Gets the end vertex of the coedge.
Declaration
public Vertex EndVertex { get; }
Property Value
| Type | Description |
|---|---|
| Vertex |
Examples
Get EndVertex.
Project.UndoContext.BeginUndoStep("CoedgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
myCoedge.Edge.Name = "MyEdge";
// Output some info of the coedge.
Logger.AddMessage(new LogMessage($"The body of the coedge is: {myCoedge.Body.Name}"));
Logger.AddMessage(new LogMessage($"The edge of the coedge is: {myCoedge.Edge.Name}"));
Logger.AddMessage(new LogMessage($"The coedge is reversed: {myCoedge.Reversed}"));
Logger.AddMessage(new LogMessage(
$"The start vertex of the coedge is: ({myCoedge.StartVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
Logger.AddMessage(new LogMessage(
$"The end vertex of the coedge is: ({myCoedge.EndVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
Next
Returns the next coedge connected to this.
Declaration
public Coedge Next { get; }
Property Value
| Type | Description |
|---|---|
| Coedge |
Previous
Returns the previous coedge connected to this.
Declaration
public Coedge Previous { get; }
Property Value
| Type | Description |
|---|---|
| Coedge |
Reversed
Gets whether the coedge is reversed or not.
Declaration
public bool Reversed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Examples
Get Reversed.
Project.UndoContext.BeginUndoStep("CoedgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
myCoedge.Edge.Name = "MyEdge";
// Output some info of the coedge.
Logger.AddMessage(new LogMessage($"The body of the coedge is: {myCoedge.Body.Name}"));
Logger.AddMessage(new LogMessage($"The edge of the coedge is: {myCoedge.Edge.Name}"));
Logger.AddMessage(new LogMessage($"The coedge is reversed: {myCoedge.Reversed}"));
Logger.AddMessage(new LogMessage(
$"The start vertex of the coedge is: ({myCoedge.StartVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
Logger.AddMessage(new LogMessage(
$"The end vertex of the coedge is: ({myCoedge.EndVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
View Source
StartVertex
Gets the start vertex of the coedge.
Declaration
public Vertex StartVertex { get; }
Property Value
| Type | Description |
|---|---|
| Vertex |
Examples
Get EndVertex.
Project.UndoContext.BeginUndoStep("CoedgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
myCoedge.Edge.Name = "MyEdge";
// Output some info of the coedge.
Logger.AddMessage(new LogMessage($"The body of the coedge is: {myCoedge.Body.Name}"));
Logger.AddMessage(new LogMessage($"The edge of the coedge is: {myCoedge.Edge.Name}"));
Logger.AddMessage(new LogMessage($"The coedge is reversed: {myCoedge.Reversed}"));
Logger.AddMessage(new LogMessage(
$"The start vertex of the coedge is: ({myCoedge.StartVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
Logger.AddMessage(new LogMessage(
$"The end vertex of the coedge is: ({myCoedge.EndVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>
Methods
View SourceFindClosestVertex(Vector3)
Declaration
public Vertex FindClosestVertex(Vector3 testPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | testPoint | The point which to find the closest vertex to. |
Returns
| Type | Description |
|---|---|
| Vertex | The closest Vertex. |
Examples
Codege FindClosestVertex.
Project.UndoContext.BeginUndoStep("CoedgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
myCoedge.Edge.Name = "MyEdge";
// Output some info of the coedge.
Logger.AddMessage(new LogMessage($"The body of the coedge is: {myCoedge.Body.Name}"));
Logger.AddMessage(new LogMessage($"The edge of the coedge is: {myCoedge.Edge.Name}"));
Logger.AddMessage(new LogMessage($"The coedge is reversed: {myCoedge.Reversed}"));
Logger.AddMessage(new LogMessage(
$"The start vertex of the coedge is: ({myCoedge.StartVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
Logger.AddMessage(new LogMessage(
$"The end vertex of the coedge is: ({myCoedge.EndVertex.Position.ToString(numDecimals: 8, separator: ", ")})"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}</code></pre>