sir3stoolkit.core package

Submodules

sir3stoolkit.core.wrapper module

Created on Fri Nov 22 14:46:49 2024

@author: Giriyan

sir3stoolkit.core.wrapper.Initialize_Toolkit(basePath: str)[source]
class sir3stoolkit.core.wrapper.SIR3S_Model[source]

Bases: object

AddNewBypassElement(tkCont: str, tkFrom: str, x: float64, y: float64, z: float32, symbolFactor: float64, elementType, idRef: str, description: str) str[source]

Inserts a new bypass element.

Parameters:
  • tkCont (str) – The TK of the container (view) in which the new object shall be inserted. Entering a value of “-1” means the main view of the model.

  • tkFrom (str) – Tk (key) of the start node.

  • x (np.float64) – X coordinate.

  • y (np.float64) – Y coordinate.

  • z (np.float32) – Z coordinate.

  • symbolFactor (np.float64) – The symbol factor of the new node.

  • elementType (Interfaces.Sir3SObjectTypes) – Element type.

  • idRef (str) – ID in reference system.

  • description (str) – Description.

Returns:

The key (TK) of the added bypass element, otherwise ‘-1’ if something went wrong.

Return type:

str

Description:

Comfortable method for inserting a new bypass element.

AddNewConnectingElement(tkCont: str, tkFrom: str, tkTo: str, x: float64, y: float64, z: float32, elementType, dn: float32, symbolFactor: float64, angleDegree: float32, idRef: str, description: str) str[source]

Inserts a new connecting element.

Parameters:
  • tkCont (str) – The TK of the container (view) in which the new object shall be inserted. Entering a value of “-1” means the main view of the model.

  • tkFrom (str) – Tk (key) of the start node.

  • tkTo (str) – Tk (key) of the end node.

  • x (np.float64) – X coordinate.

  • y (np.float64) – Y coordinate.

  • z (np.float32) – Z coordinate.

  • elementType (Interfaces.Sir3SObjectTypes) – Element type.

  • dn (np.float32) – The nominal diameter or the Tk of the nominal diameter.

  • symbolFactor (np.float64) – The symbol factor of the new node.

  • angleDegree (np.float32) – The symbol angle in degrees.

  • idRef (str) – ID in reference system.

  • description (str) – Description.

Returns:

The key (TK) of the added connecting element, otherwise ‘-1’ if something went wrong.

Return type:

str

Description:

Comfortable method for inserting a new connecting element.

AddNewNode(tkCont: str, name: str, typ: str, x: float64, y: float64, z: float32, qm_PH: float32, symbolFactor: float64, description: str, idRef: str, kvr: int) str[source]

Inserts a new node.

Parameters:
  • tkCont (str) – The TK of the container (view) in which the new object shall be inserted. Entering a value of “-1” means the main view of the model.

  • name (str) – Name of the new node.

  • typ (str) – Type of the new node.

  • x (np.float64) – X coordinate.

  • y (np.float64) – Y coordinate.

  • z (np.float32) – Geodetic height.

  • qm_PH (np.float32) – Value for extraction/feeding (in case QKON) or pressure (in case PKON or PKQN).

  • symbolFactor (np.float64) – The symbol factor of the new node.

  • description (str) – Description.

  • idRef (str) – ID in reference system.

  • kvr (int) – SL/RL flag. Should be 0 (undefined), 1 (SL) or 2 (RL).

Returns:

The key (TK) of the added node, otherwise ‘-1’ if something went wrong.

Return type:

str

Description:

Comfortable method for inserting a new node.

AddNewPipe(tkCont: str, tkFrom: str, tkTo: str, L: float32, linestring: str, material: str, dn: str, roughness: float32, idRef: str, description: str, kvr: int) str[source]

Inserts a new pipe.

Parameters:
  • tkCont (str) – The TK of the container (view) in which the new object shall be inserted. Entering a value of “-1” means the main view of the model.

  • tkFrom (str) – Tk (key) of the start node.

  • tkTo (str) – Tk (key) of the end node.

  • L (np.float32) – The pipe length, mandatory for computation.

  • linestring (str) – An optional string with intermediate points for geometry formatted like ‘LINESTRING (120 76, 500 300, 620 480)’. The insert points of from and to will be added on both ends of the geometry.

  • material (str) – Name or Tk (key) of the pipe diameter table.

  • dn (str) – The nominal diameter or the Tk of the nominal diameter.

  • roughness (np.float32) – Roughness of pipe.

  • description (str) – Description.

  • idRef (str) – ID in reference system.

  • kvr (int) – SL/RL flag. Should be 0 (undefined), 1 (SL) or 2 (RL).

Returns:

The key (TK) of the added pipe, otherwise ‘-1’ if something went wrong.

Return type:

str

Description:

Comfortable method for inserting a new pipe.

AddTableRow(tablePkTk: str)[source]

Adds a row to the specified table.

Parameters:

tablePkTk (str) – Key of the table.

Returns:

Tk of the inserted row and object type.

Return type:

tuple[str, Interfaces.SirDBProviderType]

Description:

This is a wrapper method for AddTableRow() from toolkit; Watch out for errors for more information.

AlignElement(elementKey: str)[source]

Aligns the specified element.

Parameters:

elementKey (str) – Key of the symbol-object.

Returns:

None

Return type:

None

Description:

This is a wrapper method for AlignElement() from toolkit; Watch out for errors for more information.

AllowSirMessageBox(bAllow: bool)[source]

Use this method for allowing SIR DB Message Boxes to pop or not

Parameters:

bAllow – Allow/not allow

Returns:

None

Return type:

None

Description:

This is a wrapper method for AllowSirMessageBox() from toolkit

ConnectBypassElementWithNode(Tk: str, keyOfNodeI: str)[source]

Connects the specified bypass element with a node.

Parameters:
  • Tk (str) – Tk of the connecting object.

  • keyOfNodeI (str) – Tk of node I (element that needs to be connected).

Returns:

None

Return type:

None

Description:

This is a wrapper method for ConnectBypassElementWithNode() from toolkit; Watch out for errors for more information.

ConnectConnectingElementWithNodes(Tk: str, keyOfNodeI: str, keyOfNodeK: str)[source]

Connects the specified connecting element with nodes.

Parameters:
  • Tk (str) – Tk of the connecting object.

  • keyOfNodeI (str) – Tk of node I (one of the elements that needs to be connected).

  • keyOfNodeK (str) – Tk of node K (other element that needs to be connected).

Returns:

None

Return type:

None

Description:

This is a wrapper method for ConnectConnectingElementWithNodes() from toolkit; Watch out for errors for more information.

DeleteElement(Tk: str)[source]

Deletes the specified element.

Parameters:

Tk (str) – The pk/tk of the element to be deleted.

Returns:

None

Return type:

None

Description:

This is a wrapper method for DeleteElement() from toolkit; Watch out for errors for more information.

EndEditSession()[source]

End the current edit session.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for EndEditSession() from toolkit. Use it after StartEditSession() to close that session.

EndTransaction()[source]

End the current transaction.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for EndTransaction() from toolkit. Use it after StartTransaction() to close that transaction.

ExecCalculation(waitForSirCalcToExit: bool)[source]

Executes the model calculation.

Parameters:

waitForSirCalcToExit (bool) – Do you want to wait for SirCalc engine to exit before proceeding?

Returns:

None

Return type:

None

Description:

This is a wrapper method for ExecCalculation() from toolkit; Watch out for errors for more information.

GetCurrentTimeStamp() str[source]

Returns the value of the current time stamp.

Returns:

Current time stamp.

Return type:

str

Description:

This is a wrapper method to access the get method for the property CurrentTimestamp from toolkit.

GetElementInfo(Tk: str)[source]

Gets the element information.

Parameters:

Tk (str) – The pk/tk of the element in question.

Returns:

None

Return type:

None

Description:

This is a wrapper method for GetElementInfo() from toolkit; Watch out for errors for more information.

GetEndNodes(Tk: str) tuple[str, str, str, str][source]

General Methot for getting the Tk (keys) of Endnodes connected to an Element. In SIR 3S, they exists Elements that have: Only 1 Endnodes (i.e. Tanks, Air Valves, …) : Bypass Elements in General

2 Endnodes (i.e. Pipes, Pumps, Flap Valves, …): Connecting Elements in General 4 Endnodes (Heat Exchangers)

This Method always return for unconnected or non-existent Sides a fkkX Value of ‘-1’

Parameters:

Tk (str) – The Tk (key) of the Element we need to retrieve the Endnodes

Returns:

fkKI, fkKK, fkKI2, fkKK2

Return type:

tuple[str, str, str, str]

Description:

This is a wrapper method for GetEndNodes() from toolkit

GetGeometryInformation(Tk: str) str[source]

Extracts the geometry information of an element using its TK.

Parameters:

Tk (str) – TK of the element whose geometry information is needed.

Returns:

Geometry information of the element.

Return type:

str

Description:

This is a wrapper method for GetGeometryInformation() from toolkit; Watch out for error messages for more information.

GetMainContainer()[source]

Finds the main container of the model and returns its Key (TK).

Returns:

Tk of the main container and object type.

Return type:

tuple[str, Interfaces.Sir3SObjectTypes]

Description:

This is a wrapper method for GetMainContainer() from toolkit.

GetMaxResult(elementType, propertyName: str) tuple[str, str, str][source]

Gets the maximal result value of an element type and also the key (tk/pk) of the corresponding element.

Parameters:
  • elementType (Interfaces.Sir3SObjectTypes) – The element type.

  • propertyName (str) – The name of the result property.

Returns:

The maximal result value of an element type, the key (tk/pk) of the corresponding element, and the data type of the result.

Return type:

tuple[str, str, str]

Description:

This is a wrapper method for GetMaxResult() from toolkit; Watch out for errors for more information.

GetMaxResult_for_timestamp(timestamp: str, elementType, propertyName: str) tuple[str, str, str][source]

Gets the maximal result value of an element type at a particular timestamp and also the key (tk/pk) of the corresponding element.

Parameters:
  • timestamp (str) – The timestamp for which result is needed.

  • elementType (Interfaces.Sir3SObjectTypes) – The element type.

  • propertyName (str) – The name of the result property.

Returns:

The maximal result value of an element type at a particular timestamp, the key (tk/pk) of the corresponding element, and the data type of the result.

Return type:

tuple[str, str, str]

Description:

This is a wrapper method for GetMaxResult() from toolkit; Watch out for errors for more information.

GetMinResult(elementType, propertyName: str) tuple[str, str, str][source]

Gets the minimal result value of an element type and also the key (tk/pk) of the corresponding element.

Parameters:
  • elementType (Interfaces.Sir3SObjectTypes) – The element type.

  • propertyName (str) – The name of the result property.

Returns:

The minimal result value of an element type, the key (tk/pk) of the corresponding element, and the data type of the result.

Return type:

tuple[str, str, str]

Description:

This is a wrapper method for GetMinResult() from toolkit; Watch out for errors for more information.

GetMinResult_for_timestamp(timestamp: str, elementType, propertyName: str) tuple[str, str, str][source]

Gets the minimal result value of an element type at a particular timestamp and also the key (tk/pk) of the corresponding element.

Parameters:
  • timestamp (str) – The timestamp for which result is needed.

  • elementType (Interfaces.Sir3SObjectTypes) – The element type.

  • propertyName (str) – The name of the result property.

Returns:

The minimal result value of an element type at a particular timestamp, the key (tk/pk) of the corresponding element, and the data type of the result.

Return type:

tuple[str, str, str]

Description:

This is a wrapper method for GetMinResult() from toolkit; Watch out for errors for more information.

GetNetworkType()[source]

Gets the network type.

Returns:

Network type defined in the enum.

Return type:

Interfaces.NetworkType

Description:

This is a wrapper method for GetNetworkType() from toolkit.

GetNumberOfElements(ElementType) int[source]

Gets the total number of elements of the specified type.

Parameters:

ElementType (Interfaces.Sir3SObjectTypes) – Object type defined in the enum.

Returns:

Total number of elements of type ‘ElementType’.

Return type:

int

Description:

This is a wrapper method for GetNumberOfElements() from toolkit.

GetObjectTypeof_Key(Key: str)[source]

Gets the type of object the input Key belongs to.

Parameters:

Key (str) – The pk/tk of the element in question.

Returns:

Type of object the input Key belongs to.

Return type:

Interfaces.Sir3SObjectTypes

Description:

This is a wrapper method for GetObjectTypeOf_Key() from toolkit; Watch out for errors for more information.

GetPropertiesofElementType(ElementType) list[source]

Gets all properties belonging to the element of the specified type.

Parameters:

ElementType (Interfaces.Sir3SObjectTypes) – Object type defined in the enum.

Returns:

List of all properties belonging to the element of type ‘ElementType’.

Return type:

list

Description:

This is a wrapper method for GetPropertyNames() from toolkit.

GetResultProperties_from_elementKey(elementKey: str) list[source]

Gets the result properties for the specified element key.

Parameters:

elementKey (str) – The element key.

Returns:

List of all result property names of an element.

Return type:

list

Description:

This is a wrapper method for GetResultProperties() from toolkit; Watch out for errors for more information.

GetResultProperties_from_elementType(elementType, onlySelectedVectors: bool) list[source]

Gets the result properties for the specified element type.

Parameters:
  • elementType (Interfaces.Sir3SObjectTypes) – The element type.

  • onlySelectedVectors (bool) – If True, only the names of selected vector channels for this element type shall be returned, otherwise all possible result property names for this element type shall be returned.

Returns:

List of result property names of an element type.

Return type:

list

Description:

This is a wrapper method for GetResultProperties() from toolkit; Watch out for errors for more information.

GetResultValue(elementKey: str, propertyName: str) tuple[str, str][source]

Gets the result value for the given element’s property.

Parameters:
  • elementKey (str) – Key of the symbol-object.

  • propertyName (str) – The name of the result property.

Returns:

Value for the given element’s property and type of the value returned.

Return type:

tuple[str, str]

Description:

This is a wrapper method for GetResultValue() from toolkit; Watch out for errors for more information.

GetTableRows(tablePkTk: str)[source]

Gets all rows of the specified table.

Parameters:

tablePkTk (str) – Key of the table.

Returns:

List of Tk’s of all rows of the table and object type.

Return type:

tuple[list, Interfaces.SirDBProviderType]

Description:

This is a wrapper method for GetTableRows() from toolkit; Watch out for errors for more information.

GetTimeStamps() tuple[list, str, str, str][source]

Gets all available timestamps as ISO formatted strings.

Returns:

Array with all available timestamps as ISO formatted strings.

Return type:

tuple[list, str, str, str]

Description:

This is a wrapper method for GetTimeStamps() from toolkit; Watch out for errors for more information.

GetTkFromIDReference(IdRef: str, object_type) str[source]

Extracts the TK of an element using its ID reference.

Parameters:
  • IdRef (str) – ID reference of the element.

  • object_type (Interfaces.Sir3SObjectTypes) – Type of the element (like Node, Pipe, Valve, etc.).

Returns:

TK of the element.

Return type:

str

Description:

This is a wrapper method for GetTkFromIDReference() from toolkit; Watch out for error messages for more information.

GetTksofElementType(ElementType) list[source]

Gets all Tk’s belonging to the elements of the specified type.

Parameters:

ElementType (Interfaces.Sir3SObjectTypes) – Object type defined in the enum.

Returns:

List of all Tk’s belonging to the elements of type ‘ElementType’.

Return type:

list

Description:

This is a wrapper method for GetAllElementKeys() from toolkit.

GetValue(Tk: str, propertyName: str) tuple[str, str][source]

Gets the value for the given element’s property.

Parameters:
  • Tk (str) – The pk/tk of the element in question.

  • propertyName (str) – Property of the element for which you want the value.

Returns:

Value and type of the value returned.

Return type:

tuple[str, str]

Description:

This is a wrapper method for GetValue() from toolkit; Watch out for error message for more information.

InsertElement(ElementType, IdRef: str) str[source]

Inserts a new element of the specified type.

Parameters:
  • ElementType (Interfaces.Sir3SObjectTypes) – Object type defined in the enum to be inserted.

  • IdRef (str) – Id reference.

Returns:

Tk of the element inserted.

Return type:

str

Description:

This is a wrapper method for InsertElement() from toolkit; Watch out for errors for more information.

IsMainContainer(fkCont: str) bool[source]

Tests if the provided Key (TK) is the Key of the main container of the model.

Parameters:

fkCont (str) – Tk of the object in question.

Returns:

Boolean value indicating if it is the main container.

Return type:

bool

Description:

This is a wrapper method for IsMainContainer() from toolkit.

NewModel(dbName: str, providerType, netType, modelDescription: str, namedInstance: str, userID: str, password: str)[source]

Creates a new model.

Parameters:
  • dbName (str) – Full path to the database file.

  • providerType (Interfaces.SirDBProviderType) – Provider type from the enum.

  • netType (Interfaces.NetworkType) – Network type.

  • modelDescription (str) – Description of the model to be created.

  • namedInstance (str) – Instance name of the SQL Server.

  • userID (str) – User ID for authentication, only needed for ORACLE and for SQLServer only if SQLServer authentication is required.

  • password (str) – Password for authentication, only needed for ORACLE and for SQLServer only if SQLServer authentication is required.

Returns:

None

Return type:

None

Description:

This is a wrapper method for NewModel() from toolkit; Watch out for errors for more information.

OpenModel(dbName: str, providerType, Mid: str, saveCurrentlyOpenModel: bool, namedInstance: str, userID: str, password: str)[source]

Opens a model from a database file.

Parameters:
  • dbName (str) – Full path to the database file.

  • providerType (Interfaces.SirDBProviderType) – Provider type from the enum.

  • Mid (str) – Model identifier.

  • saveCurrentlyOpenModel (bool) – Do you want to save the current model before closing it?

  • namedInstance (str) – Instance name of the SQL Server.

  • userID (str) – User ID for authentication, only needed for ORACLE and for SQLServer only if SQLServer authentication is required.

  • password (str) – Password for authentication, only needed for ORACLE and for SQLServer only if SQLServer authentication is required.

Returns:

None

Return type:

None

Description:

This is a wrapper method for OpenModel() from toolkit; Watch out for errors for more information.

OpenModelXml(Path: str, SaveCurrentModel: bool)[source]

Opens a model from an XML file.

Parameters:
  • Path (str) – Path to XML file.

  • SaveCurrentModel (bool) – Do you want to save the current model before closing it?

Returns:

None

Return type:

None

Description:

This is a wrapper method for OpenModelXml() from toolkit; Watch out for error message for more information.

RefreshViews()[source]

Refreshes the views.

Returns:

None

Return type:

None

Description:

This is a wrapper method for RefreshViews() from toolkit; Watch out for errors for more information.

SaveChanges()[source]

Saves changes made to the model.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SaveChanges() from toolkit; Use it after End{EditSession/Transaction}. Watch out for errors for more information.

SetCurrentTimeStamp(timestamp: str)[source]

Sets the current time stamp.

Parameters:

timestamp (str) – Time stamp value to be set.

Returns:

None

Return type:

None

Description:

This is a wrapper method to access the set method for the property CurrentTimestamp from toolkit.

SetElementColor(elementKey: str, color: int, fillOrLineColor: bool)[source]

Sets the color of the specified element using an RGB integer representation.

Parameters:
  • elementKey (str) – Key of the symbol-object.

  • color (int) – The RGB integer representation of the color (COLORREF in GDI).

  • fillOrLineColor (bool) – True if the filling color is to be set, False if only the line color is to be set.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetElementColor() from toolkit; Watch out for errors for more information.

SetElementColor_RGB(elementKey: str, red: int, green: int, blue: int, fillOrLineColor: bool)[source]

Sets the color of the specified element using RGB values.

Parameters:
  • elementKey (str) – Key of the symbol-object.

  • red (int) – The R-part of the color (0…255).

  • green (int) – The G-part of the color (0…255).

  • blue (int) – The B-part of the color (0…255).

  • fillOrLineColor (bool) – True if the filling color is to be set, False if only the line color is to be set.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetElementColor() from toolkit; Watch out for errors for more information.

SetGeometryInformation(Tk: str, Wkt: str) bool[source]

Sets the geometry information of an element using its TK.

Parameters:
  • Tk (str) – TK of the element whose geometry information needs to be set.

  • Wkt (str) – Geometry information to be set in the format of WKT.

Returns:

True if geometry information is set, False otherwise.

Return type:

bool

Description:

This is a wrapper method for SetGeometryInformation() from toolkit; Watch out for error messages for more information.

SetInsertPoint(elementKey: str, x: float64, y: float64)[source]

Sets the insert point of a symbol-object.

Parameters:
  • elementKey (str) – Key of the symbol-object.

  • x (np.float64) – x-coordinate for the object.

  • y (np.float64) – y-coordinate for the object.

Returns:

None

Return type:

None

Description:

Set the insert point of a symbol-object (e.g., Node, Valve, Tank, etc.). The insert point is the position on which the object is placed in the view.

SetValue(Tk: str, propertyName: str, Value: str)[source]

Sets the value for the given element’s property.

Parameters:
  • Tk (str) – The pk/tk of the element in question.

  • propertyName (str) – Property of the element for which you want to set the value.

  • Value (str) – Value to be set.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetValue() from toolkit; Watch out for error message for more information.

StartEditSession(SessionName: str)[source]

Start an edit session with the given session name.

Parameters:

SessionName (str) – A meaningful name to start a session.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for StartEditSession() from toolkit.

StartTransaction(SessionName: str)[source]

Start a transaction with the given session name.

Parameters:

SessionName (str) – A meaningful name to start a transaction; Empty string or None will lead to error.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for StartTransaction() from toolkit.

class sir3stoolkit.core.wrapper.SIR3S_View[source]

Bases: object

AddExternalArrow(x: float64, y: float64, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool, symbolFactor: float64, containerTK: str)[source]

Adds an external arrow.

Parameters:
  • x (np.float64) – x-coordinate of the arrow.

  • y (np.float64) – y-coordinate of the arrow.

  • lineColor (int) – Color of the arrow’s line.

  • fillColor (int) – Fill color of the arrow.

  • lineWidthMM (np.float64) – Width of the arrow’s line in mm.

  • isFilled (bool) – Boolean indicating if the arrow is filled.

  • symbolFactor (np.float64) – Symbol factor of the arrow.

  • containerTK (str) – Key of the container.

Returns:

Tk of the added arrow.

Return type:

str

Description:

This is a wrapper method for AddExternalArrow() from toolkit; Watch out for errors for more information.

AddExternalEllipse(left: float64, top: float64, right: float64, bottom: float64, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool, containerTK: str) str[source]

Adds an external ellipse element.

Parameters:
  • left (np.float64) – Left coordinate of the ellipse.

  • top (np.float64) – Top coordinate of the ellipse.

  • right (np.float64) – Right coordinate of the ellipse.

  • bottom (np.float64) – Bottom coordinate of the ellipse.

  • lineColor (int) – Color of the ellipse’s line.

  • fillColor (int) – Fill color of the ellipse.

  • lineWidthMM (np.float64) – Width of the ellipse’s line in mm.

  • isFilled (bool) – Boolean indicating if the ellipse is filled.

  • containerTK (str) – Key of the container.

Returns:

Tk of the added ellipse.

Return type:

str

Description:

This is a wrapper method for AddExternalEllipse() from toolkit; Watch out for errors for more information.

AddExternalPolygon(xArray: list, yArray: list, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool, containerTK: str) str[source]

Adds an external polygon.

Parameters:
  • xArray (list) – List of x coordinates.

  • yArray (list) – List of y coordinates.

  • lineColor (int) – Color of the polygon’s line.

  • fillColor (int) – Fill color of the polygon.

  • lineWidthMM (np.float64) – Width of the polygon’s line in mm.

  • isFilled (bool) – Boolean indicating if the polygon is filled.

  • containerTK (str) – Key of the container.

Returns:

Tk of the added polygon.

Return type:

str

Description:

This is a wrapper method for AddExternalPolygon() from toolkit; Watch out for errors for more information.

AddExternalPolygonPoint(Tk: str, x: float64, y: float64)[source]

Adds a point to an external polygon.

Parameters:
  • Tk (str) – Key of the polygon.

  • x (np.float64) – x-coordinate of the point.

  • y (np.float64) – y-coordinate of the point.

Returns:

None

Return type:

None

Description:

This is a wrapper method for AddExternalPolygonPoint() from toolkit; Watch out for errors for more information.

AddExternalPolyline(xArray: list, yArray: list, iColor: int, lineWidthMM: float64, dashedLine: bool, containerTK: str) str[source]

Adds an external polyline.

Parameters:
  • xArray (list) – List of x coordinates.

  • yArray (list) – List of y coordinates.

  • iColor (int) – Color of the polyline.

  • lineWidthMM (np.float64) – Width of the polyline in mm.

  • dashedLine (bool) – Boolean indicating if the polyline is dashed.

  • containerTK (str) – Key of the container.

Returns:

Tk of the added polyline.

Return type:

str

Description:

This is a wrapper method for AddExternalPolyline() from toolkit; Watch out for errors for more information.

AddExternalPolylinePoint(Tk: str, x: float64, y: float64)[source]

Adds a point to an external polyline.

Parameters:
  • Tk (str) – Key of the polyline.

  • x (np.float64) – x-coordinate of the point.

  • y (np.float64) – y-coordinate of the point.

Returns:

None

Return type:

None

Description:

This is a wrapper method for AddExternalPolylinePoint() from toolkit; Watch out for errors for more information.

AddExternalRectangle(left: float64, top: float64, right: float64, bottom: float64, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool, isRounded: bool, containerTK: str)[source]

Adds an external rectangle element.

Parameters:
  • left (np.float64) – Left coordinate of the rectangle.

  • top (np.float64) – Top coordinate of the rectangle.

  • right (np.float64) – Right coordinate of the rectangle.

  • bottom (np.float64) – Bottom coordinate of the rectangle.

  • lineColor (int) – Color of the rectangle’s line.

  • fillColor (int) – Fill color of the rectangle.

  • lineWidthMM (np.float64) – Width of the rectangle’s line in mm.

  • isFilled (bool) – Boolean indicating if the rectangle is filled.

  • isRounded (bool) – Boolean indicating if the rectangle is rounded.

  • containerTK (str) – Key of the container.

Returns:

Tk of the added rectangle.

Return type:

str

Description:

This is a wrapper method for AddExternalRectangle() from toolkit; Watch out for errors for more information.

AddExternalText(x: float64, y: float64, textColor: int, text: str, angleDegree: float32, heightPt: float32, isBold: bool, isItalic: bool, isUnderline: bool, containerTK: str)[source]

Adds external text.

Parameters:
  • x (np.float64) – x-coordinate of the text.

  • y (np.float64) – y-coordinate of the text.

  • textColor (int) – Color of the text.

  • text (str) – The text content.

  • angleDegree (np.float32) – Angle of the text in degrees.

  • heightPt (np.float32) – Height of the text in points.

  • isBold (bool) – Boolean indicating if the text is bold.

  • isItalic (bool) – Boolean indicating if the text is italic.

  • isUnderline (bool) – Boolean indicating if the text is underlined.

  • containerTK (str) – Key of the container.

Returns:

Tk of the added text.

Return type:

str

Description:

This is a wrapper method for AddExternalText() from toolkit; Watch out for errors for more information.

AddNewCustomer(x: float64, y: float64, z: float32, symbolFactor: float64, fkHouse: str, consumption: float64, counterId: str, customerId: str, dimension: str, divisionType: str, customerGroup: str, idRef: str) str[source]

Method for inserting a new Customer within the main Container of the Model

Parameters:
  • x (np.float64) – Absolute x-Coordinate of the Customer

  • y (np.float64) – Absolute y-Coordinate of the Customer

  • z (np.float32) – Absolute z-Coordinate of the Customer

  • symbolFactor (np.float64) – The Symbol Factor

  • fkHouse (str) – The tk (Key) of the House the Customer is attached to (or empty String or ‘-1’ if none)

  • consumption – Consumption Value Q0 (NODE) or W0 (DH-Consumer).

The consumption Value can have different Dimensions.In Water usually Qa - i.e. [m^3/ a]. In Gas[Nm^3/ a]. In heat, it is usually a power in [kW] or[MW]. :type consumption: np.float64 :param counterId: ID point of consumption (from reference data for identification). max 40 Characters :type counterId: str :param customerId: ID of the Customer who is the contractual Partner of the CC for this point of consumption (from reference data for identification). max 40 Characters :type customerId: str :param dimension: Dimension of consumption m3/a, Nm3/a, kW, kWh, MW or MWh, max 12 Characters :type dimension: str :param divisionType: Division type, max 12 Characters ( should be ‘W-’, ‘W+’, ‘F-’, ‘G-’ or ‘K-’ depending on Netrworkm type);

W- = consumer in the water network (outflow); W+ = “consumer” in the collection network (inflow); F- = consumer in the district heating network (W0); G- = consumer in the gas network (outflow); K- = consumer in the refrigeration network;

Parameters:
  • customerGroup (str) – Name of Customer Group, just to differenciate Customers, max 80 Characters

  • idRef (str) – ID n Reference System, max 40 Characters

Returns:

returns the TK of the newly inserted Customer, otherwise ‘-1’.

Return type:

str

Description:

This is a wrapper method for AddNewCustomer() from toolkit; Watch out for errors for more information.

AddNewDirectionalArrow(tkCont: str, x: float64, y: float64, lineColor: int, lineWidth: float64, fillColor: int, isFilled: bool, symbolFactor: float64, description: str, tkObserved: str, elemResultProperty: str, EPS: float32)[source]

Adds an external arrow.

Parameters:
  • tkCont (str) – The (tk) key of the Container

  • x (np.float64) – x-coordinate of the directional arrow.

  • y (np.float64) – y-coordinate of the directional arrow.

  • lineColor (int) – Color of the directional arrow’s line.

  • lineWidth (np.float64) – Width of the arrow’s line in mm.

  • fillColor (int) – Fill color of the arrow.

  • isFilled (bool) – Boolean indicating if the arrow is filled.

  • symbolFactor (np.float64) – Symbol factor of the arrow.

  • description (str) – The Description, max 254 Characters

  • tkObserved (str) – The Tk (key) of the Element this array shall be bound to

  • elemResultProperty (str) – The Property Name of a Result on the bound Element

  • EPS – Display Tolerance.

Arrow direction is only displayed if the absolute value of the data point Result value is greater than the specified tolerance :type EPS: np.float32 :return: Tk of the added directional arrow. :rtype: str :description: This is a wrapper method for AddNewDirectionalArrow() from toolkit; Watch out for errors for more information.

AddNewHouse(x: float64, y: float64, symbolFactor: float64, fkStreet: str, houseNumber: int, numberSuffix: int, postalCode: int, dsn: str, fkNode: str, fkDH_Customer: str, idRef: str)[source]

Method for inserting a new House within the main Container of the Model

Parameters:
  • x (np.float64) – Absolute x-Coordinate of the House

  • y (np.float64) – Absolute y-Coordinate of the House

  • symbolFactor (np.float64) – The Symbol Factor

  • fkStreet (str) – The tk (Key) of the Street if any (or just an emty String ot ‘-1’ if none)

  • houseNumber (int) – The House number

  • numberSuffix (int) – The house Number Suffix, max. 40 characters

  • postalCode (int) – The Postal Code

  • dsn (str) – The official Number of the Street (if known), max. 80 Characters

  • fkNode (str) – Only for non-District Heating Networks: The tk (key) of the Node connected to the House (if any)

  • fkDH_Customer (str) – Only for District Heating Networks: The tk (key) of the DH Consumer connected to the House (if any)

  • idRef (str) – User-defined Reference ID

Returns:

returns the TK of the newly inserted House, otherwise ‘-1’.

Return type:

str

Description:

This is a wrapper method for AddNewHouse() from toolkit; Watch out for errors for more information.

AddNewHydrant(x: float64, y: float64, z: float64, iType, symbolFactor: float64, fkNode: str, L: float32, dn: float32, roughness: float32, ph_min: float32, ph_soll: float32, qm_soll, activity, idRef: str, name: str, description: str)[source]

Method for inserting a new Customer within the main Container of the Model

Parameters:
  • x (np.float64) – The X-Coordinate of the Hydrant

  • y (np.float64) – The Y-Coordinate of the Hydrant

  • z (np.float32) – The Z-Coordinate of the Hydrant

  • iType (Interfaces.Hydrant_Type) –

    Type of Hydrant. Possible Value are:

    1 = Subsurface

    11 = Surface

  • symbolFactor (np.float64) – The Symbol Factor

  • fkNode (str) – The tk (key) of a Node within the main Comntainer if the Hydrant is attached to a Node

  • L (np.float32) – Length of the Connection Pipe

  • dn (np.float32) – Nominal Diameter of the Hydrant in [mm]

  • roughness (np.float32) – Roughness coefficient (k-value) Connecting pipe

  • ph_min (np.float32) – Minimum pressure at the tapping point

  • ph_soll (np.float32) – Set pressure at the binding point

  • qm_soll (Interfaces.Hydrant_QM_SOLL) – Target extraction quantity

  • activity (Interfaces.Hydrant_Activity) – Activity status (0=inactive | 1=calculated in the extinguishing water plugin | 2=calculated)

  • idRef (str) – Reference ID

  • name (str) – Name of the Hydrant, max 40 Characters

  • description (str) – Description, max 254 Characters

Returns:

returns the TK of the newly inserted Hydrant, otherwise ‘-1’.

Return type:

str

Description:

This is a wrapper method for AddNewHydrant() from toolkit; Watch out for errors for more information.

AddNewNumericalDisplay(tkCont: str, x: float64, y: float64, color: int, angle_degree: float32, faceName: str, heightPt: float32, isBold: bool, isItalic: bool, isUnderlined: bool, description: str, forResult: bool, tkObserved: str, elemPropertyNameOrResult: str, prefix: str, unit: str, numDec: int, absValue: bool) str[source]

Method for inserting a new numerical Display into a Container

Parameters:
  • tkCont (str) – The (tk) key of the Container to insert the numerical Display in

  • x – Absolute x-Coordinate of the numerical Displa (left)

  • dY (np.float64) – Absolute y-Coordinate of the numerical Displa (bottom)

  • color (int) – The desired Color as RGB

  • angle_degree (np.float32) – Angle in Degree

  • faceName – Face Name of the Font (max. 32 Characters). Entering a non-installed

Face Name will assume it to be ‘Arial’ :type faceName: str :param heightPt: The height in Point :type heightPt: np.float32 :param isBold: True if the Font should be bold :type isBold: bool :param isItalic: True if the Font should be italic :type isItalic: bool :param isUnderlined: True if the Font should be underlined :type isUnderlined: bool :param description: Description of Text. Max 254 Characters :type description: str :param forResult: True if it should display a Calculation Result of an Element, False if it should display an Element Property :type forResult: bool :param tkObserved: The tk (Key) of the Element observed by this num. Display :type tkObserved: str :param elemPropertyNameOrResult: a String representing the Result-Property or the Element Property Name, depending on Parameter ‘forResult’. eg. “L” if a Pipe Length is observed or “QMAV” for the Result ‘Average Flow Rate’ on Pipe. :type elemPropertyNameOrResult: str :param prefix: Prefix (precedes the Text), max. 80 Characters :type prefix: str :param unit: User-defined Unit, max. 80 Characters :type unit: str :param numDec: Number of Decimals Digits :type numDec: str :param absValue: True if a absolute Value should be displayed :type absValue: bool :return: The TK of the newly inserted numerical display, otherwise ‘-1’. :rtype: str :description: This is a wrapper method for AddNewNumericalDisplay() from toolkit; Watch out for errors for more information.

AddNewStreet(name: str, number: str, place: str, district: str, idref: str) str[source]

Method for adding a new Street

Parameters:
  • name (str) – Street Name, max. 80 Characters

  • number (str) – Street Number, max. 80 characters (it may be a official Number)

  • place (str) – The name of the Place hosting the Street, max. 80 characters

  • district (str) – The name of the District under the Place, max. 80 characters

  • idref (str) – Reference ID, max. 40 characters

Returns:

returns the TK of the newly inserted Street, otherwise ‘-1’.

Return type:

str

Description:

This is a wrapper method for AddNewStreet() from toolkit; Watch out for errors for more information.

AddNewText(tkCont: str, x: float64, y: float64, color: int, textContent: str, angle_degree: float32, faceName: str, heightPt: float32, isBold: bool, isItalic: bool, isUnderlined: bool, idRef: str, description: str) str[source]

Method for inserting a new Text within a Container

Parameters:
  • tkCont (str) – The (tk) key of the Container to insert the Text in

  • x – Absolute x-Coordinate of the Text (left)

:type x np.float64 :param y: Absolute y-Coordinate of the Text (bottom) :type y: np.float64 :param color: The desired Color as RGB :type color: int :param textContent: The textual Content of the Text. Max 80 Characters :type textContent: str :param angle_degree: Angle in Degree :type angle_degree: np.float32 :param faceName: Face Name of the Font (max. 32 Characters). Entering a non-installed Face Name will assume it to be ‘Arial’ :type faceName: str :param heightPt: The height in Point :type heightPt: np.float32 :param isBold: True if the Font should be bold :type isBold: bool :param isItalic: True if the Font should be italic :type isItalic: bool :param isUnderlined: True if the Font should be underlined :type isUnderlined: bool :param idRef: user-defined Reference ID. Max 40 Characters :type idRef: str :param description: Description of Text. Max 254 Characters :type description: str :return: The TK of the newly inserted Text, otherwise ‘-1’. :rtype: str :description: This is a wrapper method for AddNewText() from toolkit; Watch out for errors for more information.

AddNewValveOnPipe(tkPipe: str, iSymbolType, position: float32, name: str, description: str, isPostureStatic, fkSWVT: str, openClose: bool, idRef: str)[source]

Insert a new Net Valve of Pipe. If the Pipe does’nt lie on the main Container, nothing shall be done.

Parameters:
  • tkPipe (str) – The tk (key) of the Pipe

  • iSymbolType – Symbol Type:

Possible values are:

1 = Gate Valve 2 = Flap Valve 3 = Plug Valve

Parameters:
  • position (np.float32) –

    Position on Pipe: Possible Values are:

    0 = at the Beginning of the Pipe (by Node Ki)

    -1 = at the End of the Pipe (by Node Kk) -2 = at the Middle of the Pipe

    or every Value in the interval [0, L] where L is the technical Length of the Pipe.

  • name (str) – A Name for the Valve, max 40 Characters

  • description (str) – Description of the Valve, max 254 Characters

  • isPostureStatic (Interfaces.NetValvePostures) – Option if the Posture is statically open/closed or time depemdant. Enter NetValvePostures.STATIC_OPEN_CLOSE if Posture is always open / closed otherwise enter NetValvePostures.TIME_DEP_TABLE if the Posture depends on a Setpoint Table (SWVT)

  • fkSWVT (str) – the pk (key) of the SetPoint Table, in Case the Parameter ‘isPostureStatic’ is entered as NetValvePostures.TIME_DEP_TABLE

  • openClose (bool) – Only usable in Case the Parameter ‘isPostureStatic’ is entered as NetValvePostures.STATIC_OPEN_CLOSE. So entering in that case ‘True’, resp. ‘False’ assumes the Valve is always open resp. closed.

  • idRef (str) – Reference ID, max 40 Characters

Returns:

returns the TK of the newly inserted Valve, otherwise ‘-1’.

Return type:

str

Description:

This is a wrapper method for AddNewValveOnPipe() from toolkit; Watch out for errors for more information.

ColoratePipe(Tk: str, lengths: list, Colors: list, widthFactors: list)[source]

Colorates pipe with specified lengths, colors and width factors.

Parameters:
  • Tk (str) – Key of pipe element.

  • lengths (list) – List of lengths to colorate pipe with.

  • Colors (list) – List of colors to colorate pipe with.

  • widthFactors (list) – List of width factors to colorate pipe with.

Returns:

None

Return type:

None

Description:

This is a wrapper method for ColoratePipe() from toolkit; Watch out for errors for more information.

DoColoration()[source]

Performs coloration of elements.

Returns:

None

Return type:

None

Description:

This is a wrapper method for DoColoration() from toolkit; Watch out for errors for more information.

EndEditSession()[source]

End the current edit session.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for EndEditSession() from toolkit. Use it after StartEditSession() to close that session.

EndTransaction()[source]

End the current transaction.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for EndTransaction() from toolkit. Use it after StartTransaction() to close that transaction.

GetColor(valMin: float64, valMax: float64, val: float64) tuple[int, int][source]

Gets color corresponding to specified value within range defined by minimum and maximum values.

Parameters:
  • valMin (np.float64) – Minimum value in range.

  • valMax (np.float64) – Maximum value in range.

  • val (np.float64) – Value to get color for within range defined by min and max values.

Returns:

Color corresponding to specified value within range defined by min and max values and index of color in table.

Return type:

tuple[int, int]

Description:

This is a wrapper method for GetColor() from toolkit; Watch out for errors for more information.

GetColorTableEntries(result_i: float64, result_k: float64, scaleMin: float64, scaleMax: float64) list[source]

Gets color table entries.

Parameters:
  • result_i (np.float64) – Result i value.

  • result_k (np.float64) – Result k value.

  • scaleMin (np.float64) – Minimum scale value.

  • scaleMax (np.float64) – Maximum scale value.

Returns:

List of color table entries.

Return type:

list

Description:

This is a wrapper method for GetColorTableEntries() from toolkit; Watch out for errors for more information.

GetFont(Tk: str) fontInformation[source]

Method for getting font related information

Parameters:

Tk (str) – The tk (key) of the Element

Returns:

return all the properties bundled in a namedtuple ‘fontInformation’

Return type:

fontInformation

Description:

This is a wrapper method for GetFont() from toolkit; Watch out for errors for more information.

GetMainContainer()[source]

Finds the main container of the model and returns its Key (TK).

Returns:

Tk of the main container and object type.

Return type:

tuple[str, Interfaces.Sir3SObjectTypes]

Description:

This is a wrapper method for GetMainContainer() from toolkit; Finds the Main Container of the Model and returns its Key (TK).

GetNumericalDisplayProperties(Tk: str) numericalDisplayProperties[source]

Method for getting Properties of a numerical display

Parameters:

Tk (str) – The tk (key) of the Element

Returns:

return all the properties bundled in a namedtuple ‘numericalDisplayProperties’

Return type:

numericalDisplayProperties

Description:

This is a wrapper method for GetNumericalDisplayProperties() from toolkit; Watch out for errors for more information.

GetTextProperties(Tk: str) textProperties[source]

Method for getting Properties of a Text

Parameters:

Tk (str) – The tk (key) of the Element

Returns:

return all text properties bundled in a namedtuple ‘textProperties’

Return type:

textProperties

Description:

This is a wrapper method for GetTextProperties() from toolkit; Watch out for errors for more information.

GetWidthFactor(actualValue: float64) float64[source]

Gets width factor corresponding to specified actual value.

Parameters:

actualValue (np.float64) – Value to get width factor for.

Returns:

Width factor corresponding to specified actual value.

Return type:

np.float64

Description:

This is a wrapper method for GetWidthFactor() from toolkit; Watch out for errors for more information.

InitColorTable(iColors: list, maxColors: int) bool[source]

Initializes color table with specified colors and maximum colors.

Parameters:
  • iColors (list) – List of colors to initialize table with.

  • maxColors (int) – Maximum number of colors in table.

Returns:

Boolean indicating if color table was initialized successfully.

Return type:

bool

Description:

This is a wrapper method for InitColorTable() from toolkit; Watch out for errors for more information.

MoveElementBy(Tk: str, dX: float64, dY: float64)[source]

General Method for moving an Object by a defined (relative) Amount. This Method only applies to both Symbol-Objects (incl. Texts) and also to Line Objects such as Pipes, Polylines, Polygones. Calling this Method on a Pipe would also move the both End Nodes of the Pipe.

Parameters:
  • Tk (str) – The tk (key) of the Element

  • dX (np.float64) – The Amount of Translation in X-Direction

  • dY (np.float64) – The Amount of Translation in Y-Direction

Returns:

None

Return type:

None

Description:

This is a wrapper method for MoveElementBy() from toolkit; Watch out for errors for more information.

MoveElementTo(Tk: str, newX: float64, newY: float64)[source]

General Method for moving an Object to a specified ABSOLUTE Location. This Method only applies to Symbol-Objects (and Texts). Thus Calling it on Line Objects such as Pipes, Polylines, Polygones has no effect.

Parameters:
  • Tk (str) – The tk (key) of the Element

  • newX (np.float64) – New absolute X-Position

  • newY (np.float64) – New absolute Y-Position

Returns:

None

Return type:

None

Description:

This is a wrapper method for MoveElementTo() from toolkit; Watch out for errors for more information.

OpenModel(dbName: str, providerType, Mid: str, saveCurrentlyOpenModel: bool, namedInstance: str, userID: str, password: str)[source]

Opens a model from a database file.

Parameters:
  • dbName (str) – Full path to the database file.

  • providerType (Interfaces.SirDBProviderType) – Provider type from the enum.

  • Mid (str) – Model identifier.

  • saveCurrentlyOpenModel (bool) – Do you want to save the current model before closing it?

  • namedInstance (str) – Instance name of the SQL Server.

  • userID (str) – User Id for Authentication, only needed for ORACLE and for SQLServer only if SQLServer Authentication is required.

  • password – Password for Authentication, only needed for ORACLE and for SQLServer Authentication is required.

Returns:

None

Return type:

None

Description:

This is a wrapper method for openModel() from toolkit; Watch out for errors for more information.

OpenModelXml(Path: str, SaveCurrentModel: bool)[source]

Opens a model from an XML file.

Parameters:
  • Path (str) – Path to XML file.

  • SaveCurrentModel (bool) – Do you want to save the current model before closing it?

Returns:

None

Return type:

None

Description:

This is a wrapper method for OpenModelXml() from toolkit; Watch out for error message for more information.

PrepareColoration()[source]

Prepares coloration for elements.

Returns:

None

Return type:

None

Description:

This is a wrapper method for PrepareColoration() from toolkit; Watch out for errors for more information.

ResetColoration()[source]

Resets coloration of elements.

Returns:

None

Return type:

None

Description:

This is a wrapper method for ResetColoration() from toolkit; Watch out for errors for more information.

SaveChanges()[source]

Saves changes made to the model.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SaveChanges() from toolkit; Use it after End{EditSession/Transaction}. Watch out for errors for more information.

SetExternalArrowProperties(Tk: str, x: float64, y: float64, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool, symbolFactor: float64)[source]

Sets properties of an external arrow element.

Parameters:
  • Tk (str) – Key of the arrow element.

  • x (np.float64) – x-coordinate of the arrow element.

  • y (np.float64) – y-coordinate of the arrow element.

  • lineColor (int) – Color of the arrow’s line.

  • fillColor (int) – Fill color of the arrow element.

  • lineWidthMM (np.float64) – Width of the arrow’s line in mm.

  • isFilled (bool) – Boolean indicating if the arrow element is filled.

  • symbolFactor (np.float64) – Symbol factor of the arrow element.

Returns:

None

Return type:

None

Description:

This is a wrapper method for AddExternalArrow() from toolkit; Watch out for errors for more information.

SetExternalEllipseProperties(Tk: str, left: float64, top: float64, right: float64, bottom: float64, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool)[source]

Sets properties of an external ellipse element.

Parameters:
  • Tk (str) – Key of the ellipse element.

  • left (np.float64) – Left coordinate of the ellipse.

  • top (np.float64) – Top coordinate of the ellipse.

  • right (np.float64) – Right coordinate of the ellipse.

  • bottom (np.float64) – Bottom coordinate of the ellipse.

  • lineColor (int) – Color of the ellipse’s line.

  • fillColor (int) – Fill color of the ellipse.

  • lineWidthMM (np.float64) – Width of the ellipse’s line in mm.

  • isFilled (bool) – Boolean indicating if the ellipse is filled.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetExternalEllipseProperties() from toolkit; Watch out for errors for more information.

SetExternalPolyLineWidthAndColor(Tk: str, lineWidthMM: float64, iColor: int)[source]

Sets the width and color of an external polyline.

Parameters:
  • Tk (str) – Key of the polyline.

  • lineWidthMM (np.float64) – Width of the polyline in mm.

  • iColor (int) – Color of the polyline.

Returns:

None

Return type:

None

Description:

This is a wrapper method for AddExternalPolylinePoint() from toolkit; Watch out for errors for more information.

SetExternalPolygonProperties(Tk: str, lineWidthMM: float64, lineColor: int, fillColor: int, isFilled: bool)[source]

Sets properties of an external polygon.

Parameters:
  • Tk (str) – Key of the polygon.

  • lineWidthMM (np.float64) – Width of the polygon’s line in mm.

  • lineColor (int) – Color of the polygon’s line.

  • fillColor (int) – Fill color of the polygon.

  • isFilled (bool) – Boolean indicating if the polygon is filled.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetExternalPolygonProperties() from toolkit; Watch out for errors for more information.

SetExternalRectangleProperties(Tk: str, left: float64, top: float64, right: float64, bottom: float64, lineColor: int, fillColor: int, lineWidthMM: float64, isFilled: bool, isRounded: bool)[source]

Sets properties of an external rectangle element.

Parameters:
  • Tk (str) – Key of the rectangle element.

  • left (np.float64) – Left coordinate of the rectangle.

  • top (np.float64) – Top coordinate of the rectangle.

  • right (np.float64) – Right coordinate of the rectangle.

  • bottom (np.float64) – Bottom coordinate of the rectangle.

  • lineColor (int) – Color of the rectangle’s line.

  • fillColor (int) – Fill color of the rectangle.

  • lineWidthMM (np.float64) – Width of the rectangle’s line in mm.

  • isFilled (bool) – Boolean indicating if the rectangle is filled.

  • isRounded (bool) – Boolean indicating if the rectangle is rounded.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetExternalRectangleProperties() from toolkit; Watch out for errors for more information.

SetExternalTextProperties(Tk: str, x: float64, y: float64, textColor: int, text: str, angleDegree: float32, heightPt: float32, isBold: bool, isItalic: bool, isUnderline: bool)[source]

Sets properties of an external text element.

Parameters:
  • Tk (str) – Key of the text element.

  • x (np.float64) – x-coordinate of the text.

  • y (np.float64) – y-coordinate of the text.

  • textColor (int) – Color of the text.

  • text (str) – The text content.

  • angleDegree (np.float32) – Angle of the text in degrees.

  • heightPt (np.float32) – Height of the text in points.

  • isBold (bool) – Boolean indicating if the text is bold.

  • isItalic (bool) – Boolean indicating if the text is italic.

  • isUnderline (bool) – Boolean indicating if the text is underlined.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetExternalTextProperties() from toolkit; Watch out for errors for more information.

SetExternalTextText(Tk: str, text: str)[source]

Sets the text of an external text element.

Parameters:
  • Tk (str) – Key of the text element.

  • text (str) – The text content.

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetExternalTextText() from toolkit; Watch out for errors for more information.

SetFont(Tk: str, textContent: str, color: int, angle_degree: float32, faceName: str, heightPt: float32, isBold: bool, isItalic: bool, isUnderlined: bool)[source]

Sets the Font on a Element that has Font. This Method only applies to Texts, numerical Displays, Block Symbols and Block References.

Parameters:
  • Tk (str) – The tk (key) of the Element which Font has to be retrieved

  • color (int) – The desired Color as RGB

  • textContent (str) – Only has Effect on TEXTs

  • angle_degree (np.float32) – Text angle

  • faceName (str) – Face Name of the Font

  • heightPt (np.float32) – The height in Point

  • isBold (bool) – True if the Font should be bold

  • isItalic (bool) – True if the Font should be italic

  • isUnderlined (bool) – True if the Font should be underlined

Returns:

None

Return type:

None

Description:

This is a wrapper method for SetFont() from toolkit; Watch out for errors for more information.

SetWidthScaleProperties(valMin: float64, widthMin: float64, valMax: float64, widthMax: float64) bool[source]

Sets width scale properties.

Parameters:
  • valMin (np.float64) – Minimum value.

  • widthMin (np.float64) – Minimum width.

  • valMax (np.float64) – Maximum value.

  • widthMax (np.float64) – Maximum width.

Returns:

Boolean indicating if width scale properties were set successfully.

Return type:

bool

Description:

This is a wrapper method for SetWidthScaleProperties() from toolkit; Watch out for errors for more information.

StartEditSession(SessionName: str)[source]

Start an edit session with the given session name.

Parameters:

SessionName (str) – A meaningful name to start a session.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for StartEditSession() from toolkit.

StartTransaction(SessionName: str)[source]

Start a transaction with the given session name.

Parameters:

SessionName (str) – A meaningful name to start a transaction; Empty string or None will lead to error.

Returns:

None

Return type:

None

Description:

This method is a wrapper method for StartTransaction() from toolkit.

class sir3stoolkit.core.wrapper.fontInformation(textContent, color, angle_degree, faceName, heightPt, isBold, isItalic, isUnderline)

Bases: tuple

angle_degree

Alias for field number 2

color

Alias for field number 1

faceName

Alias for field number 3

heightPt

Alias for field number 4

isBold

Alias for field number 5

isItalic

Alias for field number 6

isUnderline

Alias for field number 7

textContent

Alias for field number 0

class sir3stoolkit.core.wrapper.numericalDisplayProperties(x, y, color, angle_degree, faceName, heightPt, isBold, isItalic, isUnderline, description, forResult, tkObserved, elemPropertyNameOrResult, prefix, unit, numDec, absValue)

Bases: tuple

absValue

Alias for field number 16

angle_degree

Alias for field number 3

color

Alias for field number 2

description

Alias for field number 9

elemPropertyNameOrResult

Alias for field number 12

faceName

Alias for field number 4

forResult

Alias for field number 10

heightPt

Alias for field number 5

isBold

Alias for field number 6

isItalic

Alias for field number 7

isUnderline

Alias for field number 8

numDec

Alias for field number 15

prefix

Alias for field number 13

tkObserved

Alias for field number 11

unit

Alias for field number 14

x

Alias for field number 0

y

Alias for field number 1

class sir3stoolkit.core.wrapper.textProperties(x, y, color, textContent, angle_degree, faceName, heightPt, isBold, isItalic, isUnderline, idRef, description)

Bases: tuple

angle_degree

Alias for field number 4

color

Alias for field number 2

description

Alias for field number 11

faceName

Alias for field number 5

heightPt

Alias for field number 6

idRef

Alias for field number 10

isBold

Alias for field number 7

isItalic

Alias for field number 8

isUnderline

Alias for field number 9

textContent

Alias for field number 3

x

Alias for field number 0

y

Alias for field number 1

Module contents