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 Reply Children
  • 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

     

  • I'll have to pursue other scripting means

    it would be  helpful if you  published  here what the alternative scripting  was, I never heard  of  magic number in DOS  and  I'm not much use in powershell .. in your  list of magic number  outputs below  

    Magic number: 0809fe0200000000 - V7 DGN
    Magic number: 0809fe0200000108 - V7 DGN

    the magic  numbers vary  between same format is this normal?  Does  your script add the  type at the  end, does it indicate the  file names too like the poweshell script does

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

  • I used a python script generated by chatgpt.  It reads the first 8 bytes of all DGNs and outputs each unique "magic number" found among other things.  I don't know if the variation is normal but that's what the script found.