AddPolyfaceMesh method example


Sub AddPolyfaceMesh_Example()
' This example adds a lightweight polyline to the drawing.
    Dim faceObj As AcadPolyfaceMesh
    Dim vertexList(0 To 29) As Double
    vertexList(0) = 0: vertexList(1) = 0: vertexList(2) = 0     'vertex number: 1
    vertexList(3) = -2: vertexList(4) = 2: vertexList(5) = 0    'vertex number: 2
    vertexList(6) = 0: vertexList(7) = 4: vertexList(8) = 0     'vertex number: 3
    vertexList(9) = 4: vertexList(10) = 4: vertexList(11) = 0   'vertex number: 4
    vertexList(12) = 6: vertexList(13) = 2: vertexList(14) = 0  'vertex number: 5
    vertexList(15) = 0: vertexList(16) = 0: vertexList(17) = 1  'vertex number: 6
    vertexList(18) = -2: vertexList(19) = 2: vertexList(20) = 1 'vertex number: 7
    vertexList(21) = 0: vertexList(22) = 4: vertexList(23) = 1  'vertex number: 8
    vertexList(24) = 4: vertexList(25) = 4: vertexList(26) = 1  'vertex number: 9
    vertexList(27) = 6: vertexList(28) = 2: vertexList(29) = 1  'vertex number: 10
    Dim faceList(0 To 15) As Integer
    'face number 1:
        faceList(0) = 1
        faceList(1) = 2
        faceList(2) = 7
        faceList(3) = 6
    'face number 2:
        faceList(4) = 2
        faceList(5) = 3
        faceList(6) = 8
        faceList(7) = 7
    'face number 3:
        faceList(8) = 3
        faceList(9) = 4
        faceList(10) = 9
        faceList(11) = 8
    'face number 4:
        faceList(12) = 4
        faceList(13) = 5
        faceList(14) = 10
        faceList(15) = 9
    Set faceObj = ThisDrawing.ModelSpace.AddPolyfaceMesh(vertexList, faceList)
    faceObj.Update
    ThisDrawing.Application.ZoomExtents
End Sub

© Bricsys NV. All rights reserved.