Select Method

Back to Methods Reference

Selects objects and places them into a selection set.

Signature

VBA : object.Select Mode[, Point1][, Point2][, FilterType][, FilterData]

VLA : (vla-Select object Mode Point1 Point2 FilterType FilterData)

(vla-Select newSet acSelectionSetAll)

  • Object : SelectionSet
    The object or objects this method applies to.
  • Mode :  AcSelect enum; input-only
    acSelectionSetWindow
    acSelectionSetCrossing
    acSelectionSetPrevious
    acSelectionSetLast
    acSelectionSetAll
  • Point1 : Variant (array of doubles); input-only; optional
    The 3D WCS coordinates, or array of coordinates, specifying Point1. See the mode definitions above for the proper use of Point1.
  • Point2 : Variant (three-element array of doubles); input-only; optional
    The 3D WCS coordinates specifying Point2. See the mode definitions above for the proper use of Point2.
  • FilterType : Integer; input-only; optional
    A DXF group code specifying the type of filter to use.
  • FilterData Variant; input-only; optional
    The value to filter on.

Remarks

This method supports the filtering mechanism.
The following selection modes are available:

  • Window: Selects all entities completely inside a rectangular area whose corners are defined by Point1 and Point2.
  • Crossing: Selects objects within and crossing a rectangular area whose corners are defined by Point1 and Point2.
  • Previous: Selects the most recent selection set. This mode is ignored if you switch between paper and model space and attempt to use the selection set.
  • Last: Selects the most recently created visible entity.
  • All: Selects all entities.

For more selection mode options, see the SelectByPolygon, SelectAtPoint, and SelectOnScreen methods.

Refer to Visual Lisp - Selection Objects for more details.

Example :


(defun c:al-select ()

(vl-load-com)

(setq thisdrawing (vla-get-activedocument
     (vlax-get-acad-object)))

(setq ssets (vla-get-selectionsets thisdrawing))

(if (vl-catch-all-error-p 
    (vl-catch-all-apply 'vla-item (list ssets "$Set")))

  (setq newSet (vla-add ssets "$Set"))
  
     (progn
       
    	(vla-delete (vla-item ssets "$Set"))
       
  	(setq newSet (vla-add ssets "$Set"))
       
     );progn

);if

(vla-Select newSet acSelectionSetAll)

(princ)

);defun

 
The AutoLisp/Visual Lisp/VBA Resource Website
Google
Search the WWW Search AfraLisp

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website