Click or drag to resize

DXFReaderNETControlAddFace3D Method

Adds a 3D face to the current drawing.

Namespace:  DXFReaderNET
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.10.54
Syntax
public EntityObject AddFace3D(
	Vector3 FirstVertex,
	Vector3 SecondVertex,
	Vector3 ThirdVertex,
	Vector3 FourthVertex,
	short ACIColor = 256,
	string LayerName = "",
	string LineTypeName = ""
)

Parameters

FirstVertex
Type: DXFReaderNETVector3
The first vertex of the 3D face.
SecondVertex
Type: DXFReaderNETVector3
The second vertex of the 3D face.
ThirdVertex
Type: DXFReaderNETVector3
The third vertex of the 3D face.
FourthVertex
Type: DXFReaderNETVector3
The fourth vertex of the 3D face.
ACIColor (Optional)
Type: SystemInt16
A number for 0 to 256 corresponding to the AutoCAD Color Index (0 = ByBlock; 256 = ByLayer. Default value = 256).
LayerName (Optional)
Type: SystemString
The layer name. If omitted, or layername doesn't exist, the CurrentLayer will be used.
LineTypeName (Optional)
Type: SystemString
The linetype name. If omitted, or linetype doesn't exist, the CurrentLineTypeName will be used.

Return Value

Type: EntityObject
The new added 3D face entity.
Remarks
The entity is added to the active layout.
Examples
Adds a new 3D face entity to the current drawing with ACI color = 5 (blue).
[C#]

Vector3 FirstVertex = new Vector3(0, 0, 0);
Vector3 SecondVertex = new Vector3(0, 10, 0);
Vector3 ThirdVertex = new Vector3(10, 10, 0);
Vector3 FourthVertex = new Vector3(10, 0, 0);
dxfReaderNETControl1.AddFace3D(FirstVertex, SecondVertex, ThirdVertex, FourthVertex, 5);
[Visual Basic]

Dim FirstVertex As New Vector3(0, 0, 0)
Dim SecondVertex As New Vector3(0, 10, 0)
Dim ThirdVertex As New Vector3(10, 10, 0)
Dim FourthVertex As New Vector3(10, 0, 0)
DxfReaderNETControl1.AddFace3D(FirstVertex, SecondVertex, ThirdVertex, FourthVertex, 5)
Creates a cylinder made with 3D Faces with ACI color = 1 (Red).
[C#]
for (k = 0; k <= 35; k++)
{
    double alpha = k * 10 * MathHelper.DegToRad;
    double alpha2 = (k + 1) * 10 * MathHelper.DegToRad;
    Vector3 FirstVertex = new Vector3(Math.Cos(alpha), Math.Sin(alpha), 0);
    Vector3 SecondVertex = new Vector3(Math.Cos(alpha2), Math.Sin(alpha2), 0);
    Vector3 ThirdVertex = new Vector3(Math.Cos(alpha2), Math.Sin(alpha2), 1);
    Vector3 FourthVertex = new Vector3(Math.Cos(alpha), Math.Sin(alpha), 1);
    dxfReaderNETControl1.AddFace3D(FirstVertex, SecondVertex, ThirdVertex, FourthVertex, 1);
}
[Visual Basic]

For k = 0 To 35
  Dim alpha As Double = k * 10 * MathHelper.DegToRad
  Dim alpha2 As Double = (k + 1) * 10 * MathHelper.DegToRad
  Dim FirstVertex As New Vector3(Math.Cos(alpha), Math.Sin(alpha), 0)
  Dim SecondVertex As New Vector3(Math.Cos(alpha2), Math.Sin(alpha2), 0)
  Dim ThirdVertex As New Vector3(Math.Cos(alpha2), Math.Sin(alpha2), 1)
  Dim FourthVertex As New Vector3(Math.Cos(alpha), Math.Sin(alpha), 1)

  DxfReaderNETControl1.AddFace3D(FirstVertex, SecondVertex, ThirdVertex, FourthVertex, 1)
Next k
See Also