Vla-get-objectname
- 構文
- (vla-get-objectname vla-object )
- 機能
- オブジェクトの CAD クラス名を取得する。
- 引数
-
- vla-object … VLAオブジェクト(すべての図形オブジェクト、AttributeReference、Block、Blocks、Dictionary、Dictionaries、Dimension、DimStyle、DimStyles、Group、Groups、Layer、Layers、Layout、Layouts、Linetype、Linetypes、Material、Materials、MLeaderStyle、ModelSpace、PaperSpace、PlotConfiguration、PlotConfigurations、RegisteredApplication、RegisteredApplications、SectionManager、SectionSettings、SortentsTable、SubDMeshEdge、SubDMeshFace、SubDMeshVertex、SubEntity、SubEntSolidEdge、SubEntSolidFace、SubEntSolidNode、SubEntSolidVertex、TableStyle、TextStyle、TextStyles、UCS、UCSs、View、Views、Viewport、Viewports、XRecord)
- 戻り値
- オブジェクトの CAD のクラス名。
- サンプル
(vl-load-com)
(defun c:Example_ObjectName()
;; モデル空間に複数のオブジェクトを作成してから、
;; 見つかった各オブジェクトのオブジェクト名を表示するサンプル
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq modelSpace (vla-get-ModelSpace doc))
;; 放射線を作成
(setq basePoint (vlax-3d-point 3 3 0)
secondPoint (vlax-3d-point 1 3 0))
(setq rayObj (vla-AddRay modelSpace basePoint SecondPoint))
;; ポリラインを作成
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 5)))
(vlax-safearray-fill points '(3 7
9 2
3 5)
)
(setq plineObj (vla-AddLightWeightPolyline modelSpace points))
(vla-put-Closed plineObj :vlax-true)
;; 線分を作成
(setq startPoint (vlax-3d-point 0 0 0)
endPoint (vlax-3d-point 2 2 0))
(setq lineObj (vla-AddLine modelSpace startPoint endPoint))
;; 円を作成
(setq centerPt (vlax-3d-point 20 30 0)
radius 3)
(setq circObj (vla-AddCircle modelSpace centerPt radius))
;; 楕円を作成
(setq center (vlax-3d-point 5 5 0)
majAxis (vlax-3d-point 10 20 0)
radRatio 0.3)
(setq ellObj (vla-AddEllipse modelSpace center majAxis radRatio))
(vla-ZoomAll acadObj)
;; オブジェクトをなめていってオブジェクト名を表示
(vlax-for entry (vla-get-ModelSpace doc)
(setq objName (vla-get-ObjectName entry))
(vla-Highlight entry :vlax-true)
(alert (strcat "この図形の名前は " objName))
(vla-Highlight entry :vlax-false)
)
)
関連事項