from dlubal.api import rfem, rsection, common

# Working with different ports allows running multiple RFEM/RSTAB/RSECTION instances simultaneously.
# Each instance can be accessed via its unique port number.
# Throwing an exception if the specified port is not available, default port is 9000.
# Show settings in RFEM (9000)/RSTAB(9002)/RSECTION(9003 to set different ports.
def main():
    # RSECTION
    with rsection.Application(port=9001) as rsection_app:
        info= rsection_app.get_application_info()
        print(info)

    # RFEM DE
    with rfem.Application(port=9002) as rfem_app:
        info = rfem_app.get_application_info()
        print(info)

    # RFEM EN
    with rfem.Application(port=9000) as rfem_app:
        info = rfem_app.get_application_info()
        print(info)

if __name__ == '__main__':
    main()
