Real Infrastructure for Virtual CitiesCAD Client ToolsSDE CAD Client provides a very basic interface for operating on SDE feature classes from AutoCAD. The user interface presented by CAD Client exposes many useful functions, and the application programmer interface permits low-level access to functions that can be accessed within AutoCAD using VisualBasic or AUtoLISP. While experimenting with CAD Client for storing urban scene data, we found the need to augment this interface with a few extra functions. These tools consist of DOS batch files that automate the process of creating and clearing appropriate feature classes in SDE, and several VBA macros that assist with putting geometry into SDE, and using SDE attributes to alter CAD geometry. These tools were built and tested using CADCLient version 2, SDE 8.1 and AutoCAD 2000. They are not finished software, but if you know a little about programming, you can probably make them work. No Guarantees, No Support.
Batch Files for Creating and Clearing Appropriate SDE Feature ClassesWhen experimenting with CAD CLient, you will find yourself needing to experiment a lot by creating empty feature classes, putting data in them, and wiping them out to try again. Creating an SDE layer, the sdetable and sdelayer commands are used. The syntax of these commands can be found in the CAD Client Command Reference. These commands have so many quirky parameters which remain constant for our study area, so I have created some batch files to handle the creation of point, line and area layers with a simple batch file. I have created a similar batch file for removing a layer. To understand what CAD features are stored in what type of SDE layer, consult the CadClient manual page 24. If your study area is not downtown Boston, you will need to adjust the parameters for the spatial extent. If you are not working at the GSD, then you will need to change the name of the server and instance. Here is how to create your own sde layers:
To run the commands input the necessary inforamation at the command line after the name of the program. The basic command usage for any of these programs is:
batchfilename layername username password
Note that the user name and password in this case, is your specific SDE password. Another Note: if you have a layer open in arcGIS, you may get an error saying that the layer can't be deleted. If this happens, remove the layer from ArcScene and try again. If this doesn't work, try logging out of CADClient. VBA Tools for Manipulating CAD GeometryTHe current release of SDE and CAD Client prevents the upload of features that have a vertical edge. To overcome this problem, we found it necessary to create a tool that tilts the faces of buildings by a miniscule amount. We also found that in order to create useful CAD data from GIS data layers such as contours and building footprints, we needed to make macros that would alter the elevation and extrude CAD objects based on the ELEVATION and STORIES attribute in the SDE layer.
Installing the Macros
Tilting Faces and Plines to Defeat the Vertical Face Limitation
Extruding Building FootprintsTypical GIS planimetric layers of footprints can be assciated with building heights (perhaps by association with another layer of property tax information) and elevations (by associating building centroids with a digital elevation model. These extrusions leave a lot to be desired, as a representation of the actual geometry of buildings, but nevertheless, they are better than flat building footprints! The Extrude function on the GSD Tools menu assumes that you have retrieved a layer of sde polygon objects that have attributes in their business table named ELEVATION and STORIES. The macro assumes that each story is 12 feet. To use this macro, select a bunch of footprints in autocad, then choose Extrude from the GSD Tools menu, then hit Return. The extruded features are placed in a layer named Extruded. Elevating ContoursContours are another common GIS data layer that we can be expected to use in AutoCAD. THe Elevate function from the GSD Tools menu will elevate the CAD features retrieved from any SDE simple line feature class, assuming that there is an SDE attribute named ELEVATION. TO use this function, select the CAD features, choose Elevate from the GSD Tools menu, and then hit Return. |