jda823 Posted December 3, 2010 Share Posted December 3, 2010 I am looking for a way to extract a substring of text in string of attributed text to be used as a variable so that it can be later reinserted into different parts of the drawing or used to create new layers. Basically, I have a part description followed by a part number in parentheses. The part number is generally an 8 digit number, but sometimes has a -1 or -2 at the end. I have gotten as far as extracting the values of the attributed text to variables, but am not sure the best way to search for a specific part of them. What is the best way to go about this? Would I want to search for the location of the first open parentheses and then the location of the close parentheses in the string and extract the text in between? Is there a better way? I am somewhat new to Autolisp and most VBA stuff is over my head at this point. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 3, 2010 Share Posted December 3, 2010 Welcome to CADTutor! substr is the function you should read about Also, take a look into vl-string-search or vl-string-position Lee EDIT: This will help you get help on the functions Also, I recommend read this if you aren't already using the VLIDE to write LISP 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.