Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

paperspace selection sets

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
561 Views, 10 Replies

paperspace selection sets

I wish to collect a selection set of blocks in paperspace of a certain name.
For model space I would use the following line:

(setq x1 (ssget "_x" '((2 . "*etc*") (410 . "model"))))

I am stumped when it comes to setting paperspace as the 410 ssget list value
as the name can be modified and I need it to work in all drawings. I tried
setting a variable to the paperspace layout name and using a print function
at the (410 . "model") point but without sucess. I was wondering if someone
can point me in the right direction

Many thanks.

Drew Jarvis
ACDP
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

Assuming the variable myLayout contains the name of the layout you are
filtering for:
(setq x1 (ssget "_x" (list (2 . "*etc*") (cons 410 myLayout)))))

check my parens...I didn't test...
--
Bobby C. Jones
http://www.acadx.com
Message 3 of 11
Anonymous
in reply to: Anonymous

(cons 410 myLayout)

Thanks

Drew Jarvis


"Bobby C. Jones" wrote in message
news:52E9F3371B88E76896D632A7205C8080@in.WebX.maYIadrTaRb...
> Assuming the variable myLayout contains the name of the layout you are
> filtering for:
> (setq x1 (ssget "_x" (list (2 . "*etc*") (cons 410 myLayout)))))
>
> check my parens...I didn't test...
> --
> Bobby C. Jones
> http://www.acadx.com
>
>
>
Message 4 of 11
Anonymous
in reply to: Anonymous

Cliff, *DON'T* try this in VBA 🙂 selection set filters in VBA don't allow
filtering on the 410 group...
--
Bobby C. Jones
http://www.acadx.com
Message 5 of 11
Anonymous
in reply to: Anonymous

>(setq x1 (ssget "_x" (list (2 . "*etc*") (cons 410 myLayout))))

Don't you need to quote the (2 . "*etc*")?

(setq x1 (ssget "_x" (list '(2 . "*etc*") (cons 410 myLayout))))

-Jason



"Bobby C. Jones" wrote in message
news:52E9F3371B88E76896D632A7205C8080@in.WebX.maYIadrTaRb...
> Assuming the variable myLayout contains the name of the layout you are
> filtering for:
> (setq x1 (ssget "_x" (list (2 . "*etc*") (cons 410 myLayout)))))
>
> check my parens...I didn't test...
> --
> Bobby C. Jones
> http://www.acadx.com
>
>
>
Message 6 of 11
Anonymous
in reply to: Anonymous

I should have said check *everything*...I didn't test nothing 🙂
Thanks Jason
--
Bobby C. Jones
http://www.acadx.com
Message 7 of 11
Anonymous
in reply to: Anonymous

(ssget "x" '((0 . "insert")(2 . "*etc*")(410 . "~Model")))
___

"Drew Jarvis" wrote in message
news:84DAE30CE893CB244CDB7D8517FB9E75@in.WebX.maYIadrTaRb...
>
> I wish to collect a selection set of blocks in paperspace of a certain
name.
Message 8 of 11
Anonymous
in reply to: Anonymous

Using (410 . "~tabname") works, but you can just as easily
use the 67 group, which can be more "efficient".

(ssget "x" '(.... (67 . 1))) ;; 1 = Paper space only

(ssget "x" '(.... (67 . 0))) ;; 0 = Model space only


"Drew Jarvis" wrote in message
news:84DAE30CE893CB244CDB7D8517FB9E75@in.WebX.maYIadrTaRb...
>
> I wish to collect a selection set of blocks in paperspace of a certain
name.
> For model space I would use the following line:
>
> (setq x1 (ssget "_x" '((2 . "*etc*") (410 . "model"))))
>
> I am stumped when it comes to setting paperspace as the 410 ssget list
value
> as the name can be modified and I need it to work in all drawings. I tried
> setting a variable to the paperspace layout name and using a print
function
> at the (410 . "model") point but without sucess. I was wondering if
someone
> can point me in the right direction
>
> Many thanks.
>
> Drew Jarvis
> ACDP
>
>
Message 9 of 11
msarqui
in reply to: Anonymous

And how to make the selection set for both model and paper space in the same routine?

Ex.: How to select all hacths in model and paper space?

Message 10 of 11
Kent1Cooper
in reply to: msarqui


@msarqui wrote:

And how to make the selection set for both model and paper space in the same routine?

Ex.: How to select all hacths in model and paper space?


You can make a selection set [in AutoLISP terms] of all Hatch patterns in model and paper space easily enough, with:
(ssget "_X" '((0 . "HATCH")))

But you can't have an AutoCAD command "select" and do something with those that are not in the current space.  [See the hatch-to-back thread for a workaround, unless you're asking this for some different reason.]

Kent Cooper, AIA
Message 11 of 11
msarqui
in reply to: Kent1Cooper

Hi Kent,

 

You answered my question 🙂

I will try to find another way.

 

Thanks!

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost