How to avoid "current viewport layout" when (ssget "a") in an empty layout space

How to avoid "current viewport layout" when (ssget "a") in an empty layout space

le-tan-phuc
Enthusiast Enthusiast
349 Views
4 Replies
Message 1 of 5

How to avoid "current viewport layout" when (ssget "a") in an empty layout space

le-tan-phuc
Enthusiast
Enthusiast

Hi, 
I have a problem when create a selection set with "ssget" in an empty  layout (have no visible object).
I think the selection set must be "nil" but it still exist an entity.


Command: (setq ss (ssget "a"))
<Selection set: c9>

Command: (entget (ssname ss 0))
((-1 . <Entity name: 185d50852b0>) (0 . "VIEWPORT") (5 . "2A3") (102 . "{ACAD_XDICTIONARY") ...

 

Some one please show me the way to not get this entity into selection set. thank you !
Sorry for my bad English

0 Likes
Accepted solutions (3)
350 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try this

(ssget "_X" '((0 . "VIEWPORT") (-4 . "<>") (69 . 1)))

0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

The "A" and "X" modes in (ssget) will still see other things in other Layouts and in Model space.  But if that's OK, and what you want is simply for it to not see any Viewports, you can forbid it to see them:

(setq ss (ssget "_A" '((0 . "~VIEWPORT"))))

Kent Cooper, AIA
0 Likes
Message 4 of 5

paullimapa
Mentor
Mentor
Accepted solution

in addition to @Kent1Cooper post, you may also want to include filter to look only in the current layout:

(setq ss(ssget "_X" (list '(0 . "~VIEWPORT") (cons 410 (getvar "ctab")))))

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 5

le-tan-phuc
Enthusiast
Enthusiast

Thanks for your help guys !
I found the solution to this problem.
From Vietnam, 8:20 AM-(UTC+07:00)

0 Likes