How do you select both "L" & "P" with SSGET?

Status
Not open for further replies.

abevlad

Usenet Archive
Joined
Aug 20, 2001
Messages
37
Reaction score
0
How do you select both "L" & "P" with SSGET?

I tried to use (ssget "L" "P") but it gave me an error.
 
Obviously

(PROGN (SSGET "P") (SSGET "L"))

will do it. But you want to put it into a selection set I guess. So I suggest to do a

(PROGN
(SETQ ss (SSGET "P"))
(SSADD (ENTLAST) ss)
)

The (ENTLAST) should return the entity that (SSGET "L") would select.

hth,
Stephan

NB: Good practice to set ss to NIL after use.

On Tue, 15 Jan 2002 11:16:09 -0500, "abevlad"
wrote:

How do you select both "L" & "P" with SSGET?

I tried to use (ssget "L" "P") but it gave me an error.
 
(ssget) accepts only a single mode string, and L and P can't be combined. Tell us what you need to do, and perhaps someone will give you alternative code.

One kludge would be to use:

(command "_.select" "_l" "_p" "")
(setq ss (ssget "p"))
___

"abevlad" wrote:

How do you select both "L" & "P" with SSGET?

I tried to use (ssget "L" "P") but it gave me an error.
 
Another way:

(setq ss (ssget "P")
ss (ssadd (entlast) ss)
)
___

"abevlad" wrote:

How do you select both "L" & "P" with SSGET?

I tried to use (ssget "L" "P") but it gave me an error.
 
Er, no. See comments below.
___
"Stephan Haugh" wrote:

(PROGN (SSGET "P") (SSGET "L"))

This creates two selection sets, not one.

will do it. But you want to put it into a selection set I guess. So I suggest to do a

(PROGN
(SETQ ss (SSGET "P"))
(SSADD (ENTLAST) ss)
)

The result of this is that ss contains the Previous object(s), and while (ssadd (entlast) ss) will return a selection containing Last and Previous, the selection set *ss* is not updated and still contains only the Previous object(s). The (progn ...) is redundant.

To create a selection set ss that contains both, you need to use something like:
(setq ss (ssget "P")
ss (ssadd (entlast) ss)
) ;; setq
 
Stephan,

I see Paul's last post is about identical to yours.

He was right your 'progn' was not needed, but the way you used ssadd was fine, ssadd does indeed update the set ss, no need to do the setq.

Carl

"Paul Turvill" wrote:
Another way:

(setq ss (ssget "P")
ss (ssadd (entlast) ss)
)
___

"abevlad" wrote:

> How do you select both "L" & "P" with SSGET?
>
> I tried to use (ssget "L" "P") but it gave me an error.
 
Status
Not open for further replies.

Latest threads

Back
Top