Automated Selection Mode String for All Locked Entities using SSGET

Automated Selection Mode String for All Locked Entities using SSGET

Anonymous
Not applicable
1,145 Views
3 Replies
Message 1 of 4

Automated Selection Mode String for All Locked Entities using SSGET

Anonymous
Not applicable

I'm having some difficulties getting exactly what I want out of SSGET. Given a drawing, I want to make a selection set of all entities not on a locked layer or frozen without user input. Now, I can select all non-frozen entities with:

(ssget "x")

 and I can ask the user to select unlocked entities with:

(ssget ":L")

but I can't do both. I could just get all entities with the "x" argument and filter out the locked ones with a few extra lines of code, but it seems like there should already be some selection mode string that does exactly that. Some strings can be combined. For example, "_+.:E:S" is a valid selection method. You would think that there would be a valid string like "x:L".

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

hmsilva
Mentor
Mentor
Accepted solution

@Anonymous wrote:

I'm having some difficulties getting exactly what I want out of SSGET. Given a drawing, I want to make a selection set of all entities not on a locked layer or frozen without user input. Now, I can select all non-frozen entities with:

(ssget "x")

 and I can ask the user to select unlocked entities with:

(ssget ":L")

but I can't do both. I could just get all entities with the "x" argument and filter out the locked ones with a few extra lines of code, but it seems like there should already be some selection mode string that does exactly that. Some strings can be combined. For example, "_+.:E:S" is a valid selection method. You would think that there would be a valid string like "x:L".


Hi Shaun,

Unfortunately no...

 

If you have express,

 

(if (not ai_ssget) (load "ai_utils"))
(if (setq ss (ssget "_X"))(setq ss (ai_ssget ss)))

do a search and you'll find some functions to reject objects with locked layers.

 

 

And to reject objects with frozen layers is not the mode "_X" is the mode "_A", "_X" will select all objects in database...

 

Hope this helps,
Henrique

EESignature

Message 3 of 4

Anonymous
Not applicable

Very interesting, hmsilva. I did not even know these functions existed. After reading through the source code of ai_utils, ai_ssget is definitely exactly what I need. Still, it would be nice if SSGET just accepted ":L" as a modifier in a string by default.

0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

@Anonymous wrote:

Very interesting, hmsilva. I did not even know these functions existed. After reading through the source code of ai_utils, ai_ssget is definitely exactly what I need. Still, it would be nice if SSGET just accepted ":L" as a modifier in a string by default.


Yes, it would be nice...

 

Henrique

EESignature

0 Likes