- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to select entities of specified type at specified area to get selected. I use
(ssget "_C" pt1 pt2 filer)
it works only if entities are visible on screen. If entity is not visible on screen (because it is outside visible area on screen) it will not be selected.
_X selects all entities in database, but don't take points.
Details:
I have drawing with many blocks in big area and I need to take only one block at some coordinate (if block exist here). So I made function for this:
; Finds blocks of name blockName in specifiend coordinates and returns they handls.
; coordinates - [list] List of coordinates. ( (x0 y0) (x1 y1) ... (xn yn) )
; P.S. can have zn, but it will not be used.
; blockName - [str] Name of block to find.
; Returns [list] List of block handls. (handl0 handl1 ... handln)
(defun DA:GetBlocksHandl (coordinates blockName / point handl listOfHandls filter ss)
(setq
listOfHandls (list)
filter (list '(0 . "INSERT") '(410 . "Model") (cons 2 blockName))
)
(foreach point coordinates
(if (setq ss (ssget "_C" (list (- (car point) 0.1) (- (cadr point) 0.1)) (list (+ (car point) 0.1) (+ (cadr point) 0.1)) filter))
(setq listOfHandls (cons (cdr (assoc 5 (entget (ssname ss 0)))) listOfHandls))
)
)
(reverse listOfHandls)
)
but it does not select blocks if they are not in visible area on screen. Is here other mods for ssget to make it work or is here different function to select one block of specified name at specified point (if it exist here)?
Solved! Go to Solution.
Link copied