Jump to content

How to select the blocks only in current space (either model or paper space)


muthu123

Recommended Posts

Dear friends,

 

If i used "all" in ssget fucntion as follows, it will return all the blocks including model space and paper space. But how can i use the filter to select only in current active space.

 

 (Setq ss (ssget "all"
               (list (cons 0 "INSERT") (cons 2 "A1_TITLE_BLOCK") (cons 66 1))
        )
)

Link to comment
Share on other sites

We have found the way to solve that by following code

(Setq ss (ssget "all"
               (list (cons 0 "INSERT") (cons 2 "A1_TITLE_BLOCK") (cons 66 1) (cons 410 (getvar "ctab")))
        )
)

Link to comment
Share on other sites

Here it is ...... :)

 

(Setq ss (ssget "_x"
               (list (cons 0 "INSERT") (cons 2 "A1_TITLE_BLOCK") (cons 66 1) (cons 410 (getvar "ctab")))
        )

)

 

Michaels

Link to comment
Share on other sites

  • 7 months later...

Hi all

 

Ran across this post looking for "how to select all object in current layout"

 

What does the (cons 66 1) do?

 

I found the DXF code in help menu under "Group Code in Numerical Order"

 

(Group Code 66 "Entities follow" flag (fixed)) I am not sure what this means and where did the 1 come from.

 

Thanks

Link to comment
Share on other sites

Hi all

 

Ran across this post looking for "how to select all object in current layout"

 

What does the (cons 66 1) do?

only selects blocks with attributes.

Link to comment
Share on other sites

Thanks

 

I guess my process should have been: Look to see what is being selected (cons 0 "INSERT")

then I should have gone to INSERT and looked at the DXF codes there to find my answer.

 

Sometimes I have the hardest time finding my way around

 

Another question since I am here:

The OP use (cons 410) to get string for (getvar "ctab")

 

This 410 is not part of the "insert" DXF code that I can see, why use 410? I also see 410-419, 430-439 and 470-479

 

What is the difference and how would I know to use which one?

Link to comment
Share on other sites

Try:

(cons 410
      (if (eq 1 (getvar 'CVPORT))
        (getvar 'CTAB)
        "Model"
      )
)

 

... Why not just:

 

(cons 410 (getvar 'ctab))

 

...?

 

Another question since I am here:

The OP use (cons 410) to get string for (getvar "ctab")

 

This 410 is not part of the "insert" DXF code that I can see, why use 410? I also see 410-419, 430-439 and 470-479

 

What is the difference and how would I know to use which one?

 

Developer Help >> DXF Reference >> ENTITIES >> Common Group Codes for Entities >> DXF code 410

;)

Link to comment
Share on other sites

Guest kruuger
... Why not just:

 

(cons 410 (getvar 'ctab))

because then we got incorrect info about layout when we in "model" but thru viewport

k.

 

EDIT: i'm to slow :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...