Print Page | Close Window

LISP to generate wire labels

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=13712
Printed Date: 08.Jul.2026 at 21:47


Topic: LISP to generate wire labels
Posted By: joeljbennett
Subject: LISP to generate wire labels
Date Posted: 28.May.2022 at 06:23
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 screenshot).

 

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/" rel="nofollow - 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" rel="nofollow - http://www.lee-mac.com/text2mtext.html

 

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








Replies:
Posted By: julecave
Date Posted: 17.Jul.2022 at 18:30

I’ve had great experiences with Brother printers and their P-Touch software. They had a template for network cables to go off of and you can import labeling number schemes from an excel sheet.

I had the same issue some months ago and couldn’t find a solution I was happy with. Now all cables in my network are fully documented and labeled. Best of luck!




Posted By: julecave
Date Posted: 18.Jul.2022 at 23:41
I had the same issue some months ago and couldn?t find a solution I was happy with. Now all cables in my network are fully documented and labeled. Best of luck!



https://tutuapp.uno/" rel="nofollow - https://tutuapp.uno/
https://9apps.ooo/" rel="nofollow - https://9apps.ooo/
https://showbox.kim/" rel="nofollow - https://showbox.kim/





Print Page | Close Window