Detecting if dwg is old version at startup
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Detecting if dwg is old version at startup

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Jim Shipley
Guest





Posted: Thu Mar 17, 2005 2:11 am    Post subject: Detecting if dwg is old version at startup Reply with quote

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

Back to top
Terry W. Dotson
Guest





Posted: Thu Mar 17, 2005 7:37 am    Post subject: Re: Detecting if dwg is old version at startup Reply with quote

Jim Shipley wrote:

Quote:
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.

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
Back to top
Jim Shipley
Guest





Posted: Fri Mar 18, 2005 11:01 pm    Post subject: Re: Detecting if dwg is old version at startup Reply with quote

Thanks!

"Terry W. Dotson" <nospam@invalid.com> wrote in message
news:4238ed77_2@newsprd01...
Quote:
Jim Shipley wrote:

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.

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


Back to top
Jim Dowthwaite
Guest





Posted: Sat Mar 19, 2005 1:23 am    Post subject: Re: Detecting if dwg is old version at startup Reply with quote

Will this work if trying to detect if a drawing is from MDT or
Mechanical?

Jim
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB