Jump to content

RBL.lsp - Rename Blocks and Layers


Recommended Posts

Posted (edited)

Hi all,

 

I just wrote my first DCL program.

 

It's a renamer for blocks and layers. It has a block walk function to zoom into the block to be renamed from the selection, and the layers are highlighted when picked in the edit box.

 

The rename dialog in ACAD hasn't been touched since I started using it in 2004 so I think this will help identify and rename Blocks and Layers much better.

 

There is a bug whereby if something has been renamed, the zoom to block or highlighting of objects doesn't work.

I'll try to fix the bug when I get some spare time.

Fixed in v1.01 below.

 

Thoughts on this and improvements are welcome.

 

UI.png

3dwannab_Rename_Blocks_and_Layers.lsp 3dwannab_Rename_Blocks_and_Layers.dcl

Edited by 3dwannab
  • Like 3
Posted (edited)

This is neat and useful, and seems to work fine, but in my case, all block names are unique numbers based on drawing name (no two are identical).

Is there an easy way to adapt this program to ask for a TAG, and have the program list the tag values instead of the block names?

All blocks have the same tags, but custom value entries.

This would make incorrect tag value entries easy to spot and correct with your program.

 

Steve

Edited by StevJ
Posted
On 11/18/2024 at 3:13 AM, StevJ said:

This is neat and useful, and seems to work fine, but in my case, all block names are unique numbers based on drawing name (no two are identical).

Is there an easy way to adapt this program to ask for a TAG, and have the program list the tag values instead of the block names?

All blocks have the same tags, but custom value entries.

This would make incorrect tag value entries easy to spot and correct with your program.

 

Steve

 

I think this is what you're after.

 

https://lee-mac.com/batte.html

Posted

Thanks for the link. I did try to make it work as I wanted, but that program is not as easy to navigate as yours. The linked program's editable items are not grouped and are in a window whose size cannot be changed.

Your program would be the very thing for my QA needs if it presented a list of a certain tag's value for edit from all blocks instead of the block names.

 

Thanks anyway,

Steve

Posted (edited)

@StevJ, it's sort of beyond the scope of this program. I wrote it to learn how to make programs with DCLs' more or less but has been very useful today at work. You can change the height of that programs UI too. Open the lisp and search for the height property for that listbox I'd say and change that to your needs. The DCL code is hardcoded into the .lsp file with that one. Something I didn't bother to do with this. (Lazy).

 

I've fixed the issue of the blocks and layers not getting selected or highlighted with the help from @pkenewell for that, see post here.

 

Attached is the fixed version.

 

REVISION HISTORY:
2024.11.17 - v1.0  - First release
2024.11.19 - v1.01 - Layers and blocks can now be renamed without the loss of highlighting or
                     selection issues present in the previous version. Thanks pkenewell on CAD Tutors.
                   - Better handling of the buttons in the UI. Disabling / enabling / focusing them where required.

 

 

 

3dwannab_Rename_Blocks_and_Layers.lsp

3dwannab_Rename_Blocks_and_Layers.dcl

Edited by 3dwannab
  • Like 1
Posted

Thanks for the info. I'll go fiddle some with the batte.lsp.

Nice update to your program.

It ignored me when I tested the possibility of renaming a layer or blockname to one that already existed but wasn't listed. Seems "sailor-proof."

 

Steve

  • Like 1

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