TheSwamp
CAD Forums => CAD General => Topic started by: Andrea 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.
-
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
-
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.
-
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)
-
Hi
Give the following web search results a try -
DWGicon - 26 Results (http://www.google.co.uk/search?hl=en&q=DWGicon&btnG=Google+Search&meta=)
Have a good one, Mike
-
Check this.
http://www.freewebs.com/acadexp/index.htm
-
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...!!?
;-)
-
I tried that DWGIcon and it works great :)
-
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.
-
...
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.
-
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....
-
Modify to suit ...
(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
)
)
)
)
)
-
@ 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: ;) )
-
@ 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 ...
-
Quick ^ Dirty VB function:
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>
:)
-
<Be gentle guys, just woke up, havn't even had a coffee yet>:)
No coffee yet!! I can't even log in without coffee. :D
Interesting code there MP.
-
BRB (going to get a big ol' mug) ...
-
mmmm, coffee. Nothing like a fresh brew in my favorite 16oz cup :)
Anyway ... the abbreviated version of what I do at work, where I run r14, 2000 and 2004 is, generally speaking, I fire up an instance of 2004 and then shut her down. From that point forward if I double click a drawing in explorer etc. 2004 fires up. Also, 2004 is configured to save to the 2000 format, so for me, the whole issue is kinda moot (though it's nice to have code for these determinations). Our users run 2000 (our projects span MANY years - we start and finish a project with the same version). I have the multiple versions because I have to make sure code I write works accross different platforms.
Incidentally I had written that LISP function to prevent XREFing drawings which were incompatible with the version of AutoCAD running. Like everyone else on the planet, we run a custom XREF command that allows multiple attaches, detaches ad nauseum.
Babble ... when is this coffee going to take?
:)
-
(our projects span MANY years - we start and finish a project with the same version).
Now that must take some discipline on the drafters part. :D Or do you limit them to only one version on their machine.
-
They only have one version.
We must protect them from themselves.
:twisted:
Mr. (Randy) CADaver may have some experience in this regard, lol.
Note that I don't mean Randy in the British way.
-
Well being on the other end (as in drafter) I know where you're coming from but, some of us do know what we are doing. :D
*** you manager types are all alike, "those drafters know nothing, we must watch their every move" ***
Just kidding........ BTW.
-
Well being on the other end (as in drafter) I know where you're coming from but, some of us do know what we are doing. :D
*** you manager types are all alike, "those drafters know nothing, we must watch their every move" ***
Just kidding........ BTW.
:lol:
Well I wish it weren't the case, but having been in the CADD Support group at my company now awhile (will be 10 years in May) the sad reality is that the sharp ones probably are in the order of 1 per 20 (I'm being generous). Believe me, it would be great if we didn't have to babysit, audit, fix ... I don't enjoy being a CADD Janitor -- I just want to write fun and clever programs man!
-
the sad reality is that the sharp ones probably are in the order of 1 per 20 (I'm being generous)
Really! That many, wow!!
-
My work here is done: Another thread completely hijacked. Sorry Andrea! :oops:
-
They only have one version.
We must protect them from themselves.
:twisted:
Mr. (Randy) CADaver may have some experience in this regard, lol.
We control everything from the network and from local desktop icons with client/contract specific setups. A user clicks on a client/contract icon and he's loaded the proper version with the proper settings and profile.
The users are free to use whatever they wish as long as the results are the same, but there's the rub. If they use company stuff and it blows up, it's my fault, I'll take the heat. But if a user ignores our shortcuts in favor of his own methods, he'll take the heat (considerable heat) for any blow up. We try to make it easier (less painful) to comply, than not.
The only drawback I have to our current system is that we limit one session of ACAD at a time. If I'm running an R2002 project, and need to review something on an R2005 contract or another R2002 project, I have to exit the current R2002 session first.
I've solved it by adding another network link in my office and firing up my laptop when I need the additional session. I've had a couple of strange looks (not all that rare at all) when they see my laptop propped up on the destop's keyboard, and me running two mice (mice? mouses? meece? mooses??)
Note that I don't mean Randy in the British way.
Even if you did, it'd be one of the nicer things I've been called around here ;)