Vla-get-mvertexcount
- 構文
- (vla-get-mvertexcount vla-object )
- 機能
- M 方向におけるポリメッシュの頂点数を取得する。
- 引数
-
- vla-object … PolygonMesh のVLAオブジェクト
- 戻り値
- ポリメッシュの頂点数 2~256
- MEMO:これは、Type プロパティが acSimpleMesh である場合に PolygonMesh の M 行を構成するために使用される頂点の数。その他のタイプの PolygonMesh については、MDensity の値が行サイズとして使用される。
- 単純なメッシュでは頂点の数を変更できない。
- サンプル
(vl-load-com)
(defun c:Example_MVertexCount()
;; 4 X 4 のポリゴンメッシュを作成してM 方向の頂点数を返すサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; 3Dメッシュの定義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)
;; 3Dメッシュを作成
(setq modelSpace (vla-get-ModelSpace doc))
(setq meshObj (vla-Add3DMesh modelSpace mSize nSize points))
;; 変更
(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)
;; メッシュの MVertexCount を取得
(setq currVertexCount (vla-get-MVertexCount meshObj))
(alert (strcat "The MVertexCount for the mesh is " (itoa currVertexCount)))
)
関連事項