In AutoCAD Map 3D you can use the 'Load Layer…' UI tool to load a *.layer file and create data layer with specific FDO data source.
If you have many such *.layer files and you want them to load programmatically, you can use Autodesk.Gis.Map.Platform.AcMapMap LoadLayer(string layerFile) API for the same.
Here is a C# code snippet :
try
{
// Get the Map Object
AcMapMap currentMap = AcMapMap.GetCurrentMap();
currentMap.LoadLayer(@"C:\Data_set\Layer_Files\Parcels.layer");
}
catch (MgException ex)
{
ed.WriteMessage(ex.Message.ToString());
}


Leave a Reply