Jump to content

LISP to select Block by Name and place to Layer.


Recommended Posts

Posted

Hello.

 

This LISP selects all dimension and changes to layer "_DIM_"

 

(if (ssget "_X" '((0 . "DIMENSION")))
(command "._change" (ssget "_X" '((0 . "DIMENSION"))) "" "P" "LA" "_DIM_" "")
);if

 

I'm looking for similar to select block(s) by name and change layer. Appreciate any advice.

Posted (edited)

For blocks selection

(if (setq ss (ssget '((0 . "INSERT") (2 . "bik_BlkOpPret,bik_BlkOpPretU,bik_BlkOpPretW"))))

 

Where bik_Blk* are names od blocks. If You need blocks im all drawing use ssget _X as on Your post. More samples here.

http://www.lee-mac.com/ssget.html

 

 

 

Edited by zwonko
Posted

If you end up using the ssget "_X" option its a good idea to throw on the old 410 as well.

 

(if (setq ss (ssget '((0 . "INSERT") (2 . "block1,block2,block3") (410 . "Model"))))

 

410 = tab they are located on. can't change properties of a block on a different tab with (command "._change"

you would have to use visual lisp for that.

 

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...