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'.

Use:

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.

I haven't allowed for the import of dxf but I will check if I could make it an option for the next version.

At the moment you would need to import the dxf manually, project it manually, set the AOI area (all the step 1 processes), put the whole lot in a single folder then continue with step 2 and 3. That should work but... takes a lot of automation away.

With regard to the block references, is it possible to reconstruct one in Manifold 8?

I tried to import a single block and then reconstruct it from its parts but couldn't (no such thing as a multi-line?).

on an imported dwg block and see that indeed one can make a single object from lines.

So the next step would be to identify if there were anything linking the primitive parts of the imported block so it could be reconstructed. I can't see any. I have little experience with CAD so may have missed something.

Is there any way that the block parts can be identified for reconstruction?