Author Topic: DrollTroll's Toolbox  (Read 8400 times)

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4263
DCParser
« Reply #15 on: June 08, 2019, 08:14:54 AM »
DcParser.exe -- this is a utility I developed some years back for dumping the contents of a particular stream of drawing data into an annotated text file. Note that it hasn't been updated in several versions, so depending on your drawing's contents, you may not get a complete data dump if using it for that purpose.
The primary reason I am including it here is for the purpose of deleting Hatch Pattern, Symbol, and Material streams from a drawing file. In particular, around versions 19-21 (ish) it was possible for Gradient hatch patterns to proliferate, loading up a drawing with hundreds of unused gradient fill patterns that slowed DesignCAD down.
Instructions:Download the attached zip file and unzip it to a convenient folder (maybe your DesignCAD folder, for example). Change the extracted file's filename from DcParser.zyx to DcParser.exe (the icon should change once this is done).

To use the program, run DcParser.exe. Click on the 'Pick Drawing' button, then browse to and select a DesignCAD drawing file. Once the file is loaded, a list of data streams will appear in the central list box (Image, Layer, Symbol, Options, Preview, Summary, Contents, etc.).


Say you want to delete all those pesky gradient hatch patterns: Click on the 'Hatch Pattern' item in the stream list to highlight it, then click on the 'Delete Stream' button. ALL non-default hatch patterns (even some that may have been in use) will now have been deleted from that drawing.

In a similar fashion you could delete all Material entries by deleting the 'Material' stream, or all Paper Space layouts by deleting the 'PAPER SPACE' folder.

The one stream you generally do NOT want to delete is 'Contents'. This holds most of your drawing entities.
I strongly recommend you make a backup copy of any drawing BEFORE you use this tool. There is no Undo -- once a stream has been deleted, it's gone forever and there's no recovering it.
If you want a text dump of a stream, highlight the stream and choose 'Write Stream to File'; this will create a (long!) text file with a byte-by-byte detail of what's in that stream. Because it hasn't been updated in several versions, some newer entity types like solid surfaces and custom attributes could cause it to stop the annotation prematurely, but for anything from 2014 or earlier it should generally be reliable.
So: Use at your own risk. This tool CAN destroy a drawing if you're not careful. You have been warned.
This program is not digitally signed. You may have to make an exception for it to keep your antivirus from blocking it for that reason.
25 years with DesignCAD