I cannot restrict the selection to exactly crossed entities using ssget "c"

I cannot restrict the selection to exactly crossed entities using ssget "c"

Anonymous
Not applicable
2,210 Views
29 Replies
Message 1 of 30

I cannot restrict the selection to exactly crossed entities using ssget "c"

Anonymous
Not applicable

When using:

 

(ssget "c" (polar Entity_Insert_Point 1.58825 9)(polar Entity_Insert_Point 1.55334 9)(list (cons 0 "LWPOLYLINE") (CONS 8 "GT_2") (CONS 43 0.25)))

 

If the area is zoomed to the selection, works as expected, nil in this case. If zoomed to extents, close entities are selected in error. I am sure there is a variable to restrict this behaviour, just not sure which one.

 

Help appreciated.

 

 

0 Likes
Accepted solutions (2)
2,211 Views
29 Replies
Replies (29)
Message 21 of 30

DannyNL
Advisor
Advisor

Aah....my mistake.

In the pre-processing dwg, the coordinate relates to the section.bubble. I'll check and come back.

0 Likes
Message 22 of 30

hak_vz
Advisor
Advisor

Sorry, my error. Points creating fence should be element of a list. It works with my old version of so it must be supported.

 

(ssget "F" (list (polar Entity_Insert_Point 1.58825 9)(polar Entity_Insert_Point 1.55334 9))(list (cons 0 "LWPOLYLINE") ) (CONS 8 "GT_2") (CONS 43 0.25))

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 23 of 30

DannyNL
Advisor
Advisor

OK, I've looked at the coordinate and the calculated polar points.

 

Your insertion point is located at the red arrow and the calculated polar points are the yellow line within the red rectangle. As you can see these do not intersect the arced polyline and therefore it will not be selected.

 

2018-03-13_15-10-26.jpg

 

If you only want to select the arced polyline, you'll need to calculate points that will intersect the object. Your SSGET already contains a filter on LWPOLYLINE, so other types will not be selected. And if you want to make sure the selected LWPOLYLINE is arced and not straight, you can add an additional filter with code 42 is not equal to 0.0 to your SSGET.

 

Example below. The crossing will be made from the insertion point straight up 9mm.

 

(setq Entity_Insert_Point '(220.537 72.148 0.0))
(setq tst (ssget "c" Entity_Insert_Point (polar Entity_Insert_Point 1.5708 9) '((0 . "LWPOLYLINE")(8 . "GT_2")(43 . 0.25)(-4 . "<>")(42 . 0.0))))

 

0 Likes
Message 24 of 30

hak_vz
Advisor
Advisor

(ssget "F" (list (polar Entity_Insert_Point 1.58825 9)(polar Entity_Insert_Point 1.55334 9)(list (cons 0 "LWPOLYLINE") ) (CONS 8 "GT_2") (CONS 43 0.25)))

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 25 of 30

DannyNL
Advisor
Advisor

Well, almost OK, but it should be:

 

(ssget "F" (list (polar Entity_Insert_Point 1.58825 9)(polar Entity_Insert_Point 1.55334 9)) (list (cons 0 "LWPOLYLINE")(CONS 8 "GT_2") (CONS 43 0.25)))

But if the calculated fence points don't intersect the polyline, it still won't be selected.

 

 

0 Likes
Message 26 of 30

Anonymous
Not applicable

The polyline arc should not be selected, when the drawing is zoomed to its extents, it is added to the selection set erroneously.

 

A similar check is run for right, up, left and down to establish which block to insert.

0 Likes
Message 27 of 30

DannyNL
Advisor
Advisor
Accepted solution

OK, now I know what to look for and can confirm with crossing the behavior is strange by selecting the arced polyline when zoomed to extents Smiley Happy

 

And in that case you can use fence as suggested by @hak_vz

 

Difference between crossing and fence is that crossing will create a selection rectangle, while fence will use a selection line and therefore is more precise. Although I'm not sure why crossing in this case doesn't work as the selection rectangle shouldn't touch the arced polyline. But fence in this case does work.

 

(setq Entity_Insert_Point '(220.537 72.148 0.0))
(ssget "F" (list (polar Entity_Insert_Point 1.58825 9)(polar Entity_Insert_Point 1.55334 9)) '((0 . "LWPOLYLINE")(8 . "GT_2")(43 . 0.25)))
0 Likes
Message 28 of 30

hak_vz
Advisor
Advisor
Accepted solution

Shouldn't it be

 

(ssget "F" 
(list (polar Entity_Insert_Point 1.58825 9)(polar Entity_Insert_Point 1.55334 9))
(list
(cons -4 "<and")
(CONS 0 "LWPOLYLINE")
(CONS 8 "GT_2")
(CONS 43 0.25)
(cons -4 "and>")
)
)

In case when all additional criteria apply boolean selector could be omitted?

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 29 of 30

DannyNL
Advisor
Advisor

Yes, the AND operator is default and can be omitted in this case.

Message 30 of 30

Anonymous
Not applicable

Thank you Guy's, I'd forgotten fences were even a selection option within AutoCAD Smiley Embarassed This has cured the problem, I have a fair amount of back tracking to do.

 

It would still be nice to know why crossing has an aura that selects entities that shouldn't be selected though!

 

Thanks again,

 

owe you a beer!