指定された点を通る 1 つのオブジェクトを選択し、それを選択セットに配置します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.SelectAtPoint Point, FilterType, FilterData
タイプ: SelectionSet
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: バリアント型(3 要素の倍精度浮動小数点数型配列)
選択に使用される点を指定する 3D UCS 座標。
アクセス: 入力のみ; オプション
タイプ: バリアント型
使用するフィルタのタイプを指定する DXF グループ コード。
アクセス: 入力のみ; オプション
タイプ: バリアント型
フィルタをオンにする値。
戻り値はありません。
このメソッドは、フィルタ機能をサポートしています。
システム変数 PICKBOX は、オブジェクト選択に影響します。
選択モードのオプションについての詳細は、Select、SelectByPolygon、および SelectOnScreen メソッドを参照してください。
VBA:
Sub Example_SelectAtPoint()
' This example adds objects to a selection set by identifying a point.
' At first all objects at the point are added to the selection set. Then
' only circle objects at the point are added to the selection set.
' Create the selection set
Dim ssetObj As AcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET1")
' Add to the selection set all the objects that lie at point(6.8,9.4,0)
Dim point(0 To 2) As Double
point(0) = 6.8: point(1) = 9.4: point(2) = 0
ssetObj.SelectAtPoint point
' Add to the selection set all the Circles that lie at point (6.8,9.4,0)
Dim gpCode(0) As Integer
Dim dataValue(0) As Variant
gpCode(0) = 0
dataValue(0) = "Circle"
Dim groupCode As Variant, dataCode As Variant
groupCode = gpCode
dataCode = dataValue
ssetObj.SelectAtPoint point, groupCode, dataCode
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_SelectAtPoint()
;; This example adds objects to a selection set by identifying a point.
;; At first all objects at the point are added to the selection set. Then
;; only circle objects at the point are added to the selection set.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the selection set
(setq ssetObj (vla-Add (vla-get-SelectionSets doc) "TEST_SSET1"))
;; Add to the selection set all the objects that lie at point(6.8,9.4,0)
(setq point (vlax-3d-point 6.8 9.4 0))
(vla-SelectAtPoint ssetObj point)
(alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj))))
(vla-Clear ssetObj)
;; Add to the selection set all the Circles that lie at point (6.8,9.4,0)
(setq gpCode (vlax-make-safearray vlax-vbInteger '(0 . 0)))
(vlax-safearray-put-element gpCode 0 0)
(setq dataValue (vlax-make-safearray vlax-vbVariant '(0 . 0)))
(vlax-safearray-put-element dataValue 0 "Circle")
(vla-SelectAtPoint ssetObj point gpCode dataValue)
(alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj))))
(vla-Delete ssetObj)
)