Jump to content

Programmatically Rename Block with Autolisp - Help required.


korberrr

Recommended Posts

Quick Background - I am so close to finishing my routine that will mass update our title block drawings from old company to new company. However in our mass library of drawings consist different title blocks names. Luckily they all touch the corner 0,0 so what I want to do is update this piece of code shown below to instead of asking the user to select the block is to programmatically select what ever is on 0,0.

 

In autocad I can enter at the command line (entsel) then 0,0 and it selects the title block, but I cant re-create this in Autolisp. Any help would be greatly appreciated!

 

(setq name (cdr (assoc 2 (entget (car (entsel "\nSelect Block for name swap:"))))))

(command "-rename" "block" name "borderd")

 

This code sets a variable name to whatever the title block name is so that I can run Rename and change the block from what ever it is to something that I can control. The idea of changing it to something that I know is so that I can use Blockreplace.

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