Rename block on a horizontal or vertical line

Hans_Knol
Advocate
Advocate

Rename block on a horizontal or vertical line

Hans_Knol
Advocate
Advocate

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
0 Likes
Reply
Accepted solutions (1)
310 Views
5 Replies
Replies (5)

chriscowgill7373
Advisor
Advisor

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.

0 Likes

Hans_Knol
Advocate
Advocate

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
0 Likes

Kent1Cooper
Consultant
Consultant

@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
0 Likes

Moshe-A
Mentor
Mentor

@Hans_Knol  hi,

 

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

 

enjoy

Moshe

 

 

 

 

0 Likes

Moshe-A
Mentor
Mentor
Accepted solution

@Hans_Knol ,

 

fixed some bugs.

 

 

0 Likes