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.
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.
can you explain this a bit better not good with poweshell
Kevin van Haaren said:Put that function in a file, then open PowerShell and do: . filename.ps1
Put that function in a file, then open PowerShell and do:
. filename.ps1
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
John Doe said: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
John Doe said:Magic number: 0809fe0200000000 - V7 DGNMagic 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
John Doe said: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.
Why does it matter, if your microstation is configured properly it will convert v7 to v8 on the fly when they are opened, the only difference is the level names , pre v8 will not have level names just level number as the name... but if your going to isolate the v7 dgns in order to add level names from a library then I could understand.. but as almost nobody uses pre v8i it shouldn't present a problem.
I do like the powerscript magic number thing...
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