Creates a named filter in a Named Object Library, replacing any existing Filter with the same name.
Visual Basic |
---|
Public Function CreateLayerFilter( _ ByVal filter As String, _ ByVal layers As String _ ) As Integer |
Any item in Cadcorp SIS can be assigned a layer value. A layer may be considered a named category, and is often used in CAD systems such as AutoCAD to group building elements such as walls, floors, doors and roofs into layers which can be independently switched on or off.
All items are assigned to a layer named (anonymous), but the _layer$ property of an item can be set at any time to categorise it. Files opened in SIS in DXF or DWG format will automatically be categorised by the layer name of the original graphics.
When any items are assigned to a layer other than (anonymous) they are shown in the Maps Control Bar.
Layers can be turned on or off by clicking the arrow beside the layer name shown in the Maps Control Bar, thus creating an un-named layer filter. Layer filters can be created using GisLink or the Cadcorp SIS Control using CreateLayerFilter.
CreateLayerFilter checks for the presence of a tab character in the layer$parameter and, if found, only uses tab as the separator character (instead of space, comma, tab, newline or carriage return). This allows layer filters to be created containing layer names with embedded spaces.
A layer filter is specified by a space-separated list of layer names, prefixed by + or – to indicate the layer's inclusion or exclusion from the view:
GisCreateLayerFilter ("ExternalElements", "+Floors +Walls –Doors –Lighting")
Layer names which are omitted from the layer list will be unaffected, and will pass the filter by default. In the above example, items which have not been assigned to a layer will be unaffected, as will items assigned to the Windows layer.
To apply the filter to overlay 0, use:
SetOverlayFilter (0, "ExternalElements")
Layer filters can be used in any of the methods which accept a named filter as an argument, such as the spatial searching methods Scan, ScanOverlay, and so on.
Available: GEO MM ME MD OM OD SISpy
Group:
sis.CreateLayerFilter ("MyFilter", "-Roads + Rivers")
Send comments on this topic.
Click to return to www.cadcorp.com
© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).