All the lisp files you already have can be easily modified to what you need. The mechanism is already there.
Registered forum members do not see this ad.
Hey guys, looking for some help here,
i've found various lisp files for incrementing numbers but none that do multiple numbers in a single text line i.e. 01/01/01-02 then the next being 01/01/03-04 then 01/01/05-06 and so on...
Anyone got any ideas??
Cheers,
Jason


All the lisp files you already have can be easily modified to what you need. The mechanism is already there.
how could i do that?


Open one of them in "_vlide" go to help to learn what does what and you'll be able to figure out the rest. I did it the same way.
DIY is the best way to learn imo...
And if you need more guidance see here:
http://www.cadtutor.net/forum/showthread.php?t=38760
http://www.cadtutor.net/forum/showthread.php?t=38734
http://www.afralisp.net/
http://www.jefferypsanders.com/autolisptut.html
http://ronleigh.info/autolisp/index.htm
http://midpointcad.com/au/docs/lakose_The_Visual_LISP_Developers_Bible.pdf
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
hey, had a quick look through some of that there but cant see how i could increment 2 parts of the text line??
Cheers


Of course not. Quick look will not get you very far. It takes some effort.
What routine or part of the routine are you looking at?
hey, i've managed to get it to the stage it asks for the 2nd number but it only inserts and increments the 1st number...
not sure what to do next??Code:(defun c:dinc (/ p n ni pref suff nns ntx ntxx oecho osn ds th txt) (setq oecho (getvar "cmdecho") osn (getvar "osmode") ) (if (= 0 (getvar "dimscale"))(setq ds 1.0)(setq ds (getvar "dimscale"))) (setq th (getvar "dimtxt")) (setq txt (* th ds)) (setvar "cmdecho" 0) (setvar "osmode" 0) (if nn (setq nn (fix nn)) (setq nn 1) ) (if (= nn 0)(setq nn 1)) (princ "\n Increment numbers by < ") (princ nn) (princ " >? : ") (setq ni (getint)) (if (= ni nil) (setq ni nn) (setq nn ni) ) (if np (setq np (fix np)) (setq np nn) ) (princ "\n Start or continue with number < ") (princ np) (princ " >? : ") (setq n (getint)) (if (= n nil) (setq n np) (setq np n) ) (setq nns (itoa n)) (princ "\n Prefix text < ") (princ pre) (princ " >? or <.> for none: ") (setq pref (getstring t)) (if (= pref ".") (progn (setq pre nil) (setq pref nil) ) (progn (if (= pref "") (setq pref pre) (setq pre pref) ) (if pref (setq ntx (strcat pref nns)) ) ) ) (princ "\n Suffix text < ") (princ suf) (princ " >- or <.> for none: ") (setq suff (getstring t)) (if (= suff ".") (progn (setq suf nil) (setq suff nil) ) (progn (if (= suff "") (setq suff suf) (setq suf suff) ) (if suff (if pref (setq ntxx (strcat pref nns suff)) (setq ntxx (strcat nns suff)) ) ) ) ) (if (= nn 0)(setq nn 1)) (princ "\n Increment 2nd number by < ") (princ nn) (princ " >? : ") (setq ni (getint)) (if (= ni nil) (setq ni nn) (setq nn ni) ) (if np (setq np (fix np)) (setq np nn) ) (princ "\n 2nd number < ") (princ np) (princ " >? : ") (setq n (getint)) (if (= n nil) (setq n np) (setq np n) ) (setq p (getpoint "\n Insert: ")) (setq oecho (getvar "cmdecho")) (while p (if suff ;(command "text" "j" "mc" p "" "" ntxx) (entmake (list (cons 0 "TEXT") (cons 10 p) (cons 11 p) (cons 1 ntxx) ; actual text (cons 7 (getvar "TEXTSTYLE")) (cons 40 txt) (cons 72 4) ) ) (if pref ;(command "text" "j" "mc" p "" "" ntx) (entmake (list (cons 0 "TEXT") (cons 10 p) (cons 11 p) (cons 1 ntx); actual text (cons 7 (getvar "TEXTSTYLE")) (cons 40 txt) (cons 72 4) ) ) ;(command "text" "j" "mc" p "" "" n) (entmake (list (cons 0 "TEXT") (cons 10 p) (cons 11 p) (cons 1 n); actual text (cons 7 (getvar "TEXTSTYLE")) (cons 40 txt) (cons 72 4) ) ) ) ) (setq p (getpoint "\n Next number location: ") n (+ ni n) nns (itoa n) np n ) (if suff (if pref (setq ntxx (strcat pref nns suff)) (setq ntxx (strcat nns suff)) ) ) (if pref (if suff (setq ntxx (strcat pref nns suff)) (setq ntx (strcat pref nns)) ) ) ) (setvar "cmdecho" oecho) (setvar "osmode" osn) (princ) ) (princ "\n Type > DINC < to insert text with ascending integers.")
Cheers
Last edited by jasonb_880; 3rd Sep 2009 at 10:28 am.


Because this is an extract from the routine I wrote a few years back, I am willing to help you to modify it. I will not do it for you though.
How much time you have for this? I am leaving now and will be gone for about a week.
If someone else wants to jump in, by all means.
Registered forum members do not see this ad.
not a lot of time to be honest but i'll take all the help i can get?
Cheers
Bookmarks