M および N 方向の点の数と、M および N 方向の点の座標を指定して、自由形状の 3D メッシュを作成します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = object.Add3Dmesh(M, N, PointsMatrix)
タイプ: Block、ModelSpace、PaperSpace
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: 整数型
点配列の次元。M および N 方向のメッシュのサイズは、2 から 256 までに制限されます。
アクセス: 入力のみ
タイプ: バリアント型(倍精度浮動小数点数型配列)
3D WCS 座標の M x N 配列。頂点は、座標(0,0)から開始します。M 行に含まれる各頂点の座標位置を指定してから、M + 1 行の頂点を指定します。
各頂点間の距離は自由です。

PolygonMesh は、常に M 方向と N 方向の両方に開いています。作成したメッシュは、PolygonMesh オブジェクトの MClose プロパティと NClose プロパティを使用すれば、閉じることができます。
PolygonMesh は、常に単純なメッシュとして作成されます。作成後、Type プロパティを使用してメッシュをスムージングすることができます。
VBA:
Sub Example_Add3DMesh()
' This example creates a 4 X 4 polygonmesh in model space.
Dim meshObj As AcadPolygonMesh
Dim mSize, nSize, count As Integer
Dim points(0 To 47) As Double
' Create the matrix of points
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
' creates a 3Dmesh in model space
Set meshObj = ThisDrawing.ModelSpace.Add3DMesh(mSize, nSize, points)
' Change the viewing direction of the viewport to better see the polygonmesh
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
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Add3DMesh()
;; This example creates a 4 X 4 polygonmesh in model space.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the matrix of points
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 47)))
(vlax-safearray-fill points '(0 0 0
2 0 1
4 0 0
6 0 1
0 2 0
2 2 1
4 2 0
6 2 1
0 4 0
2 4 1
4 4 0
6 4 0
0 6 0
2 6 1
4 6 0
6 6 0
)
)
(setq mSize 4
nSize 4)
;; creates a 3Dmesh in model space
(setq modelSpace (vla-get-ModelSpace doc))
(setq meshObj (vla-Add3DMesh modelSpace mSize nSize points))
;; Change the viewing direction of the viewport to better see the polygonmesh
(setq NewDirection (vlax-3d-point -1 -1 1))
(setq activeViewport (vla-get-ActiveViewport doc))
(vla-put-Direction activeViewport NewDirection)
(vla-put-ActiveViewport doc activeViewport)
(vla-ZoomAll acadObj)
)