Detecting if dwg is old version at startup

Discussion in 'AutoCAD' started by Jim Shipley, Mar 16, 2005.

  1. Jim Shipley

    Jim Shipley Guest

    Is there a way to detect if the drawing being opened is from a previous
    release? I would like to put up an alert, or run a script if this is the
    case.

    Thanks
    Jim Shipley
     
    Jim Shipley, Mar 16, 2005
    #1
  2. Read the first 6 bytes of the file, something like this.

    Public Function DwgVersStr(ByVal FileName As String) As String
    VersFile = FreeFile
    Open FileName For Binary As #VersFile
    Chk$ = UCase$(Input$(6, #VersFile))
    Close #VersFile
    Select Case Chk$
    Case "AC1018": Ver$ = "2004"
    Case "AC1015": Ver$ = "2000"
    Case "AC1014": Ver$ = "R14"
    Case "AC1013": Ver$ = "R14"
    Case "AC1012": Ver$ = "R13"
    Case "AC1011": Ver$ = "R13"
    Case "AC1010": Ver$ = "R13"
    Case "AC1009": Ver$ = "R12/R11"
    Case "AC1006": Ver$ = "R10"
    Case "AC1004": Ver$ = "R9"
    Case "AC1003": Ver$ = "2.6"
    Case "AC1002": Ver$ = "2.5"
    Case Else: Ver$ = "Unknown"
    End Select
    DwgVersStr = Ver$
    End Function

    Terry
     
    Terry W. Dotson, Mar 17, 2005
    #2
  3. Jim Shipley

    Jim Shipley Guest

    Thanks!

     
    Jim Shipley, Mar 18, 2005
    #3
  4. Will this work if trying to detect if a drawing is from MDT or
    Mechanical?

    Jim
     
    Jim Dowthwaite, Mar 18, 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.