ssget by spesific "y" coordinate

ssget by spesific "y" coordinate

aliozcicek
Contributor Contributor
1,005 Views
2 Replies
Message 1 of 3

ssget by spesific "y" coordinate

aliozcicek
Contributor
Contributor

hi everyone,

 

let me summary my aim,

there is a rectangle which I have corner coordinates. there is many block objects inside this rectangle. block name which I want are "ZDEE" and "ZDHH". problem is that I don't want some of "ZDEE" blocks in my selection set. 

I can make a selection set with below code but I can't use because of "ZDEE" blocks which I don't want.

(setq etr (ssget "_WP" ptlstkir (list (cons -4 "<OR") (cons 2 "ZDE*") (cons 2 "ZDH*") (cons -4 "OR>") )))

 

my questions,

-can I use specific "y" coordinate with ssget function ( I can use ZDHH's "y" coordinate)?

-can I use specific attribute value for my selection.  (I can use specific pose number (POZ1 (type: AcString) (LocalName: POZ1) = 4))

 

thanks in advance.

 

0 Likes
Accepted solutions (1)
1,006 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

You could probably exclude specific Y right away... Look HERE where is an example with CIRCLEs and specific Z coord... but this cannot be done with attributes anyway. These have to be filtered out afterwards... So here is the untested example of the later. (acad 2012+)

 

(if (setq ss (ssget "_WP" ptlstkir '((0 . "INSERT") (2 ."ZDH*,ZDE*"))))
    (repeat (setq i (sslength ss))
      (setq en (ssname ss (setq i (1- i))))
      (if (or (equal myY (caddr (assoc 10 (entget en))) 1e-6)
	      (= myValue (getpropertyvalue en "POZ1"))
	      )
	(ssdel en ss))))

Consider ZOOM to ptlstkir window before you do a selection. Or atleast zoom extents.

Message 3 of 3

dbhunia
Advisor
Advisor

@aliozcicek wrote:

hi everyone,

.......................

my questions,

-can I use specific "y" coordinate with ssget function ( I can use ZDHH's "y" coordinate)?

-can I use specific attribute value for my selection.  (I can use specific pose number (POZ1 (type: AcString) (LocalName: POZ1) = 4))

...................


(setq etr 
	(ssget "_WP" ptlstkir
		'(
			(-4 . "<OR")
				(-4 . "<AND") (0 . "INSERT") (2 . "ZDHH") (-4 . "AND>")
				;;; Select all "ZDHH" Blocks within "_WP"
				(-4 . "<AND") (0 . "INSERT") (2 . "ZDEE") (-4 . "*,/=,*") (10 0.0 Y.Y 0.0) (-4 . "AND>")
				;;; Select those "ZDEE" Blocks within "_WP" whose Y coordinate is not "Y.Y"
			(-4 . "OR>")
		)
	)
)

by above method you can filter out your selection set using Y-Coordinate

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....