提示用户从屏幕上选取对象。 支持的平台:仅窗口 签名工 务 局: object.SelectOnScreen [FilterType, FilterData]
返回值(RetVal)无返回值。 言论此方法支持筛选机制。 将自动使用 AutoCAD 选取对象的默认提示。 有关更多选择模式选项,请参阅、和方法。SelectSelectByPolygonSelectAtPoint 例子工 务 局: Sub Example_SelectOnScreen()
' This example adds objects to a selection set by prompting the user
' to select ones to add.
AppActivate ThisDrawing.Application.Caption
' Create the selection set
Dim ssetObj As AcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET")
' Add objects to a selection set by prompting user to select on the screen
ssetObj.SelectOnScreen
End Sub
Visual LISP: (vl-load-com)
(defun c:Example_SelectOnScreen()
;; This example adds objects to a selection set by prompting the user
;; to select ones to add.
(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_SSET"))
;; Add objects to a selection set by prompting user to select on the screen
(vla-SelectOnScreen ssetObj)
(alert (strcat "Objects selected: " (itoa (vla-get-Count ssetObj))))
(vla-Delete ssetObj)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-27 11:34
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.