+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Senior Member gS7's Avatar
    Computer Details
    gS7's Computer Details
    Operating System:
    Windows Xp sp3
    RAM:
    4 GB
    Monitor:
    Viewsonic
    Discipline
    Surveying
    gS7's Discipline Details
    Occupation
    Drafts man / Surveyor
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    May 2012
    Location
    Udupi,INDIA
    Posts
    204

    Default Increment Numbers

    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....................



  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2014
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    38,305

    Default

    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.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge! N-E-S-T-L-E-'S, Nestle's makes the very best......chocolate.

  3. #3
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,530

    Default

    Quick demo, Not a great deal, but its a start

    Code:
    (defun c:demo  (/ _def obj)
    (vl-load-com)
    (defun _def (msg def)
         (setq def  (cond ((getint (strcat msg
                                    (if def (strcat " <" (itoa def) ">: ") ": ")
                                )))
                        (   def   ))))
     (setq startNumber (_def "\nStart Nummber: " startNumber))     
     (setq IncrementNumber (_def "\nIncrement Nummber: " IncrementNumber))    
    (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)
          )
    Last edited by pBe; 24th May 2012 at 04:40 pm. Reason: add default value

  4. #4
    Senior Member gS7's Avatar
    Computer Details
    gS7's Computer Details
    Operating System:
    Windows Xp sp3
    RAM:
    4 GB
    Monitor:
    Viewsonic
    Discipline
    Surveying
    gS7's Discipline Details
    Occupation
    Drafts man / Surveyor
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    May 2012
    Location
    Udupi,INDIA
    Posts
    204

    Default

    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 )

  5. #5
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,530

    Default

    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

  6. #6
    Senior Member gS7's Avatar
    Computer Details
    gS7's Computer Details
    Operating System:
    Windows Xp sp3
    RAM:
    4 GB
    Monitor:
    Viewsonic
    Discipline
    Surveying
    gS7's Discipline Details
    Occupation
    Drafts man / Surveyor
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    May 2012
    Location
    Udupi,INDIA
    Posts
    204

    Default

    Quote Originally Posted by pBe View Post
    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

  7. #7
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,530

    Default

    What about teaching you how to "bake"

    Prompting with a Default Option by LeeMac

    CODE UPDATED [post #3] <-----

  8. #8
    Senior Member gS7's Avatar
    Computer Details
    gS7's Computer Details
    Operating System:
    Windows Xp sp3
    RAM:
    4 GB
    Monitor:
    Viewsonic
    Discipline
    Surveying
    gS7's Discipline Details
    Occupation
    Drafts man / Surveyor
    Discipline
    Surveying
    Using
    AutoCAD 2009
    Join Date
    May 2012
    Location
    Udupi,INDIA
    Posts
    204

    Default

    Wow !! its working nicely ......

    Tank u pBe ........


  9. #9
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,530

    Default

    Quote Originally Posted by gS7 View Post
    Wow !! its working nicely ......
    Tank u pBe ........
    You are Welcome gS7, hope you will learn a bit from that code.

    Cheers

  10. #10
    Super Member nukecad's Avatar
    Computer Details
    nukecad's Computer Details
    Operating System:
    XP64
    Computer:
    Various machines.
    Using
    AutoCAD LT 2006
    Join Date
    Apr 2009
    Location
    NW Cumbria (English Lake District)
    Posts
    509

    Default

    Registered forum members do not see this ad.

    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
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    *** Out of Beer Error ->-> Recovering Memory***

Similar Threads

  1. lisp want for increment
    By harshad in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 31st Oct 2010, 11:14 pm
  2. Convert integers numbers into real numbers, introducing decimal separator.
    By teknomatika in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 3rd Sep 2010, 04:07 pm
  3. Number Increment...
    By jasonb_880 in forum AutoLISP, Visual LISP & DCL
    Replies: 16
    Last Post: 8th Sep 2009, 11:05 am
  4. Copy and increment
    By richard3009 in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 21st May 2009, 11:53 pm
  5. adding numbers to numbers
    By philk in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 23rd Feb 2006, 05:45 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts