The MapLayer.Set method modifies the properties of an existing map or image layer in the drawing with the specified service properties.
Declaration
public bool Esri.ArcGISForAutoCAD.MapLayer.Set(Document doc, int mapLayerId, bool? dynamic = null, bool? visibility = null, int? transparency = null, string processingTemplate = null)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
int | mapLayerId | The index integer number associated with the layer that can be obtained using MapLayer.Names. | required |
bool | dynamic | Specifies whether the Dynamic method will be used to update the map service when the view changes (true = Dynamic behavior, false = Refresh on demand). | optional |
bool | visibility | Specifies whether the map is visible (true = Visible, false = Hidden). | optional |
int | transparency | The percentage of image transparency to apply to the map (values are 0-99, zero is opaque). | optional |
string | processingTemplate | An available imagery layer processing template name, which is case sensitive, such as "RFTHillshade". | optional |
Returns
| Type | Description |
|---|---|
bool | true if the properties were set successfully |
Remarks on error conditions
This method may throw an exception or return false or null if a parameter is invalid.
Example
Print the success of modifying the index number 1 map layer to be visible and draw on demand with a transparency of 45 percent.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var mapLayerId = 1;
// Set the properties
var success = Esri.ArcGISForAutoCAD.MapLayer.Set(doc, mapLayerId, false, true, 45);
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
See also
MapLayer.Names—A .NET method that returns an indexed dictionary of map and imagery layer names included in the current drawing.
esri_maplayer_set—An AutoLISP function that modifies the properties of an existing map or image layer in the drawing.