doslib.arx

Discussion in 'AutoCAD' started by maryam, Jul 14, 2004.

  1. maryam

    maryam Guest

    hi
    I have switched from AutoCAD 2000i to AutoCAD 2005.... in order to use my pervious blocks and customization I had to load my menus and a lisp file with my customized functions.
    In my startup function I must load a file doslib??.arx depending on the version of my AutoCAD.
    what is this file? does any body know? where can I get it ?
    the command to load it is :

    ((>= (atoi (substr (getvar "acadver") 1 2)) 15)
    (if (not (member "doslib2k.arx" (arx)))
    (if (findfile "doslib2k.arx")
    (arxload "doslib2k")
    )
    )
    )
    ); doslib loaded...
    ;;; now load the program
     
    maryam, Jul 14, 2004
    #1
  2. maryam

    Paul Turvill Guest

    Paul Turvill, Jul 14, 2004
    #2
  3. maryam

    maryam Guest

    thank you very much. I downloaded the file and I could load it. however I have a code that will automatically load the doslib at the startup. I can't understand the first line of the code (cond
    ((= (atoi (substr (getvar "acadver") 1 2)) 14)

    what are the numbers 12 and 14 stand for?

    in order to modify it to acadver 2005 what should i do?

    ;;; first load the doslib library depending of the Acad vesion (14/2k)
    (cond
    ((= (atoi (substr (getvar "acadver") 1 2)) 14)
    (if (not (member "doslib14.arx" (arx)))
    (if (findfile "doslib14.arx")
    (arxload "doslib14")
    )
    )
    )
    ((>= (atoi (substr (getvar "acadver") 1 2)) 15)
    (if (not (member "doslib2k.arx" (arx)))
    (if (findfile "doslib2k.arx")
    (arxload "doslib2k")
    )
    )
    )
    )
     
    maryam, Jul 14, 2004
    #3
  4. maryam

    ECCAD Guest

    ((>= (atoi (substr (getvar "acadver") 1 2)) 15)
    The above gets 1st 2 characters from (getvar "acadver"),
    changes them to an integer, and checks if the integer is
    greater than or = to '15'.
    The 1 2 are part of the substr function..
    e.g. (setq word "ABCDE")
    (setq check (substr word 1 2)) .. echo's "AB"
    The '1' tells substr where to begin fetching characters within
    the string, and the '2' tells it how many characters to get.
    The '15' above is version number for 2000 / 2000i
    For R2005, use '16'

    Bob
     
    ECCAD, Jul 14, 2004
    #4
  5. maryam

    BillZ Guest

    It's looking for tha ACAD version. i.e. "14".

    (getvar "acadver") at the command prompt will tell you what version it is.

    I have r2005 so:

    Command: (getvar "acadver")
    "16.1s (LMS Tech)"
    so (substr (getvar "acadver") 1 4) would return "16.1".
    Doslib2004 works in 2005 also.

    Bill
     
    BillZ, Jul 14, 2004
    #5
  6. maryam

    ECCAD Guest

    So, your 'new' code looks like:

    ;;; first load the doslib library depending of the Acad vesion (14/2k/2004/2005)
    (cond

    ((= (atoi (substr (getvar "acadver") 1 2)) 14); Ver 14
    (if (not (member "doslib14.arx" (arx)))
    (if (findfile "doslib14.arx")
    (arxload "doslib14")
    )
    )
    )

    ((= (atoi (substr (getvar "acadver") 1 2)) 15); Ver 2000/2000i
    (if (not (member "doslib2k.arx" (arx)))
    (if (findfile "doslib2k.arx")
    (arxload "doslib2k")
    )
    )
    )

    ((= (atoi (substr (getvar "acadver") 1 2)) 16); Ver 2004 or 2005
    (if (not (member "doslib2004.arx" (arx)))
    (if (findfile "doslib2004.arx")
    (arxload "doslib2004")
    )
    )
    )

    ); cond

    Bob
     
    ECCAD, Jul 14, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.