cedwards Posted August 26, 2009 Share Posted August 26, 2009 I was wondering if anyone has/or would like to make a lisp that copy's and increments text. I would like the lisp to work like this: 1.) Select text to copy 2.) Do you want to copy and increment or just copy(I/C) 3.) Copy and increment selected text or just copy text to users selected location 4.) Keep coping text to users selected location until user keys increment(I) 5.) When the user keys increment - Increment text and copy to user selected location. Keep repeating steps 4 & 5 until user cancels function. I would like the increment between numbers set to 2. Any help would be greatly appreciated. I have tried the tcount command from the express menu and that is not want I'm needing. Thanks, Chris Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 26, 2009 Share Posted August 26, 2009 Have you checked out the LISPs in here? http://www.cadtutor.net/forum/forumdisplay.php?f=30 Quote Link to comment Share on other sites More sharing options...
cedwards Posted August 26, 2009 Author Share Posted August 26, 2009 I have checked out the lisp there. They work nice but my problem with them is that I can't tell it when to increment. For example lets say I want to copy LP-1. I would like to be able to select it then copy it to like 3 locations then with the test to selected tell it to increment and then copy the incremented text to like 3 locations, etc. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 26, 2009 Share Posted August 26, 2009 Yes, you should be able to toggle the counter in the Incremental Numbering Suite. Quote Link to comment Share on other sites More sharing options...
cedwards Posted August 26, 2009 Author Share Posted August 26, 2009 Yes I can toggle the counter but the counter number is not a set number. I would also like to be able the select the text that needs to be increment instead of typing it in the dialog box. Quote Link to comment Share on other sites More sharing options...
K Baden Posted October 4, 2017 Share Posted October 4, 2017 Hello all! I realize this is quite old, but it is the closest I've found to what I am looking for. Lee Mac, In your incremental text tool (which is obviously an amazing piece of work) is there a way to basically just predefine all of those things within the code so that I can utilize the dynamic placement that you show for this tool? the application I will be using this for is basically this, I need something that will start at the letter "A" and go up to a possibility of "Z". As you can see, your tool is a bit overwhelming for the task at hand for me. I am basically looking for a way to trim it down to just type the command say, "ANTXT" have a predefined style (i will include below) and just immediately be able to click each point to place A, B, C... and so on until the command is finished by hitting Enter. The predefined text properties would be as such (not MText, Must be just Text): Color: ByBlock Layer: _NonPlot Style: ROMANS Justify: Middle Center Height: 1/2" while the justification is set to middle center, i would like them to insert according to the bottom left vertex that typically appears with Text objects. Is this at all possible? is there an easy way to take from your tool to be able to accomplish this? I have had pretty much no luck in finding any other LISP that meet this need without it being a larger more intensive program. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 4, 2017 Share Posted October 4, 2017 Here's a quickie without the layer set to noplot: (defun c:foo (/ p) (or *lastchar* (setq *lastchar* (ascii "A"))) (while (setq p (getpoint "\nPick a point to place text: ")) (progn (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") (cons 8 "text") '(100 . "AcDbText") (cons 10 p) '(40 . 0.5) (cons 1 (chr *lastchar*)) '(50 . 0.0) (cons 7 (if (tblobjname "Style" "Romans") "Romans" "Standard" ) ) '(72 . 1) (cons 11 p) '(73 . 2) ) ) (setq *lastchar* (setq *lastchar* (1+ *lastchar*))) (and (> *lastchar* 90) (setq *lastchar* 65)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
K Baden Posted October 5, 2017 Share Posted October 5, 2017 Wow thank you so much!! This is awesome. Is there any way to get it to reset once the command is finished? It seems when I do the command once, and i have to maybe do it again, it starts on the last letter from the previous use of the command. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 5, 2017 Share Posted October 5, 2017 Just change: (or *lastchar* (setq *lastchar* (ascii "A"))) to (setq *lastchar* (ascii "A")) Quote Link to comment Share on other sites More sharing options...
K Baden Posted October 5, 2017 Share Posted October 5, 2017 That is perfect. Thank you so much! Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 5, 2017 Share Posted October 5, 2017 That is perfect. Thank you so much! Glad to help .. since you don't want the program to remember the last letter you could localize the *lastchar* variable like so: (defun c:foo (/ *lastchar* p) ... 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.