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

Automated To/From Wire Label

0 REPLIES 0
Reply
Message 1 of 1
joel.bennettFVVY2
229 Views, 0 Replies

Automated To/From Wire Label

I could use some help with creating a LISP file to generate wire labels. Here is how I would like the program to work (see pic and attached sample dwg).

 

User loads and runs routine

1. User is prompted to SELECT 1ST blocktxt. Program extracts the first 8 characters from the model tag, it skips counting spaces. Or extract all characters up to the left bracket, which ever comes first. Then append a colon and space
2) Next the user is prompted to SELECT 1st text, which extracts the last digit or last two digits.  If there are no digits at the end of the string then extract the last word (eg OUT). Then append a line break
3) Then the user is prompted to SELECT 2nd blocktxt, program extracts the first 8 characters from the model tag, skip counting spaces. Or extract all characters up to the left bracket, which ever comes first. Then append a colon and space
4) Next the user is prompted to SELECT 2nd text, which extracts the last digit or last two digits.  If there are no digits at the end of the string then extract the last word (eg OUT).  
5) Allow user to place resulting mtext in the drawing on the Label layer

 

Here is the desired results on the Label layer from the drawing and pic below

 

DP DA 2: 1
TH-55CQE: 1

 

 

I found this LISP that extracts all text from multiple blocks and converts it to mtext.

https://autocadtips1.com/2011/04/26/autolisp-attribute-to-text-mtext/

 

And this LISP combines multiple selected text in to one mtext

 

http://www.lee-mac.com/text2mtext.html

 

I thought these  two LISPs might be helpful as a starting place.

 

 

cablelabelpic.JPG

0 REPLIES 0

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