Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename block on a horizontal or vertical line

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Hans_Knol
308 Views, 5 Replies

Rename block on a horizontal or vertical line

Hi all,

 

In my drawings that must be converted I have a lot blocks with the name "~MARK", those blocks are on vertical lines and also on horizontal lines.

In AutoCAD Electrical you have a vertical block for a wire number, named WD_WNV and a horizontal block WD_WNH. 

does some know how to rename the blocks using Lisp, so looking to the line and scan if there is an block named "~MARK" on the line and change the name to "WD_WNV" or "WD_WNH"

Hans Knol
5 REPLIES 5
Message 2 of 6

I dont know how you would determine if the block is on a horizontal vs vertical line.

Renaming a block renames the block, if they are all named ~MARK they will all get renamed.

It sounds like you would need to swap out the vertical so they can be differentiated, then finish up the rename.

Do you have some pictures or example files? 


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2022 on Windows 10

Please select the Accept as Solution button if my post solves your issue or answers your question.

Message 3 of 6

2023-06-08_14-24-28.png

 

The codes BK.1124 is on a vertical line ad RD.1018 on a horizontal line

Hans Knol
Message 4 of 6
Kent1Cooper
in reply to: Hans_Knol


@Hans_Knol wrote:

The codes BK.1124 is on a vertical line ad RD.1018 on a horizontal line


The fact that they are not actually on, but only near, the Lines in question makes it a lot more difficult to see how to do what you want.  But could the vertical/horizontal determination just be made from their rotation angles, forgetting about nearby Lines?

Kent Cooper, AIA
Message 5 of 6
Moshe-A
in reply to: Hans_Knol

@Hans_Knol  hi,

 

check this BLKSWP command. this could not be done without (LM:CopyBlockDefinition) by great Lee Mac - thank you Lee.

 

enjoy

Moshe

 

 

 

 

Message 6 of 6
Moshe-A
in reply to: Hans_Knol

@Hans_Knol ,

 

fixed some bugs.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report