Author Topic: AutoCAD version files.  (Read 5790 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
AutoCAD version files.
« on: January 19, 2005, 02:01:47 PM »
Another one...

Some of users in our offices open drawing by double-cliking in windows explorer...

But some drawing was made in incompatible version 2002 or 2004 or 2005

so the question is..is there any way to detect the version of files before opening ?

If yes, How can I tell to windows to start 2002, 2004 or 2005 ??


thanks.
Keep smile...

danny

  • Guest
AutoCAD version files.
« Reply #1 on: January 19, 2005, 02:17:57 PM »
maybe under the properties it will say what version.  to open it in windows, right click on the file and go to "open with" then choose the correct program

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
AutoCAD version files.
« Reply #2 on: January 19, 2005, 02:18:34 PM »
I don't think there is a way to do that WITHOUT another program installed to intercept the call.

That sounds like a very interesting program that could be written, if anyone were inclined.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Jassper

  • Guest
AutoCAD version files.
« Reply #3 on: January 19, 2005, 02:32:27 PM »
http://theswamp.org/phpBB2/viewtopic.php?t=1412&highlight=spyware

When I use "AutoCAD Version Explorer" it will show what revision of CAD created it. See the above thread for more info.

Little :O)

MikePerry

  • Guest
AutoCAD version files.
« Reply #4 on: January 19, 2005, 06:09:26 PM »
Hi

Give the following web search results a try -

DWGicon - 26 Results

Have a good one, Mike

paulmcz

  • Bull Frog
  • Posts: 202
AutoCAD version files.
« Reply #5 on: January 19, 2005, 07:38:13 PM »

Andrea

  • Water Moccasin
  • Posts: 2372
AutoCAD version files.
« Reply #6 on: January 19, 2005, 10:18:34 PM »
thanks all.. i have downloaded all....and tried all....
but no software can open the good AutoCAD version when double-click on a file.

also I had bad experience trying
http://www.cadwerx.net/Products/CadXplorer/CxCadXplorer.asp

Need to restart WinXP in save mode to remove...
be advised...

So if there is no software that can help me with this...I need to create one.
but don't realy know how to detect the version of a file...hmmm...!!?

;-)
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
AutoCAD version files.
« Reply #7 on: January 20, 2005, 09:38:38 AM »
I tried that DWGIcon and it works great :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

whdjr

  • Guest
AutoCAD version files.
« Reply #8 on: January 20, 2005, 11:09:50 AM »
This is not as easy as double clicking, but if right-click on the filename in explorer and then left-click on "Open With" it gives you all the versions of your CAD program to choose from.

Crank

  • Water Moccasin
  • Posts: 1503
Re: AutoCAD version files.
« Reply #9 on: January 21, 2005, 02:29:58 PM »
Quote from: Andrea
...

so the question is..is there any way to detect the version of files before opening ?

If yes, How can I tell to windows to start 2002, 2004 or 2005 ??
...


You can make a program that looks at the first characters of the file. (open a .dwg with wordpad and you can read someting like AC1018)
This string contains the version number of the .dwg-file.
With that information the program can launch the right version of autocad.

I don't have all the codes, but I believe AC1018=Autocad2004 and AC1015=Autocad2000.
Autocad 2004 and 2005 use the same file format. And 2000, 2000i and 2002 also have the same file format. So you only need to install 2 versions.
Vault Professional 2023     +     AEC Collection

Andrea

  • Water Moccasin
  • Posts: 2372
AutoCAD version files.
« Reply #10 on: January 21, 2005, 09:21:00 PM »
thanks Crank...

But if I have AutoCAD 2004 and 2005 in same PC...

you mean that it would be not possible for windows or any VB to detect with what version to start the file ?


hmmm....
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
AutoCAD version files.
« Reply #11 on: January 22, 2005, 12:05:21 AM »
Modify to suit ...
Code: [Select]

(defun GetDwgVersion ( DwgName / Path Handle Header )
   (if (setq Path (FindFile DwgName))
      (cond
         (  (setq Handle (open Path "r"))
            (setq Header (substr (read-line Handle) 1 6))
            (close Handle)
            (cond
               ((eq Header "AC1018") 16)
               ((eq Header "AC1015") 15)
               ((eq Header "AC1014") 14)
               ((eq Header "AC1012") 13)
               ((eq Header "AC1009") 12)
               ((eq Header "AC1006") 10)
               ((eq Header "AC1004") 9)
               ((eq Header "AC1002") 2.6)
               ((eq Header "AC1.50") 2.05)
               (t 0) ;; 0 = undeterminable
            )
         )
      )
   )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

Crank

  • Water Moccasin
  • Posts: 1503
AutoCAD version files.
« Reply #12 on: January 22, 2005, 06:16:42 AM »
@ MP:

I don't think Lisp should be used for this.

I don't know VB or C, but a tool that starts up when a file has the .dwg extension is what Andrea needs.
This tool then can launch the right version of Autocad.

@ Andrea:

No I don't think so, but why do you want to choose between Autocad 2004 and 2005? They have the same file format and any well wriiten application for 2004 should also work on 2005. (I haven't seen any seen any old application that didn't work on 2005 :roll: ;) )
Vault Professional 2023     +     AEC Collection

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
AutoCAD version files.
« Reply #13 on: January 22, 2005, 08:54:10 AM »
Quote from: Crank
@ MP:

I don't think Lisp should be used for this.

I don't know VB or C, but a tool that starts up when a file has the .dwg extension is what Andrea needs.
This tool then can launch the right version of Autocad.

@ Andrea:

No I don't think so, but why do you want to choose between Autocad 2004 and 2005? They have the same file format and any well wriiten application for 2004 should also work on 2005. (I haven't seen any seen any old application that didn't work on 2005 :roll: ;) )

I agree, that's why I offered the words "Modify to suit" :)

Subtitle: It was late and I was too tired / lazy to do it myself.

Hang on I'll whip up a quick VB variation ...
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
AutoCAD version files.
« Reply #14 on: January 22, 2005, 09:07:47 AM »
Quick ^ Dirty VB function:
Code: [Select]

Function GetDwgVersion(dwgName As String) As Single

    Dim handle As Integer, _
        header As String * 6
       
    handle = FreeFile
   
    On Error Resume Next
   
    Open dwgName For Binary Shared As #handle
   
    If Err.Number Then
        Err.Clear
        GetDwgVersion = 0
    Else
        Get #handle, , header
        Close #handle
        Select Case header
            '' I don't have AutoCAD 2005 installed
            '' so someone else will have to provide
            '' the signature for said version
            '' case "AC10??": GetDwgVersion = ??
            Case "AC1018": GetDwgVersion = 16
            Case "AC1015": GetDwgVersion = 15
            Case "AC1014": GetDwgVersion = 14
            Case "AC1012": GetDwgVersion = 13
            Case "AC1009": GetDwgVersion = 12
            Case "AC1006": GetDwgVersion = 10
            Case "AC1004": GetDwgVersion = 9
            Case "AC1002": GetDwgVersion = 2.6
            Case "AC1.50": GetDwgVersion = 2.05
            Case Else: GetDwgVersion = 0
        End Select
    End If

End Function

A calling function could then be responsible for deciding what to do based on the dwging version. Crazy me I'd just run AutoCAD 2005 and worry not about the version number. Maybe I should go back and read the entire thread to see why this is even needed ...

<Be gentle guys, just woke up, havn't even had a coffee yet>

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst