
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello folks,
Is it possible to get and use the name of selected external .dwg (not the current opened .dwg) to rename blocks and layers inside the current .dwg? For example, I would like to implement my current lisp for renaming 1 block and 2 layers:
(if (tblsearch "block" "B-IMP-")
(command ".-rename" "_b" "B-IMP-" "B-IMP-ACE-"
)
)
(if (tblsearch "layer" "0-IMP-")
(command ".-rename" "_la" "0-IMP-" "0-IMP-ACE-"
)
)
(if (tblsearch "layer" "0-IMP-HACHURAS")
(command ".-rename" "_la" "0-IMP-HATCHES" "0-IMP-ACE-HACHURAS"
)
)
This lisp just search for the block named "B-IMP" and for the layers named "0-IMP-" (wich constains all drawed geometry, texts, etc.) "0-IMP-HATCHES" (wich contains all drawed hatches) and replaces with "B-IMP-ACE-", "0-IMP-ACE" and "0-IMP-ACE-HATCHES" (where -ACE- is the discipline related to the project like -ARQ-, -TOPO- and so on), so the result of the renaming will be:
Block: "B-IMP-ACE-**"
Layer 1 (geometry): "0-IMP-ACE-**"
Layer 2 (hatches): "0-IMP-ACE-**-HATCHES"
Afterwards, I need to rename manually again the block and layers, placing the name of the .dwg project file, where is located the "**" above.
I would like to use an external .dwg file (selected by the user) to insert its name (without the ".dwg") automatically, resulting:
Block: B-IMP-ACE-**NAME OF THE SELECTED FILE**
Layer 1: 0-IMP-ACE-**NAME OF THE SELECTED FILE**
Layer 2: 0-IMP-ACE-**NAME OF THE SELECTED FILE**-HATCHES
How complex is to implement a LISP like that? Can't find any related discussion here in forum. Everybody just wants to get and use the current name of the filem wich can be done using (strcat (getvar "dwgprefix")(getvar "dwgname")).
Thanks a lot!
Solved! Go to Solution.