Prompts the user to pick an object from the screen.
Supported platforms: Windows only
VBA:
object.SelectOnScreen [FilterType, FilterData]
Type: SelectionSet
The object this method applies to.
Access: Input-only; optional
Type: Variant
A DXF group code specifying the type of filter to use.
Access: Input-only; optional
Type: Variant
The value to filter on.
No return value.
This method supports the filtering mechanism.
AutoCAD's default prompt for picking an object will be used automatically.
For more selection mode options, see the Select, SelectByPolygon, and SelectAtPoint methods.
VBA:
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) )