|
NVertexCount Пример |
Sub Example_NVertexCount()
'Этот пример создает многоугольную сеть 4 X 4 в пространстве модели.
'Затем находит число точек в 'N' направлении.
Dim meshObj As AcadPolygonMesh
Dim mSize, nSize, count As Integer
Dim points(0 To 47) As Double
'Создайте матрицу точек
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 2: points(4) = 0: points(5) = 1
points(6) = 4: points(7) = 0: points(8) = 0
points(9) = 6: points(10) = 0: points(11) = 1
points(12) = 0: points(13) = 2: points(14) = 0
points(15) = 2: points(16) = 2: points(17) = 1
points(18) = 4: points(19) = 2: points(20) = 0
points(21) = 6: points(22) = 2: points(23) = 1
points(24) = 0: points(25) = 4: points(26) = 0
points(27) = 2: points(28) = 4: points(29) = 1
points(30) = 4: points(31) = 4: points(32) = 0
points(33) = 6: points(34) = 4: points(35) = 0
points(36) = 0: points(37) = 6: points(38) = 0
points(39) = 2: points(40) = 6: points(41) = 1
points(42) = 4: points(43) = 6: points(44) = 0
points(45) = 6: points(46) = 6: points(47) = 0
mSize = 4: nSize = 4
'Создайте 3Dmesh в пространстве модели
Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)
'Измените направление рассмотрения области просмотра, чтобы лучше видеть многосеть
Dim NewDirection(0 To 2) As Double
NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
ThisDrawing.ActiveViewport.direction = NewDirection
ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
ZoomAll
'Найдите NVertexCount для сети
Dim currVertexCount As Integer
currVertexCount = meshObj.NVertexCount
MsgBox "NVertexCount для сети " & meshObj.NVertexCount, , "NVertexCount Пример"
End Sub