As promised, here, attached is an Add-in I've been working on for a while to flatten CAD layers to a single drawing component (or few, where text is included).
The Add-in extends the many and varied scripts that can be found on the forum and saves heaps of time if you convert CAD layers for using in field data collection programs such as Arcpad, etc. Most importantly it overcomes the copy/paste problem that can occur in some scripts.
The scripts involved include a few novelty items I wrote more for a matter of interest and learning C# rather than necessity. There is a config file for changing a few variables such as folder names and operation modes (e.g. 'quiet mode', default projection). It also harvests the colours from the imported layers and attempts to reproduce them in a theme.xml file which can be saved.
To make installation quick and easy (hopefully!) I made the project an 'installer' rather than upload a zip of files. I like the idea that you can peruse the code before installing and not have to trust what may be hidden in a zip file!
If anyone objects to using an installer then let me know and i'll post a zip too.
To install: run Manifold in Administrator mode, open the project and run '_Install Add-In Script'.
After installing and restarting Manifold you should have 3 numbered icons.
- Click 1 to import and project your dwg file. Define your area of interest by zooming and panning map to encompass all you want in the resulting flattened drawing. Turn visibility off for layers you don't want;
- Click 2 to define your area of interest (an additional AOI layer is added to the map);
- Click 3 to start the flattening process.
There are more instructions and details in the DWG Tools Readme comments in the project.
Thank-you to oisink for testing and commenting. Both oisink and tjhb contributed code and comments that inspired the Add-in.
Please feel free to reproduce any parts of the code or improve/extend the Add-in.