This is the final post in the series titled AutoCAD Map 3D API Training content. The previous posts are: Part-1 , Part 2, Part-3, Part-4 and Part-5. In this post, I will talk about the API for creating and managing Map Layers.
There are two basic Map 3D .NET types that will help you manage your Map and Map Layers: AcMapMap and AcMapLayer. AcMapMap represents the conceptual container that contains your Map data. Put another way, it contains all the geospatial layers representing your map data. AcMapLayer represents the geospatial layer itself:
This presentation provides more details on the AcMapMap and AcMapLayer types. It specifically talks about important methods in AcMapMap and AcMapLayer that allow instances of these types to work with each other like accessing the Map and the Layer collection within the Map, searching for and finding a specific layer. It also talks about API for programmatically selecting and highlighting specific features on a layer. Here is a sample that demonstrates this selection API. In order to use this sample, please first build, load and run the command “BuildMap” in the SDK sample MapSDK\Map Samples\Platform\BuildMap. Once the map is created, follow the following steps:
- Open MapsAndLayers.sln in Visual Studio 2010 and build it.
- Load the assembly from step above into the Map session containing the map created using the BuildMap sample.
- Enter the command “selftrs” to select and highlight features on the “signals” layer that fall inside the rectangle defined by the extents of the raster image on the “redding” layer.