NClose Пример

Sub Example_NClose()
    'Этот пример создает многоугольную сеть 4 X 4 в пространстве модели.
    'Затем закрывает сеть в 'N' направлении.
    Dim meshObj As AcadPolygonMesh
    Dim mSize, nSize, count As Integer
    Dim points(0 To 47) As Double
    
    'Создайте матрицу точек
    points(0) = 2: points(1) = 2: points(2) = 1
    points(3) = 2.5: points(4) = 2: points(5) = 0
    points(6) = 5: points(7) = 2: points(8) = 0
    points(9) = 5.5: points(10) = 2: points(11) = 1
    points(12) = 2: points(13) = 4: points(14) = 0.5
    points(15) = 2.5: points(16) = 4: points(17) = 0
    points(18) = 5: points(19) = 4: points(20) = 0
    points(21) = 5.5: points(22) = 4: points(23) = 0.5
    points(24) = 2: points(25) = 6: points(26) = 0.5
    points(27) = 2.5: points(28) = 6: points(29) = 0
    points(30) = 5: points(31) = 6: points(32) = 0
    points(33) = 5.5: points(34) = 6: points(35) = 0.5
    points(36) = 2: points(37) = 8: points(38) = 1
    points(39) = 2.5: points(40) = 8: points(41) = 0
    points(42) = 5: points(43) = 8: points(44) = 0
    points(45) = 5.5: points(46) = 8: points(47) = 1
    
    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
    
    'Закройте сеть в 'N' направлении
    MsgBox "Многосеть " & IIf(meshObj.NClose, "закрыта", "открыта") & " в направлении 'N'.", , "NClose Пример"
    meshObj.NClose = True
    ThisDrawing.Regen acActiveViewport
    MsgBox "Многосеть " & IIf(meshObj.NClose, "закрыта", "открыта") & " в направлении 'N'.", , "NClose Пример"

End Sub
Сайт управляется системой uCoz