Add3DFace Method (ActiveX)

Creates a 3DFace object given four vertices.

Supported platforms: Windows only

Signature

VBA:

RetVal = object.Add3DFace(Point1, Point2, Point3 [, Point4])
object

Type: Block, ModelSpace, PaperSpace

The objects this method applies to.

Point1

Access: Input-only

Type: Variant (three-element array of doubles)

The 3D WCS coordinates specifying a point on the 3DFace object.

Point2

Access: Input-only

Type: Variant (three-element array of doubles)

The 3D WCS coordinates specifying a point on the 3DFace object.

Point3

Access: Input-only

Type: Variant (three-element array of doubles)

The 3D WCS coordinates specifying a point on the 3DFace object.

Point4

Access: Input-only; optional

Type: Variant (three-element array of doubles)

The 3D WCS coordinates specifying a point on the 3DFace object. If omitted, this point will default to the coordinates of Point3 in order to create a three-sided face.

Return Value (RetVal)

Type: 3DFace

The newly created 3DFace object.

Remarks

To create a three-sided face, omit the last point. Use the SetInvisibleEdge method to set the visibility of an edge.

Points must be entered sequentially in either a clockwise or counterclockwise direction to create a 3DFace object. You can create multiple adjacent faces by specifying the first two points of an additional face exactly as the last two points of the previous face.



Examples

VBA:

Sub Example_Add3DFace()
    ' This example creates a 3D face in model space.

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim point3(0 To 2) As Double
    Dim point4(0 To 2) As Double
    
    ' Define the four coordinates of the face
    point1(0) = 0#: point1(1) = 0#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 0#: point2(2) = 1#
    point3(0) = 5#: point3(1) = 5#: point3(2) = 1#
    point4(0) = 1#: point4(1) = 10#: point4(2) = 0#
    
    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ZoomAll
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_Add3DFace()
    ;; This example creates a 3D face in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Define the four coordinates of the face
    (setq point1 (vlax-3d-point 0 0 0)
          point2 (vlax-3d-point 5 0 1)
          point3 (vlax-3d-point 5 10 1)
          point4 (vlax-3d-point 0 10 0))
    
    ;; Create the 3DFace object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq faceObj (vla-Add3DFace modelSpace point1 point2 point3 point4))
    (vla-ZoomAll acadObj)
)