Jump to content

how do you select a block by name?


designerstuart

Recommended Posts

On 2/1/2024 at 4:59 PM, BIGAL said:

Remove the select bname line and add your block name "asdf" where bname exists in the ssget and all done, rename the defun to something more useful.

(defun c:eblk ( / Block_name ss)
(setq ss (ssget "Block_name" '((0 . "INSERT")(cons 2 Block_name))))
(command "erase" ss "")
(princ)
)

I think I'm close with the attached code but its not quite there. If someone could explain what I'm doing wrong, I would appreciate it.

Link to comment
Share on other sites

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • designerstuart

    7

  • BIGAL

    3

  • ScribbleJ

    3

  • CADEveryDay

    3

(defun c:eblk (Block_name / ss)
(setq ss (ssget "X" '((0 . "INSERT")(cons 2 Block_name)))
or

(setq ss (ssget "X" '((0 . "INSERT")(cons 2 Block_name)(cons 410 (getvar 'ctab))) ; current space only

 

Edited by BIGAL
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...