Using Find Utility to extract data from a DWG file

Good Afternoon!
I am a Land Surveyor and commonly work with DWG files from day to day using AutoCAD to run them. In short DWG files contain map/drafting data in a non-ASCII format. You cannot open them as plain text.

The other day I came across behavior in the DOPUS file search that is very interesting to me- if I search for files containing text "CS_PROJ ZONE" in the containing text for simple file search, it returns my ACAD drawings. I know this text to be a variable name for the value that determines the State Plane Coordinate System the drawing is set to. I have no idea why this search pulls up the DWG's, I can only infer that it searches beyond plain text. Now what I am hoping for is to use this search behavior to set a column script to display a DWG's coordinate system based on the drawings value.
And you may now see my problem, I found the variable name with search but have no idea for the syntax of the next lines and how the the variable value is stored.

Does anyone know why the search function would read an otherwise unreadable document and have any ideas as to how I may find the stored value/extract the line the found string belongs in?

If I can figure this out I could theoretically make this work with any similar kind of stored variable in ACAD, which would be amazing!

There are two possibilities:

  • DWG-related software has installed an IFilter on the system, which allows search tools (like Opus and Windows Search) to know the text content of those files without having to understand the filetypes.

    You can see which IFilters are installed on your system using a tool like SearchFilterView - View the IFilters list of Windows search

  • The text is stored inside the file as ASCII or similar, without compression, such that just reading the file as if it was text will get the text. (Depending on the file format, this may work sometimes and not others, or could work all the time. Compression or markup may modify or split up text sometimes while leaving what you're searching for intact at other times.)

hi @Leo , are there any ideas for just reading ".dwg", ".rvt" file as text and extracting their version number?

I don't know enough about either file format to answer that properly. If they store their version numbers inside the files then it should be possible to extract them via a script, but I don't know if they do or how easy the file formats are to parse as I have no knowledge of their internals.