Finding File Versions

Discussion in 'AutoCAD' started by mr_nick, Mar 11, 2005.

  1. mr_nick

    mr_nick Guest

    Is there a way to interrogate an ARX file from within AutoCAD to find out it's version? I want to be able to run a routine on a machine which will check a number of files and provide me with the version numbers.
     
    mr_nick, Mar 11, 2005
    #1
  2. mr_nick

    Jürg Menzi Guest

    Hi Nickely

    Try this one:
    Code:
    ;
    ; -- MeGetFileVersion
    ; Returns the version info of a file.
    ; Copyright:
    ;   ©2005 MENZI ENGINEERING GmbH, Switzerland
    ; Arguments [Typ]:
    ;   Fil = Filename "C:\\Program Files\\Acad2005\\acad.exe" [STR]
    ; Return [Typ]:
    ;   > File version [STR]
    ;   > nil if file doesn't exist or has no version info
    ; Notes:
    ;   - Require ScrRun.dll (WinNT4/9x/ME only)
    ;
    (defun MeGetFileVersion (Fil / FilSys RetVal)
    (setq FilSys (vlax-create-object "Scripting.FileSystemObject")
    RetVal (cond
    ((not (findfile Fil)) nil)
    ((eq (setq RetVal (vlax-invoke FilSys 'GetFileVersion Fil)) "")
    nil
    )
    (RetVal)
    )
    )
    (vlax-release-object FilSys)
    RetVal
    )
    
    Cheers
     
    Jürg Menzi, Mar 11, 2005
    #2
  3. mr_nick

    mr_nick Guest

    This works on 99% of the files I want to check, but there is one where the developer has used 'Product Version' rather than 'File Version' for their identifier.

    Is it possible to tweak this to look at the product rather than file version?
     
    mr_nick, Mar 11, 2005
    #3
  4. mr_nick

    Jürg Menzi Guest

    AFAIK not possible in LISP -> VBA + WinAPI

    Cheers
     
    Jürg Menzi, Mar 11, 2005
    #4
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.