drawing version version

Discussion in 'AutoCAD' started by Jeff Mishler, Apr 30, 2004.

  1. Jeff Mishler

    Jeff Mishler Guest

    (>= (atof (getvar "acadver")) 16)

    If true then it's 2004+, else it's 2002 or lower
     
    Jeff Mishler, Apr 30, 2004
    #1
  2. Jeff Mishler

    Jeff Mishler Guest

    Heh, silly me.....I read your post too quickly, and I knew what you were
    asking but the conscience brain just didn't comprehend it.

    I think you will need to read the header of the file to access that info.
    And that's something I don't know nuttin' 'bout.....

    Sorry,
    Jeff
     
    Jeff Mishler, Apr 30, 2004
    #2
  3. Jeff Mishler

    Jeff Mishler Guest

    And now for some real help.....after a quick search for "version" I found
    this thread that has the info you need:

    "Drawing file version type" started by huehue on Apr. 30, 2002

    Jeff
     
    Jeff Mishler, Apr 30, 2004
    #3
  4. I have 300 dwg files, about 20 are written on Acad 2004 format.

    I want to write a lisp for opening all the files, one by one, then read it´s
    version and:
    ----------------------------------------------------------------------------
    ---------------------
    (If
    (dwgver = 2004)
    (vl-cmdf "saveas" "2000" "" "Y")
    do nothing
    )
    open the next file
    ----------------------------------------------------------------------------
    -----------------
    How can I know the version of the drawing File?

    Thanks

    JPadilla
     
    Jesús Padilla, Apr 30, 2004
    #4
  5. Jeff Mishler

    John Uhden Guest

    You can't get it by opening it in the current application. You have to open the
    file for "read" and grab the first 6 or 8 characters (I think it's 6) before it
    will have been saved. Better than that, McNeel's DOSLIB has a (dos_dwgver)
    function that probably will suit you the best. McNeel has for many years been
    gracious enough to let Dale Fugier <bless him> provide top quality custom
    functions to us AutoLispers for free. It doesn't get any better than that.
    Send Dale a thankyou.
     
    John Uhden, Apr 30, 2004
    #5
  6. Jeff:

    As I understand "acadver" gives you the version of Acad (the application), I
    need to get the version of of the current drawing file.

    Thanks.

    JPadilla
     
    Jesús Padilla, Apr 30, 2004
    #6
  7. Jeff Mishler

    Rudy Tovar Guest

    Modify as you wish.

    (defun c:fsave (/ flist cn ofile)
    (setq flist (vl-directory-files "c:/details" "*.dwg"))
    (setq cn 0)
    (setq ofile (open "c:/flist.scr" "w")
    )
    (while (nth cn flist)
    (progn
    (write-line "open" ofile)
    (write-line (strcat (chr 34)"c:/details/"(nth cn flist)(chr 34))
    ofile)
    (write-line "saveas" ofile)
    (write-line "r14" ofile)
    (write-line "" ofile)
    (write-line "y" ofile)
    (write-line "close" ofile)
    (setq cn (1+ cn))
    )
    )
    (close ofile)
    (Princ)
    )
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Apr 30, 2004
    #7
  8. If your going to open them all any way why not save them all too. Set Acad
    to save in A2000 format. Add the following code to your Acad.lsp file:

    (Defun S::Startup ()
    (Princ)
    (COMMAND "ZOOM" "EXTENTS")
    (COMMAND "QSAVE")
    (COMMAND "CLOSE")
    )
    (princ "\n")


    Just be sure to supress it all when your done. I use a smilar routine to
    plot multiple drawings, you can open as many drawings as you like, sit back
    and whatch. For best results place all the files in one folder. A lit tip
    though to a small test run first other wise you have to put an axe through
    your machine to stop it.

    Daniel.
     
    Daniel Bennett, Apr 30, 2004
    #8
  9. Jeff Mishler

    DFrank Guest

    Why not use Batch Converter to save all in A2k?
     
    DFrank, Apr 30, 2004
    #9
  10. Thanks Jeff
     
    Jesús Padilla, May 3, 2004
    #10
  11. to use the Batch Converter works, but I need to know the drawing version to
    save only some of the files. and make a report.

    Thanks
     
    Jesús Padilla, May 3, 2004
    #11
  12. John:

    DosLib is great, I use it a lot, Thanks.

    JPadilla
     
    Jesús Padilla, May 3, 2004
    #12
  13. Thanks Rudy, your program works fine.

    JPadilla
     
    Jesús Padilla, May 3, 2004
    #13
  14. Thanks Daniel.

    JPAdilla
     
    Jesús Padilla, May 3, 2004
    #14
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.