jjben Posted May 30, 2022 Share Posted May 30, 2022 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 and 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. cadsample (1).dwg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.