Skip to content

LayerService

Canonical path: NemAll_Python_BaseElements.LayerService

Utility for processing the layer definitions.

This class provides method to retrieve data specific for layer definition e.g., the name of the layer based on its ID or the layer ID based on its name. It can also export/import the layer definitions to/from a file.

GetIDByShortName staticmethod

GetIDByShortName(shortName: str, doc: DocumentAdapter) -> int

Get the ID by the short name

Parameters:

  • shortName (str) –

    Short name of the layer

  • doc (DocumentAdapter) –

    Document

Returns:

  • int

    ID by name

GetNameByID staticmethod

GetNameByID(layerID: int, documentID: int) -> str

Get the name by the ID

Parameters:

  • layerID (int) –

    Layer ID

  • documentID (int) –

    Document ID

Returns:

  • str

    Name by ID

GetShortNameByID staticmethod

GetShortNameByID(layerID: int, documentID: int) -> str

Get the short name by the ID

Parameters:

  • layerID (int) –

    Layer ID

  • documentID (int) –

    Document ID

Returns:

  • str

    Name by ID

LoadFromFavoriteFile staticmethod

LoadFromFavoriteFile(doc: DocumentAdapter, fileName: str) -> bool

Load the layer data from a favorite file

Parameters:

Returns:

  • bool

    Data are loaded: true/false

SaveToFavoriteFile staticmethod

SaveToFavoriteFile(doc: DocumentAdapter, fileName: str) -> bool

Save the layer data to a favorite file

Parameters:

Returns:

  • bool

    Data are saved: true/false

Placeholder