[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extern libmagic output like command File?


Does This Help...
The first 6 chars of an autocad file are a code.
*AC1.50* - DWG Release 2.0
*AC2.10* - DWG Release 2.10
*AC1002* - DWG Release 2.5
*AC1003 *- DWG Release 2.6
*AC1004 *- DWG Release 9
*AC1006 *- DWG Release 10
*AC1009 *- DWG Release 11/12 (LT R1/R2)
*AC1012 *- DWG Release 13 (LT95)
*AC1014 *- DWG Release 14, 14.01 (LT97/LT98)
*AC1015 *- DWG AutoCAD 2000/2000i/2002
*AC1018 *- DWG AutoCAD 2004/2005/2006
*AC1021 *- DWG AutoCAD 2007/2008/2009
*AC1024 *- DWG AutoCAD 2010/2011/2012
*AC1027 *- DWG AutoCAD 2013/2014/2015/2016/2017
*AC1032 *- DWG AutoCAD 2018/2019/2020/2021/2022/2023/2024

So something like this might work...


Public Sub GetAutoCadVersion(Path As String) As String

  Dim sCode As String
  Dim cCol As Collection = ["AC1.50": "DWG Release 2.0",
    "AC2.10": "DWG Release 2.10",
    "AC1002": "DWG Release 2.5",
    "AC1003": "DWG Release 2.6",
    "AC1004": "DWG Release 9",
    "AC1006": "DWG Release 10",
    "AC1009": "DWG Release 11/12 (LT R1/R2)",
    "AC1012": "DWG Release 13 (LT95)",
    "AC1014": "DWG Release 14, 14.01 (LT97/LT98)",
    "AC1015": "DWG AutoCAD 2000/2000i/2002",
    "AC1018": "DWG AutoCAD 2004/2005/2006",
    "AC1021": "DWG AutoCAD 2007/2008/2009",
    "AC1024": "DWG AutoCAD 2010/2011/2012",
    "AC1027": "DWG AutoCAD 2013/2014/2015/2016/2017",
    "AC1032": "DWG AutoCAD 2018/2019/2020/2021/2022/2023/2024"]

    Dim hFile As File
    hFile = Open Path For Read
    sCode = Mid(hFile.ReadLine(), 1, 6)
    hFile.Close
    Return cCol[sCode]

End

i tested it on a randomly downloaded autocad file and it seemed to work.

Respects
BruceS


On Mon, 16 Sept 2024 at 15:12, System64 Development <64xcode@xxxxxxxxx>
wrote:

> El 16/9/24 a las 16:05, vuott@xxxxxxxxxxxx escribió:
> > what is this File command ?
>
> Is a command that give some information about the file passed as argument.
>
> https://en.wikipedia.org/wiki/File_%28command%29
>
> Regards.
>
> Martin
>
>
>

Follow-Ups:
Re: Extern libmagic output like command File?System64 Development <64xcode@xxxxxxxxx>
References:
Extern libmagic output like command File?System64 Development <64xcode@xxxxxxxxx>
Re: Extern libmagic output like command File?vuott@xxxxxxxxxxxx
Re: Extern libmagic output like command File?System64 Development <64xcode@xxxxxxxxx>