How can you tell V7 dgn files apart from V8?

I have a lot of dgn files and don’t know which are V7 and which are V8.  Is there a way to quickly and easily tell them apart?  I would hate to have to go through and open them up individually.

Parents
  • Do you know how to use PowerShell? I wrote a PowerShell function that will give a file's magic number (https://en.wikipedia.org/wiki/Magic_number_(programming)#In_files) and if it recognizes the magic number the file type. It can recognize V7 and V8 files.

    The function is on GitHub here: Get-MagicNumber on GitHub

    Put that function in a file, then open PowerShell and do:

    . filename.ps1

    where the first character is period, then space, then the name of the ps1 file you put the function in.

    Once you've done that you can cd to your folder of files and do the following:

    dir *.dgn -recurse -file | Get-MagicNumber | Format-Table File,FileType
    
    Where:
        -recurse means to get all *.dgn files in the current folder and sub-folders
        -file means only return info about files
    

    You can also use the Export-Csv command instead of Format-Table to send the info to a CSV file instead of the screen.

     

  • I cant use PowerShell for "reasons".  I'll have to pursue other scripting means.  The magic number information is helpful, thank you. 

  • I ran a script to pull the magic number of my DGNs and complied a list of valid ones.  Thought it may help who ever comes across this.

    Magic number: 4143313030390000 - R11/12 DWG
    Magic number: 4143313031340000 - R14 DWG
    Magic number: 4143313031350000 - R2000 DWG
    Magic number: 4143313031380000 - R2004 DWG
    Magic number: 4143313032340000 - R2010 DWG
    Magic number: 4143313032370000 - R2013 DWG
    Magic number: 4143313033320000 - R2018 DWG
    Magic number: 0809fe0200000000 - V7 DGN
    Magic number: 0809fe0200000108 - V7 DGN
    Magic number: 0809fe0200000188 - V7 DGN
    Magic number: 0809fe0200000881 - V7 DGN
    Magic number: 0809fe0200800108 - V7 DGN
    Magic number: 0809fe0201080000 - V7 DGN
    Magic number: 0809fe0201880080 - V7 DGN
    Magic number: 0809fe0208010000 - V7 DGN
    Magic number: 0809fe0263726f73 - V7 DGN
    Magic number: 0809fe0270656e75 - V7 DGN
    Magic number: 0809fe0274657374 - V7 DGN
    Magic number: 0809fe02776f726b - V7 DGN
    Magic number: c809fe0200000000 - V7 DGN
    Magic number: c809fe0200000188 - V7 DGN
    Magic number: c809fe0201080000 - V7 DGN
    Magic number: c809fe0201880080 - V7 DGN
    Magic number: c809fe0208010000 - V7 DGN
    Magic number: d0cf11e0a1b11ae1 - V8 DGN

  • Magic numbers aren't a fixed length, each application sets its own length, the magic number for a V7 file is c809fe02, the other numbers you're showing are part of the file data and can be ignored.

    on DWG the first 4 bytes are always the ascii codes for AC10 (41433130) then the next 2 bytes are the version. Anything after the first 6 bytes is either padding or file data.

    The v8 file format is special, it's actually a file format from Microsoft, not Bentley. It's called the Microsoft Compound File Binary File Format and may be used by more than MicroStation on your computer. So you may find a file with the same magic number but isn't actually a dgn file.

     

  • Also, I recently found this set of file formats at the US Library of Congress website. It's not comprehensive but has a lot of file formats. The ones I've check so far all have magic numbers

    www.loc.gov/.../descriptions.shtml

     

Reply Children
No Data