MGDwgDataSources.setLayerFilter   Go to object model Go to parent topic Go to previous topic Go to next topic

Syntax

boolean setLayerFilter(string layerFilter) 

Description

Sets the DWG layer filter to identify the DWG layers to extract from the Autodesk DWG file or Autodesk Map project drawing.

If this method is successful, it automatically sets the layer's rebuild flag to True. See setRebuild for more information.

Note that this method does not work during a busy state. For additional information about the busy state, refer to "Handling Busy State and Map Refresh" in the Autodesk MapGuide Developer's Guide.

Parameters

layerFilter - The layer filter. The layer filter is a comma-delimited string containing the filters for each DWG layer to be applied. An empty layer filter string ("") applies all filter layers.

Returns

boolean - Returns True if successful; otherwise returns False.

Refresh

N/A

Error Codes

-1 (busy)

Example

This code is designed to work with the 1stfloorplanEx6.mwf file used by the Filter DWG Layers example:

function setProperties()
{
   // Get the map and selected features
   var map = getMap();
   var mapSel = map.getSelection();
   // Use the single map layer Floor Plan
   var mapLayer = map.getMapLayer("Floor Plan");
   // Get DWG data source object for the layer
   var mapLayerSetup = mapLayer.getLayerSetup();
   var dwgMapLayerDataSource = mapLayerSetup.getDwgDataSources();
   // Set the layer filter to show Interior Walls only
   dwgMapLayerDataSource.setLayerFilter("Interior Walls");
   map.refresh();
   // Set the layer filter to show Interior Walls and Equipment only
   dwgMapLayerDataSource.setLayerFilter("Interior Walls, Equipment");
   map.refresh();
   // Set the layer filter to show all DWG layers
   dwgMapLayerDataSource.setLayerFilter("");
   map.refresh();
}

See Also

getLayerFilter, LayerFilter