Finding matching blocks coords between two sets.

Finding matching blocks coords between two sets.

mdhutchinson
Advisor Advisor
731 Views
1 Reply
Message 1 of 2

Finding matching blocks coords between two sets.

mdhutchinson
Advisor
Advisor

I have two sets of blocks each set being on their own layer.

The quantity of blocks in each set can be different.

I'm looping through one set/layer and using the following code to find the match on the other layer.

... oddly enough though the quantity of matches is coming up different depending on which set you start with.

(ignoring the elevation)

 

What would account for this? 

 

(setq ss (ssget	"X"
                  (list	 (cons -4 "<and")
                         (cons 0 "INSERT")
                         (cons 66 1)
                         (cons 2 (strcat "LocationPoint" ",`*U*"))
                         (cons 8 Layer)
                         (cons -4 ">,>,*")
                         (cons 10 PntBtmSeachBox)
                         (cons -4 "<,<,*")
                         (cons 10 PntTopSeachBox)
                         (cons -4 "and>")
                    )
                )
)
0 Likes
732 Views
1 Reply
Reply (1)
Message 2 of 2

pbejse
Mentor
Mentor

@mdhutchinson wrote:

 

... oddly enough though the quantity of matches is coming up different depending on which set you start with.

(ignoring the elevation)

 

What would account for this? 

 


Only thing i can think of that will result to a varying quantiy is this line

 

 

 

(cons 2 (strcat "LocationPoint" ",`*U*"))

 

Surely you dont expect to filter Blocks with "LocationPoint" name just by supplying the wildcard ",`*U*" from a call from SSGET alone.

 

say  (_SELECT "Banana" p1 p2) 

 

"Banana" as layer

p1 as PntBtmSeachBox (5337.0 1122.76 0.0)

p2 as PntTopSeachBox (10337.6 5575.14 0.0)

 

An attributed block under "Banana" layer with coordinates  (7186.65 3061.38 0.0) will be included on the SS selection set even though the name of the block is not "LocationPoint".

 

The intruder block maybe named as  "StartPoint" but with an anonymous name of "*U61". it will still be included on the selection, of course you have to iterate thru SS selection sets first to remove non block named conforming blocks.

 

But i'm sure you already know that 😄

 

Other than that, i'm fresh out of ideas

 

HTH

 

 

 

0 Likes