gS7 Posted May 24, 2012 Share Posted May 24, 2012 Hi all !!! Guys Please Tel me How To Increment Numbers .......... 1.Starting No. (Example:2 is Stating No) 2.Increment No(Example :2 Is Increment) 3.when i click to a text it Should Change Text Value 4 while 6,8,10,12,14.................... Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 24, 2012 Share Posted May 24, 2012 I think you would learn a great deal about incrementing numbers if you were to take a look at Lee Mac's Incremental Numbering Suite lisp routine which can be found here... http://lee-mac.com/lisp/NumIncV3-2.lsp If you have further questions you can always come back here and ask. Lee or one of the other lisp masters will gladly assist you. Quote Link to comment Share on other sites More sharing options...
pBe Posted May 24, 2012 Share Posted May 24, 2012 (edited) Quick demo, Not a great deal, but its a start (defun c:demo (/ _def obj) (vl-load-com) [b][color=blue](defun _def (msg def) (setq def (cond ((getint (strcat msg (if def (strcat " <" (itoa def) ">: ") ": ") ))) ( def )))) [/color][/b] (setq startNumber [color=blue][b](_def "\nStart Nummber: " startNumber)[/b][/color]) (setq IncrementNumber [b][color=blue](_def "\nIncrement Nummber: " IncrementNumber)[/color][/b]) (while (setq obj (ssget "_+.:S:E:L" '((0 . "*TEXT")))) (vla-put-textstring (vlax-ename->vla-object (ssname obj 0)) startNumber) (setq startNumber (+ startNumber IncrementNumber)) ) (princ) ) Edited May 24, 2012 by pBe add default value Quote Link to comment Share on other sites More sharing options...
gS7 Posted May 24, 2012 Author Share Posted May 24, 2012 Great...!!!!! pBe .....i Got what i exactly needed ........ ok tell me How to to put Next Increment Value in to Users1 or Users2 ....... display next text value in selection line (sorry for my poor english ) Quote Link to comment Share on other sites More sharing options...
pBe Posted May 24, 2012 Share Posted May 24, 2012 You are welcome gs7 Why do you need the value assinged to USERS1? I assume its for the just "display"? does that mean everytime you pick you want to be able to see whats the next increment? Or are you pertaining to "Default value" to show the last number the nex time you use the routine? BTW: Welcome to CADTutor Quote Link to comment Share on other sites More sharing options...
gS7 Posted May 24, 2012 Author Share Posted May 24, 2012 Or are you pertaining to "Default value" to show the last number the nex time you use the routine? yes exactly right pBe ..... i wnt to do like that only Quote Link to comment Share on other sites More sharing options...
pBe Posted May 24, 2012 Share Posted May 24, 2012 What about teaching you how to "bake" Prompting with a Default Option by LeeMac CODE UPDATED Quote Link to comment Share on other sites More sharing options...
gS7 Posted May 24, 2012 Author Share Posted May 24, 2012 Wow !! its working nicely ...... Tank u pBe ........ :D Quote Link to comment Share on other sites More sharing options...
pBe Posted May 25, 2012 Share Posted May 25, 2012 Wow !! its working nicely ......Tank u pBe ........ You are Welcome gS7, hope you will learn a bit from that code. Cheers Quote Link to comment Share on other sites More sharing options...
nukecad Posted May 25, 2012 Share Posted May 25, 2012 For anyone who is using LT and so can't use lisp try these- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Put the following string on a user defined menu button. *^C^C_text;\;;$M=$(+,$(getvar,USERI1),1);setvar;US ERI1;$M=$(+,$(getvar,USERI1),1); This puts a new text with an incremented value on the drawing with each click of your mouse. You can also use SETVAR to change USERI1 to 1 below whatever initial value you want. Many thanks to ZOOMHARIS on the AUGI forum. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AND this one increments text that is already on the drawing *^C^C_.Change;\;;;;;;$M=$(getvar,USERI1);_.Setvar; USERI1;$(+,1 ,$(getvar,USERI1)) This time though set USERI1 to the value you want to start with. Thanks to MIKE.PERRY the AUGI director ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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.