Hi all,
I'm new to autocad and not familiar with autocad object model (but I have done a lot of vba for other drawing programs).
I need to export an entire dwg file to small tiles (each a png file, so I can later on overlay on google map).
Logically, I need to:
1. programmatically zoom to a small bounding box.
2. programmatically cut and export each to a png.
These steps need to repeat for each resolution level (matching googles' zoom level).
Could anyone shed some light on this, thanks a lot.
Jay
With AcadDocument.Export() method, you can export drawing visually into a few different formats of image file, including *.wmf and *.bmp, which may be suitable for your needs.
You would do:
1. determine the entities in drawing to be exported (modelspace or one of the layout, everything in the model/paperspace, or only selected ones);
2. create a selectionSet and add all the target entities into the selectionset
2. zoom to a proper view (zoom to all/extents/window)
3. call AcadDocument.Export(), supplying an image file name, file extension (wmf, or bmp) and the selectionset
4. You may want to write some code to do the image file format conversion (from wmf/bmp to jpg/png) after the exporting wmf/bmp.
Norman Yuan