Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The new IntegralPy library can be used to control INTEGRAL from Python-Script: loading grid data, editing grid data, start calculations.

...

For comments, questions contact eimantas.survila@fgh-ma.de

VisuService Integral Start

...

grid.remove()
objects is either a single object or list of objects

Examples of using IntegralPy:

Code Block
from integralpy import connect

if __name__ == "__main__":
    session = connect("localhost:7321")
    path = "ks-a1.xml"
    session.load_grid_file(path)
Code Block
from integralpy import connect, Type, Attribute

if __name__ == "__main__":
    session = connect()
    file_path_rel = "ks-a1.xml"
    netz = session.load_grid_file(file_path_rel)
    # if the grid is already loaded:
    netz = session.get_current_grid()
    objects = netz.get(
        type=Type.LEITUNG,
        attr=[Attribute.LEITUNG.KURZNAME, Attribute.LEITUNG.BEZEICHNER],
    )
    print(objects)

    netzeinspeisung = netz.get(ids=772)
    print(netzeinspeisung)
Code Block
import integralpy

if __name__ == "__main__":
    session = integralpy.connect("localhost:7321")
    file_path = "ks-a1.xml"
    netz = session.load_grid_file(file_path)
    new_leitung = netz.create(type=integralpy.Type.LEITUNG)

    leitung = netz.get(ids=1175)
    leitung.kurzname = "Something different"
    netz.write(leitung)
    print("new_leitung", leitung)