next up previous contents index
Next: Layer Table Up: Main Functions 3 Previous: Grid Style   Contents   Index

Current Layer

(string) GetCurLayer()
This function returns a string containing the name of the current layer. If no current layer is defined, a null string is returned.

(int) GetCurLayerIndex()
This function returns the 1-based index of the current layer in the layer table. If no current layer is defined, 0 is returned.

(int) SetCurLayer(stdlyr)
This function sets the current layer as indicated by the standard layer argument. The return value is the 1-based index of the previous current layer in the layer table, or 0 if there was no current layer. This return can be passed as the argument to revert to the previous current layer.

(int) SetCurLayerFast(stdlyr)
This is like GetCurLayer, but there is no visible update, i.e., the layer table indication, and the current layer shown in various pop-ups, is unchanged. This is for speed when drawing. When drawing is finished, this should be called with the original current layer, or SetCurLayer should be called with some layer. The return value is the 1-based index of the previous current layer in the layer table, or 0 if there was no current layer. This return can be passed as the argument to revert to the previous current layer.

(int) NewCurLayer(stdlyr)
If the standard layer argument matches an existing layer, the current layer is set to that layer. Otherwise, a new layer is created, if possible, and the current layer is set to the new layer. The function will fail if it is not possible to create a new layer, for example if the name is not a valid layer name.

If the name is not in the layer:purpose form, any new layer created will use the default ``drawing'' purpose.

The return value is the 1-based index of the previous current layer in the layer table, or 0 if there was no current layer. This return can be passed as the argument to revert to the previous current layer.

(string) GetCurLayerAlias()
This function is deprecated, see GetLayerAlias. Return the alias name of the current layer, or a null string if there is no alias.

(int) SetCurLayerAlias(alias)
This function is deprecated, see SetLayerAlias. Set the alias name of the current layer. Returns 1 on success, 0 otherwise (possibly indicating a name clash).

(string) GetCurLayerDescr()
This function is deprecated, see GetLayerDescr. Return the description string of the current layer. This will be null if no description has been set.

(int) SetCurLayerDescr(descr)
This function is deprecated, see SetLayerDescr. Set the description string of the current layer. The return value is always 1.


next up previous contents index
Next: Layer Table Up: Main Functions 3 Previous: Grid Style   Contents   Index
Stephen R. Whiteley 2024-09-29