0% found this document useful (0 votes)
44 views463 pages

Python Function Reference

Uploaded by

camila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views463 pages

Python Function Reference

Uploaded by

camila
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DIgSILENT

PowerFactory 2018

Python Function Reference

I N T EG R AT E D P O W E R S Y S T EM A N A LY S I S S O F T WA R E F O R
T R A N S M I S S I O N / D I S T R I BU T I O N / I N D U S T RY / G EN E R AT I O N / I N T EG R AT I O N O F R EN E WA B L E S
Publisher:
DIgSILENT GmbH
Heinrich-Hertz-Straße 9
72810 Gomaringen / Germany
Tel.: +49 (0) 7072-9168-0
Fax: +49 (0) 7072-9168-88
info@[Link]

Please visit our homepage at:


[Link]

Copyright © 2017 DIgSILENT GmbH


All rights reserved. No part of this
publication may be reproduced or
distributed in any form without written
permission of DIgSILENT GmbH.

December 9, 2017
PowerFactory 2018
Revision 1
Contents

Contents

1 General Description 1

2 PowerFactory Module 2

3 Application Methods 4
3.1 File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2 Date/Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Dialogue Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.4 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.5 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.6 Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4 Output Window 42

5 Object Methods 44
5.1 General Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.2 Network Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.2.1 ElmArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.2.2 ElmAsm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.2.3 ElmAsmsc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.2.4 ElmBbone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.2.5 ElmBmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.2.6 ElmBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.2.7 ElmBranch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.2.8 ElmCabsys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.2.9 ElmComp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.2.10 ElmCoup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.2.11 ElmDsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.2.12 ElmFeeder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.2.13 ElmFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2.14 ElmFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.2.15 ElmGenstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

DIgSILENT PowerFactory 2018, Python Function Reference i


Contents

5.2.16 ElmGndswt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.2.17 ElmLne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.2.18 ElmLnesec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.2.19 ElmNec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.2.20 ElmNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.2.21 ElmPvsys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.2.22 ElmRelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.2.23 ElmRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.2.24 ElmShnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.2.25 ElmStactrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
5.2.26 ElmSubstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.2.27 ElmSvs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.2.28 ElmSym . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
5.2.29 ElmTerm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.2.30 ElmTr2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.2.31 ElmTr3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.2.32 ElmTr4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
5.2.33 ElmTrfstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.2.34 ElmVoltreg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.2.35 ElmXnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5.2.36 ElmZone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.3 Station Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.3.1 StaCt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.3.2 StaCubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.3.3 StaExtbrkmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5.3.4 StaExtcmdmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
5.3.5 StaExtdatmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.3.6 StaExtfmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.3.7 StaExtfuelmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
5.3.8 StaExtimea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5.3.9 StaExtpfmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
5.3.10 StaExtpmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.3.11 StaExtqmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
5.3.12 StaExtsmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
5.3.13 StaExttapmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.3.14 StaExtv3mea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
5.3.15 StaExtvmea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
5.3.16 StaSwitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
5.4 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
5.4.1 ComAddlabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

DIgSILENT PowerFactory 2018, Python Function Reference ii


Contents

5.4.2 ComAddon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226


5.4.3 ComCapo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
5.4.4 ComConreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.4.5 ComContingency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.4.6 ComDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
5.4.7 ComDllmanager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.4.8 ComDpl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.4.9 ComFlickermeter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.4.10 ComGenrelinc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.4.11 ComGridtocim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
5.4.12 ComImport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
5.4.13 ComInc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.4.14 ComLdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.4.15 ComLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
5.4.16 ComMerge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.4.17 ComMot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
5.4.18 ComNmink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
5.4.19 ComOmr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
5.4.20 ComOpc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
5.4.21 ComOutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.4.22 ComPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
5.4.23 ComRel3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
5.4.24 ComRelpost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5.4.25 ComRelreport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5.4.26 ComRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.4.27 ComShc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.4.28 ComShctrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
5.4.29 ComSim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
5.4.30 ComSimoutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.4.31 ComSvgexport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
5.4.32 ComSvgimport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.4.33 ComTasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.4.34 ComTececo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
5.4.35 ComTransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
5.4.36 ComUcte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.4.37 ComUcteexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.5 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
5.5.1 SetCluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
5.5.2 SetColscheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
5.5.3 SetDesktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

DIgSILENT PowerFactory 2018, Python Function Reference iii


Contents

5.5.4 SetDistrstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307


5.5.5 SetFilt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
5.5.6 SetLevelvis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5.5.7 SetParalman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
5.5.8 SetSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
5.5.9 SetTboxconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
5.5.10 SetTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
5.5.11 SetVipage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
5.6 Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
5.6.1 BlkDef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
5.6.2 BlkSig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
5.6.3 ChaVecfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
5.6.4 CimModel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
5.6.5 CimObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
5.6.6 IntCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
5.6.7 IntComtrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
5.6.8 IntComtradeset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
5.6.9 IntDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
5.6.10 IntEvt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
5.6.11 IntExtaccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
5.6.12 IntGate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
5.6.13 IntGrf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
5.6.14 IntGrfgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
5.6.15 IntGrflayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
5.6.16 IntGrfnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
5.6.17 IntMat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
5.6.18 IntMon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
5.6.19 IntOutage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
5.6.20 IntPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
5.6.21 IntPrj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
5.6.22 IntPrjfolder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
5.6.23 IntQlim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
5.6.24 IntRas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
5.6.25 IntRunarrange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
5.6.26 IntScenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
5.6.27 IntScensched . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
5.6.28 IntScheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
5.6.29 IntSscheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
5.6.30 IntSstage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
5.6.31 IntSubset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377

DIgSILENT PowerFactory 2018, Python Function Reference iv


Contents

5.6.32 IntThrating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378


5.6.33 IntUrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
5.6.34 IntUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
5.6.35 IntUserman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
5.6.36 IntVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
5.6.37 IntVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
5.6.38 IntViewbookmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
5.6.39 RelZpol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
5.6.40 ScnFreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
5.6.41 ScnFrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
5.6.42 ScnSpeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
5.6.43 ScnSync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
5.6.44 ScnVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
5.6.45 ScnVolt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
5.6.46 StoMaint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
5.6.47 TypAsmo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
5.6.48 TypLne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
5.6.49 TypTr2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
5.6.50 VisBdia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
5.6.51 VisDraw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
5.6.52 VisHrm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
5.6.53 VisMagndiffplt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
5.6.54 VisOcplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
5.6.55 VisPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
5.6.56 VisPcompdiffplt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
5.6.57 VisPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
5.6.58 VisPlot2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
5.6.59 VisPlottz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
5.6.60 VisVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
5.6.61 VisVecres . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
5.6.62 VisXyplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423

Index 425

DIgSILENT PowerFactory 2018, Python Function Reference v


Chapter 1. General Description

1 General Description

This reference manual describes the syntax of all available functions and methods provided
by the PowerFactory module. The used Python interface version is 2 (new in PowerFactory
2016). For syntax of the Python interface version 1 (PowerFactory 15.x) please use the DPL
reference with the extended return values.
Please refer to the PowerFactory User Manual for general information about Python as script-
ing language and its usage.

DIgSILENT PowerFactory 2018, Python Function Reference 1


Chapter 2. PowerFactory Module

2 PowerFactory Module

Overview

GetApplication
GetApplicationExt
GetApplicationSecured
GetApplicationSecuredExt

GetApplication
Creates a PowerFactory application object and returns it. When the Python script is started
from external PowerFactory will be started.
Application [Link]([str username = None,]
[str password = None,]
[str commandLineArguments = None])

A RGUMENTS
username (optional)
Name of the user to log in to PowerFactory (default None). None enforces the
default behaviour as if PowerFactory was started via shortcut.
password (optional)
The password for the user which should be logged in (default None). None omits
the password.
commandLineArguments (optional)
Additional command line options (default None). These need to be specified in
the same way as if PowerFactory was started via a command shell. None omits
the command line arguments.

R ETURNS
Application object on success, otherwise None.

S EE ALSO

GetApplicationExt(), GetApplicationSecured(), GetApplicationSecuredExt()

GetApplicationExt
Same as [Link]() but throwing an exception with a detailed error code
when PowerFactory was not able to start.
Furthermore if PowerFactory exits due to an error, [Link] can be caught in an
Python script for doing clean-up.

DIgSILENT PowerFactory 2018, Python Function Reference 2


Chapter 2. PowerFactory Module

When PowerFactory was started by a Python script from external and the application object
is deleted then PowerFactory is terminated but the current process keeps running. In this
situation it is not possible to start PowerFactory again in the same process.
Application [Link]([str username = None,]
[str password = None,]
[str commandLineArguments = None])

R ETURNS
Application object on success. In the error case an exception with a detailed error code is
thrown.

E XAMPLE
The following example starts PowerFactory from external and handles initialisation errors:
import sys;
[Link](r"C:\Program Files\DIgSILENT\PowerFactory 2017\python\3.6")

import powerfactory

try:
app = [Link]()
# ... some calculations ...
except [Link] as error:
print(error)
print('[Link] = %d' % [Link])

S EE ALSO

GetApplication(), GetApplicationSecured(), GetApplicationSecuredExt()

GetApplicationSecured
Same as [Link]() but using the password hash (see user edit dialog)
instead of the password itself.
Application [Link]([str username = None,]
[str passwordHash = None,]
[str commandLineArguments = None])

S EE ALSO

GetApplicationSecuredExt(), GetApplication(), GetApplicationExt()

GetApplicationSecuredExt
Same as [Link]() but using the password hash (see user edit dialog)
instead of the password itself.
Application [Link]([str username = None,]
[str passwordHash = None,]
[str commandLineArguments = None])

S EE ALSO

GetApplicationSecured(), GetApplication(), GetApplicationExt()

DIgSILENT PowerFactory 2018, Python Function Reference 3


Chapter 3. Application Methods

3 Application Methods

Overview

ActivateProject
CommitTransaction
CreateFaultCase
CreateProject
ExecuteCmd
GetActiveCalculationStr
GetActiveNetworkVariations
GetActiveProject
GetActiveScenario
GetActiveScenarioScheduler
GetActiveStages
GetActiveStudyCase
GetAllUsers
GetBorderCubicles
GetBrowserSelection
GetCalcRelevantObjects
GetClassDescription
GetClassId
GetCurrentDiagram
GetCurrentScript
GetCurrentSelection
GetCurrentUser
GetCurrentZoomScaleLevel
GetDataFolder
GetDiagramSelection
GetFlowOrientation
GetFromStudyCase
GetGlobalLibrary
GetGraphicsBoard
GetInterfaceVersion
GetLanguage
GetLocalLibrary
GetProjectFolder
GetRecordingStage
GetSettings
GetSummaryGrid
GetUserManager
Hide
IsAttributeModeInternal
IsLdfValid
IsRmsValid
IsScenarioAttribute

DIgSILENT PowerFactory 2018, Python Function Reference 4


Chapter 3. Application Methods

IsShcValid
IsSimValid
IsWriteCacheEnabled
LoadProfile
MarkInGraphics
OutputFlexibleData
PostCommand
Rebuild
ReloadProfile
ResetCalculation
ResGetData
ResGetDescription
ResGetFirstValidObject
ResGetFirstValidObjectVariable
ResGetFirstValidVariable
ResGetIndex
ResGetMax
ResGetMin
ResGetNextValidObject
ResGetNextValidObjectVariable
ResGetNextValidVariable
ResGetObject
ResGetUnit
ResGetValueCount
ResGetVariable
ResGetVariableCount
ResLoadData
ResReleaseData
ResSortToVariable
SaveAsScenario
SearchObjectByForeignKey
SelectToolbox
SetAttributeModeInternal
SetInterfaceVersion
SetShowAllUsers
SetWriteCacheEnabled
Show
SplitLine
StatFileGetXrange
StatFileResetXrange
StatFileSetXrange
WriteChangesToDb

ActivateProject
Activates a project with its name.
int [Link](str name)

A RGUMENTS
name Name (”Project”), full qualified name (”[Link]”) or full qualified path (”\User\[Link]”)
of a project.

R ETURNS
0 on success and 1 if project can not be found or activated.

DIgSILENT PowerFactory 2018, Python Function Reference 5


Chapter 3. Application Methods

CommitTransaction
Writes pending changes to database.
While a script is running none of the changes are written to the database unless the script
terminates. PowerFactory can be forced to write all pending changes to the database using
this function.
None [Link]()

CreateFaultCase
Create fault cases from the given elements.
int [Link](set elms,
int mode,
[int createEvt],
[object folder]
)

A RGUMENTS
elms Selected elements to create fault cases.
mode How the fault cases are created:
0 Single fault case containing all elements.
1 n-1 (multiple cases).
2 n-2 (multiple cases).
3 Collecting coupling elemnts and create fault cases for line couplings.
createEvt (optional)
Switch event:
0 Do NOT create switch events.
1 Create switch events.
folder (optional)
Folder in which the fault case is stored.

R ETURNS
0 On success.
1 On error.

CreateProject
Creates a new Project inside the parent object. The default project stored in the Configura-
tion/Default folder will be copied and if it contains any Study Cases the first will be used instead
of creating a new one. A new grid will always be created. Returns the newly created project.
DataObject [Link](str projectName,
str gridName,
[DataObject parent])

DIgSILENT PowerFactory 2018, Python Function Reference 6


Chapter 3. Application Methods

A RGUMENTS
projectName
Name of the new project. Leave empty to open up the IntPrj dialog and let the
user enter a name.
gridName
Name of the grid that‘s created for the new project. Leave empty to open up the
ElmNet dialog and let the user enter a name.
parent The parent for the new project. Can be omitted to use the currently logged on user
as default.

ExecuteCmd
Executes given command string as it would be executed if typed directly into the Input Window.
Current script will continue after the command has been executed.
This function is mainly intended for testing purpose and should be used by experienced users
only.
int [Link](str command)

A RGUMENTS
command
The command string

GetActiveCalculationStr
Gets “calculation string” of currently valid calculation.
str [Link]()

R ETURNS
None basic
Load Flow ldf
AC Load Flow Sensitivities acsens
AC Contingency Analysis accont
DC Load Flow dcldf
DC Load Flow Sensitivities dcsens
DC Contingenciy Analysis dccont
VDE/IEC Short-Circuit shc
Complete Short-Circuit shcfull
ANSI Short-Circuit shcansi
IEC 61363 shc61363
RMS-Simulation rms
Modal Analysis modal
EMT-Simulation emt
Harmonics/Power Quality harm
Frequency Sweep fsweep

DIgSILENT PowerFactory 2018, Python Function Reference 7


Chapter 3. Application Methods

Optimal Power Flow opf


DC Optimal Power Flow dcopf
DC OPF with Contingencies dccontopf
State Estimation est
Reliability rel
General Adequacy genrel
Tie Open Point Opt. topo
Motor Starting Calculation motstart
Arc Flash Calculation arcflash
Optimal Capacitor Placement optcapo
Voltage Plan Optimization mvplan
Backbone Calculation backbone
Optimal RCS Placement optrcs

GetActiveNetworkVariations
Returns all active variations for the 'Network Data' folder.
list [Link]()

R ETURNS
Returns currently active IntScheme objects. Set is empty in case of no scheme being cur-
rently active.

GetActiveProject
This function returns the currently active project.
DataObject [Link]()

R ETURNS
Returns currently active IntPrj object or None in case of no project being currently active.

GetActiveScenario
Returns the currently active scenario. None is returned if there is no active scenario.
DataObject [Link]()

R ETURNS
Returns currently active IntScenario object or None in case of no scenario being currently
active.

GetActiveScenarioScheduler
Returns currently active scenario scheduler.
DataObject [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 8


Chapter 3. Application Methods

R ETURNS
Returns currently active IntScensched object or None in case of no scheduler being currently
active.

GetActiveStages
Returns all active stages currently active for a given folder, e.g. 'Network Data' folder.
list [Link]([DataObject variedFolder])

A RGUMENTS
variedFolder (optional)
Folder for which all active stages will be returned; by default, the project folder
'Network Data' is taken.

R ETURNS
Returns currently active IntSstage objects. Set is empty in case of no stages being currently
active.

GetActiveStudyCase
Returns the active Study Case. None is returned if there is no active study case.
DataObject [Link]()

R ETURNS
The active study case (IntCase object) or None.

R ETURNS
Returns currently active IntCase object or None in case of no study case being currently
active.

GetAllUsers
Returns all known users, regardless of any Data Manager filters.

A RGUMENTS
forceReload
0 Default, returns the cached state if function was called before.
1 Forces the cache to be cleared, may impact performance.

R ETURNS
Returns a container with all known users.

GetBorderCubicles
This function returns the border cubicles of the parent station of passed element topologically
reachable from that element.
A cubicle (StaCubic) is considered to be a border cubicle if it resides inside the station

DIgSILENT PowerFactory 2018, Python Function Reference 9


Chapter 3. Application Methods

• and points to an element that sits outside the station


• or to a branch element that is connected to a terminal outside the station.

list [Link](DataObject element)

A RGUMENTS
element Element from which the search for border cubicles starts

R ETURNS
A set, containing border cubicles StaCubic. If the element does not reside in any substation
or no border cubicles exist, the set is empty.

GetBrowserSelection
Returns all objects marked in the “on top” Data Manager (Browser, right side).
list [Link]()

R ETURNS
Objects marked in the “on top” Data Manager (Browser, right side).

S EE ALSO

[Link](), [Link]()

GetCalcRelevantObjects
Returns all currently calculation relevant objects, i.e. the objects which are used by the calcula-
tions.
The set of objects depends on active study case, active grid(s) and variation(s).
list [Link]([str nameFilter,]
[int includeOutOfService = 1,]
[int topoElementsOnly = 0,]
[int bAcSchemes = 0])

A RGUMENTS
nameFilter (optional)
(Class) name filter. Wildcards are supported. Multiple filters to be separated by
comma ’,’. Must not contain a backslash ’\’.
If omitted, all objects are returned (corresponds to ’*.*’).
Examples for valid filter strings:
• ’ElmTerm’
• ’A*.ElmTerm’
• ’*.ElmLod,*.ElmSym’
includeOutOfService (optional)
Flag whether to include out of service objects. Default is 1 (=included).
topoElementsOnly (optional)
Flag to filter for topology relevant objects only. Default is 0 (=all objects).
bAcSchemes (optional)
Flag to include hidden objects in active schemes. Default is 0 (=not included).

DIgSILENT PowerFactory 2018, Python Function Reference 10


Chapter 3. Application Methods

R ETURNS
The currently calculation relevant objects, according to the given arguments. The order of
the set is undefined.

S EE ALSO

[Link]()

GetClassDescription
Returns a description for a PowerFactory class.
str [Link](str name)

A RGUMENTS
name Name of a PowerFactory class

R ETURNS
Returns the description of a valid PowerFactory class, otherwise an empty string.

GetClassId
Returns a class identifier number.
Each class name corresponds to one unique number. The mapping of class name might be dif-
ferent for different build numbers of PowerFactory , but it is guaranteed that it will not changed
while an Api instance exists. (Do not keep these numbers static, get them dynamically in your
code using this method).
int [Link](str className)

A RGUMENTS
className
Class name e.g. ”ElmTerm”.

0 Class name invalid.


>0 Class id of valid class name.

GetCurrentDiagram
This function offers access to the current diagram object (IntGrfnet).
DataObject [Link]()

GetCurrentScript
Returns the current script (ComPython).
DataObject [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 11


Chapter 3. Application Methods

R ETURNS
The current script (ComPython) or None if started from external.

GetCurrentSelection
Returns all objects marked in the “on top” Data Manager (Browser, right side) or diagram.
list [Link]()

R ETURNS
Objects marked in the “on top” Data Manager (Browser, right side) or diagram.

S EE ALSO

[Link](), [Link]()

GetCurrentUser
Returns the PowerFactory user of current session.
DataObject [Link]()

R ETURNS
Returns an IntUser object, never None.

GetCurrentZoomScaleLevel
Returns the zoom or scale level of the currently active diagram. If the active diagram is geo-
graphic, then the scale level is returned, otherwise the zoom level is returned.
int [Link]()

R ETURNS
Zoom or scale level of the active diagram as integer.

• For geographic diagrams the scale level is returned. E.g. returns 50000 if 1:50000 is in
the zoom/ratio combo box
• For all other diagrams the zoom level is returned. E.g. returns 150 if 150

A value of -1 is returned in case of no open diagram.

GetDataFolder
This function returns the folder in which the network data for the given class are stored.
DataObject [Link](str classname,
[int iCreate])

A RGUMENTS
classname
Classname of the elements:
ElmBmu

DIgSILENT PowerFactory 2018, Python Function Reference 12


Chapter 3. Application Methods

ElmArea
ElmZone
ElmRoute
ElmOwner
ElmOperator
ElmFeeder
ElmCircuit
ElmBoundary
IntScales
iCreate(optional)
0 The folder is searched and returned if found. If the folder does not
exist, None is returned.
1 The folder is created if it does not exist. The found or created folder is
returned.

R ETURNS
The network data folder, which is found or created.

S EE ALSO

[Link]()

GetDiagramSelection
Returns all objects marked in the “on top” diagram.
list [Link]()

R ETURNS
Objects marked in the “on top” diagram.

S EE ALSO

[Link](), [Link]()

GetFlowOrientation
This function returns the flow orientation setting of the active project.
int [Link]()

R ETURNS
-1 No project is active
0 Flow orientation of active project is “MIXED MODE”
1 Flow orientation of active project is “LOAD ORIENTED”
2 Flow orientation of active project is “GENERATOR ORIENTED”

DIgSILENT PowerFactory 2018, Python Function Reference 13


Chapter 3. Application Methods

GetFromStudyCase
Returns the first found object of class “ClassName” from the currently active study case. The
object is created when no object of the given name and/or class was found.
For commands the returned instance corresponds to the one that is used if opened via the main
menue load-flow, short-circuit, transient simulation, etc.,

A RGUMENTS
ClassName
Class name of the object (“Class”), optionally preceded by an object name without
wildcards and a dot (“[Link]”).

R ETURNS
The found or created object.

GetGlobalLibrary
Returns the global library for object-types of class “ClassName”. ClassName may be omitted,
in which case the complete global library folder is returned.
DataObject [Link]([str ClassName])

A RGUMENTS
ClassName (optional)
The classname of the objects for which the library folder is sought

R ETURNS
The libary folder

S EE ALSO

[Link]()

GetGraphicsBoard
Returns the currently active Graphics Board.
DataObject [Link]()

R ETURNS
The graphics board object

GetInterfaceVersion
Returns the currently set interface version.
It holds the value set with SetInterfaceVersion() or the interface version from the current script
(parameter ’interfaceVersion’) if the python script is executed from within PowerFactory.
Have a look into the PowerFactor user manual to get more informations about the interface
version of a script.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 14


Chapter 3. Application Methods

R ETURNS
The currently set interface version or 0 if PowerFactory is started from external and SetInter-
faceVersion() is not called.

GetLanguage
Returns a string for the current program language setting.
str [Link]()

R ETURNS
en English
de German
es Spanish

GetLocalLibrary
Returns the local library for object-types of class “ClassName”. ClassName may be omitted, in
which case the complete local library folder is returned.
DataObject [Link]([str ClassName])

A RGUMENTS
ClassName (optional)
The classname of the objects for which the library folder is sought

R ETURNS
The libary folder

S EE ALSO

[Link]()

GetProjectFolder
Returns the project folder of a given type of active project. For each type (except ‘Generic’)
there exist not more than one folder per type.
DataObject [Link](str type)

A RGUMENTS
type Type of the corresponding project folder. See [Link]()
for a list of possible values.

R ETURNS
An IntPrjFolder object. If no project is currently active or project folder of this type does not
exist, None is returned.

DIgSILENT PowerFactory 2018, Python Function Reference 15


Chapter 3. Application Methods

GetRecordingStage
Returns the currently active recording scheme stage.
DataObject [Link] ()

R ETURNS
An IntSstage object; None if there is no recording stage.

GetSettings
Offers read-only access to some selected PowerFactory settings.
str [Link](str key)

A RGUMENTS
key
Key Return type Description
usernm string Name of logged-in user (IntLogon:usernm)
ptdig string Fully qualified path of installation directory of PowerFactory (Int-
Logon:ptdig)
ptwrk string Fully qualified path of working directory of PowerFactory (IntL-
ogon:ptwrk)
sessionid integer ID of current session
db driver string Name of used database driver (IntLogon:db driver)

R ETURNS
Value of settings as string

GetSummaryGrid
Returns the summary grid in the currently active Study Case. The summary grid is the combi-
nation of all active grids in the study case.
DataObject [Link]()

R ETURNS
A ElmNet object, or a 'None ' object when no grids are active

GetUserManager
Offers access to the user manager object (IntUserman) stored in the configuration folder.
DataObject [Link]()

R ETURNS
The user manager object

DIgSILENT PowerFactory 2018, Python Function Reference 16


Chapter 3. Application Methods

Hide
Hides the PowerFactory application window.
None [Link]()

S EE ALSO

[Link]()

IsAttributeModeInternal
Returns whether the attribute values are accessed as internally stored.
int [Link]()

R ETURNS
0 Attribute values accessed as displayed in PowerFactory (unit conversion ap-
plied).
1 Attribute values accessed as internally stored.

S EE ALSO

[Link]()

IsLdfValid
Checks to see if the last load-flow results are still valid and available.
int [Link]()

R ETURNS
0 if no load-flow results are available

IsRmsValid
Checks to see if the last RMS simulation results are still valid and available.
int [Link]()

R ETURNS
0 if no RMS simulation results are available

IsScenarioAttribute
Checks if a given attribute of a given class is recorded in scenario. It does not check whether a
concrete instance is recorded at all. The check is just performed against the scenario configu-
ration and is independent of a concrete scenario.
int [Link](str classname, str attributename)

DIgSILENT PowerFactory 2018, Python Function Reference 17


Chapter 3. Application Methods

A RGUMENTS
classname
Name of a PowerFactory class
attributename
Name of an attribute of given class

R ETURNS
1 If attribute is scenario relevant according to current scenario configuration
0 If attribute is not scenario relevant

IsShcValid
Checks to see if the last short-circuit results are still valid and available.
int [Link]()

R ETURNS
0 if no short-circuit results are available

IsSimValid
Checks to see if the last simulation results are still valid and available.
int [Link]()

R ETURNS
0 if no simulation results are available

IsWriteCacheEnabled
Returns whether or not the cache method for optimizing performances is enabled.
int [Link]()

R ETURNS
0 Write cache is disabled.
1 Write cache is enabled.

S EE ALSO

[Link](), [Link]()

LoadProfile
Activates a profile for current user. This corresponds to the select profile action via main menue
“TOOLS-Profiles”.
int [Link](str profileName)

DIgSILENT PowerFactory 2018, Python Function Reference 18


Chapter 3. Application Methods

A RGUMENTS
profileName
Name of profile to be loaded.

R ETURNS
0 On error, e.g. profile with given name not found.
1 On success.

S EE ALSO

[Link]()

MarkInGraphics
Marks all objects in the diagram in which the elements are found by hatch crossing them.
None [Link](list objects,
[int searchOpenedDiagramsOnly = 0])

A RGUMENTS
objects Objects to be marked.

searchOpenedDiagramsOnly (optional)
Search can be restricted to currently shown diagrams on the desktop, instead of
all diagrams.
0 Searching all diagrams, not only the ones which are currently shown
on the desktop. If there is more than one occurrence the user will be
prompted which diagrams shall be opened (default).
1 Only search in currently opened diagrams and open the first diagram
in which the elements were found.

OutputFlexibleData
Outputs the Flexible Data of the given objects to the output window.
Has identical functionality to that implemented in the Object Filter dialogue, whereby the user
can right-click on a single row or multiple rows in a Flexible Data page and select Output
. . . Flexible Data. The OutputFlexibleData() function assumes that the user has already de-
fined a Flexible Data page for the objects in the set. Upon execution of this function, all Flexible
Data defined for the objects in the set is output to the PowerFactory output window in a tabular
format.
None [Link](list objects,
[str flexibleDataPage = ''])

A RGUMENTS
objects Objects to output the Flexible Data for.
flexibleDataPage (optional)
Name of the Flexible Data page to be outputed. If multiple Flexible Data pages
are defined and no or an empty string is given then a dialog to select a Flexible
Data page is shown.

DIgSILENT PowerFactory 2018, Python Function Reference 19


Chapter 3. Application Methods

PostCommand
Adds a command to the command pipe of the “input window”. The posted commands will be
executed after the currently running script has finished.
None [Link](str command)

A RGUMENTS
command
The command string.

Rebuild
Rebuilds the currently visible single line diagram.
None [Link]([int iMode])

A RGUMENTS
iMode (optional)
0 Draws graphic objects only
1 (default) Reads graphic objects (IntGrf) from database and draws
2 Reads graphic objects (IntGrf) from database, re-calculates intersec-
tions and draws

ReloadProfile
Reloads currently selected user profile. (See main menue “TOOLS-Profiles”)
None [Link]()

S EE ALSO

[Link]()

ResetCalculation
Resets all calculations and deletes all calculation results.
Results that have been written to result objects (for display in graphs) will not be destroyed. All
results that are visible in the single line diagrams, however, will be destroyed.
None [Link]()

S EE ALSO

[Link](), [Link]()

ResGetData
This function is deprecated. Please use [Link]() or [Link]() in-
stead.

DIgSILENT PowerFactory 2018, Python Function Reference 20


Chapter 3. Application Methods

[int error,
float d ] [Link](DataObject resultObject,
int iX,
[int col])

ResGetDescription
This function is deprecated. Please use [Link]() or
[Link]() instead.
str [Link](DataObject resultObject,
int col,
[int ishort])

plFunctionResFirstValidObject

ResGetFirstValidObject
This function is deprecated. Please use [Link]() instead.
int [Link](DataObject resultFile,
int row,
[str classNames]
[str variableName,]
[float limit,]
[int limitOperator,]
[float limit2,]
[int limitOperator2])
int [Link]([DataObject resultFile,]
[int row,]
[list objects])

ResGetFirstValidObjectVariable
This function is deprecated. Please use [Link]() instead.
int [Link](DataObject resultFile,
[str variableNames])

ResGetFirstValidVariable
This function is deprecated. Please use [Link]() instead.
int [Link](DataObject resultFile,
int row,
[str variableNames])

ResGetIndex
This function is deprecated. Please use [Link]() or [Link]()
instead.
int [Link](DataObject resultFile,
DataObject obj,

DIgSILENT PowerFactory 2018, Python Function Reference 21


Chapter 3. Application Methods

[str varName])
int [Link](DataObject resultFile,
DataObject obj,
[int colIndex])
int [Link](DataObject resultFile,
[str varName,]
[int colIndex])

ResGetMax
This function is deprecated. Please use [Link]() or
[Link]() instead.
[int row,
float value] [Link](DataObject resultFile,
int col)

ResGetMin
This function is deprecated. Please use [Link]() or
[Link]() instead.
[int row,
float value] [Link](DataObject resultFile,
int col)

ResGetNextValidObject
This function is deprecated. Please use [Link]() instead.
int [Link](DataObject resultFile,
[str classNames]
[str variableName,]
[float limit,]
[int limitOperator,]
[float limit2,]
[int limitOperator2])
int [Link](DataObject resultFile,
list objects)

ResGetNextValidObjectVariable
This function is deprecated. Please use [Link]() instead.
int [Link](DataObject resultFile,
[str variableNames])

ResGetNextValidVariable
This function is deprecated. Please use [Link]() instead.
int [Link](DataObject resultFile,
[str variableNames])

DIgSILENT PowerFactory 2018, Python Function Reference 22


Chapter 3. Application Methods

ResGetObject
This function is deprecated. Please use [Link]() instead.
DataObject [Link](DataObject resultObject,
int col)

ResGetUnit
This function is deprecated. Please use [Link]() or [Link]() instead.
str [Link](DataObject resultObject,
int col)

ResGetValueCount
This function is deprecated. Please use [Link]() or
[Link]() instead.
int [Link](DataObject resultObject,
[int col])

ResGetVariable
This function is deprecated. Please use [Link]() or [Link]()
instead.
str [Link](DataObject resultObject,
int col)

ResGetVariableCount
This function is deprecated. Please use [Link]() or
[Link]() instead.
int [Link](DataObject resultObject)

ResLoadData
This function is deprecated. Please use [Link]() or [Link]() instead.
None [Link](DataObject resultObject)

ResReleaseData
This function is deprecated. Please use [Link]() or [Link]() instead.
None [Link](DataObject resultObject)

DIgSILENT PowerFactory 2018, Python Function Reference 23


Chapter 3. Application Methods

ResSortToVariable
This function is deprecated. Please use [Link]() or
[Link]() instead.
int [Link](DataObject resultObject,
int col)

SaveAsScenario
Saves the operational data or relevant network elements as a new scenario.
DataObject [Link](str pName,
int iSetActive)

A RGUMENTS
pName Name of the new scenario.
iSetActive
1 Activate the new scenario afterwards.
0 Do not activate the new scenario.

R ETURNS
Returns newly created IntScenario object. None is returned in case of creation of a new
scenario was not allowed (e.g. no active project).

SearchObjectByForeignKey
Searches for an object by foreign key within an active project.
DataObject [Link](str foreignKey)

A RGUMENTS
foreignKey
Foreign key

R ETURNS
Object if found, otherwise None.

SelectToolbox
Sets tool box to be displayed at a switchable tool box group.
int [Link](int toolbar,
str groupName,
str toolboxName)

A RGUMENTS
toolbar 1 Main tool bar
2 Drawing tool bar (SGL)
groupName
Name of tool box group.
toolboxName
Name of tool box to be selected.

DIgSILENT PowerFactory 2018, Python Function Reference 24


Chapter 3. Application Methods

R ETURNS
0 On error, e.g. no matching tool box found.
1 On success.

SetAttributeModeInternal
Changes the way how attribute values are accessed.
None [Link](int internalMode)

A RGUMENTS
internalMode 0 Access attribute values as displayed in PowerFactory (unit con-
version applied).
1 Access attribute values as internally stored.

S EE ALSO

[Link]()

SetInterfaceVersion
Sets the current interface version. Only values which can be set to the python script parame-
ter ’interfaceVersion’ are allowed. Setting the interface version does not affect the parameter
’interfaceVersion’ of the current script.
Have a look into the PowerFactor user manual to get more informations about the interface
version of a script.
int [Link](int version)

A RGUMENTS
version interface version to be set

R ETURNS
0 if the version is successfully set, otherwise 1.

SetShowAllUsers
Enables or disables the filtering of all available users in data manager. All users are only visu-
alised in data manager when enabled.
int [Link](int enabled)

A RGUMENTS
enabled
0 Disabled, only Demo, Public Area Users and current user are shown
1 Enabled, all available users are listed

R ETURNS
Returns previous setting.

1 If enabled before.
0 If disabled before.

DIgSILENT PowerFactory 2018, Python Function Reference 25


Chapter 3. Application Methods

SetWriteCacheEnabled
This function intends to optimize performances. In order to modify objects in PowerFactory ,
those must be set in a special edit mode before any value can be changed. Switching back and
forth between edit mode and stored mode is time consuming; enabling the write cache flag will
set objects in edit mode and they will not be switched back until WriteChangeToDb is called.
None [Link](int enabled)

A RGUMENTS
enabled 0 Disables the write cache.
1 Enables the write cache.

S EE ALSO

[Link](), [Link]()

Show
Shows the PowerFactory application window (only possible with a full license, not supported
for engine licenses).
None [Link]()

S EE ALSO

[Link]()

SplitLine
Splits the passed line or ElmBranch-object at a given position
DataObject [Link](DataObject Line,
[double percent = 50,]
[int createSwitchSide0 = 0,]
[int createSwitchSide1 = 0])

A RGUMENTS
double rPercent (optional)
Position in percent from the first connection side where line shall be split
int iCreateSwitchSide0 (optional)

0 (default) Do not create switch on first connection side

1 Create switch on first connection side


int iCreateSwitchSide1 (optional)

0 (default) Do not create switch on second connection side

1 Create switch on second connection side

DIgSILENT PowerFactory 2018, Python Function Reference 26


Chapter 3. Application Methods

R ETURNS
Inserted terminal
0 = error

StatFileGetXrange
Gets the x-range for the statistic result file.
[int error,
double min,
double max] [Link]()

A RGUMENTS
min (out) First point in time considered in statistics.

max (out) Last point in time considered in statistics.

R ETURNS
0 If time range of statistic result file was found.
1 On errors (There is no statistic result file).

StatFileResetXrange
Reset the user defined x-range of the statistic result file. The complete x-range will be consid-
ered in the statistic results after calling this function.
None [Link]()

StatFileSetXrange
Sets the user defined x-range of the statistic result file. The statistic results consider only the
given time range.
None [Link](float min,
float max)

A RGUMENTS
min First point in time to be considered in statistics.
max Last point in time to be considered in statistics.

WriteChangesToDb
This function combined with [Link]() is meant to optimize perfor-
mances. If the write cache flag is enabled all objects remain in edit mode until WriteChangesToDb
is called and all the modifications made to the objects are saved into the database.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 27


Chapter 3. Application Methods

S EE ALSO

[Link](), [Link]()

3.1 File System


Overview

GetInstallationDirectory
GetTemporaryDirectory
GetWorkspaceDirectory

GetInstallationDirectory
Returns the installation directory of PowerFactory .
str [Link]()

R ETURNS
Full path to installation directory of current PowerFactory .

D EPRECATED N AMES
GetInstallDir

S EE ALSO

[Link](), [Link]()

GetTemporaryDirectory
Returns the temporary directory of used by PowerFactory .
str [Link]()

R ETURNS
Full path to a directory where temporary data can be stored. This directory is also used by
PowerFactory to store temporary data.

D EPRECATED N AMES
GetTempDir

S EE ALSO

[Link](), [Link]()

GetWorkspaceDirectory
Returns the workspace directory of PowerFactory .
str [Link]()

R ETURNS
Full path to the directory where currently used workspace is stored.

DIgSILENT PowerFactory 2018, Python Function Reference 28


Chapter 3. Application Methods

D EPRECATED N AMES
GetWorkingDir

S EE ALSO

[Link](), [Link]()

3.2 Date/Time
Overview

GetStudyTimeObject

GetStudyTimeObject
Returns the date and time object (SetTime) from the study case. This is the object being used
by the characteristics, scenarios,...

R ETURNS
SetTime or nullptr.

3.3 Dialogue Boxes


Overview

CloseTableReports
ShowModalBrowser
ShowModalSelectBrowser
ShowModelessBrowser
UpdateTableReports

CloseTableReports
Closes all open table reports.
None [Link]()

ShowModalBrowser
Opens a modal browser window and lists all given objects.
None [Link](list objects,
[int detailMode = 0,]
[str title = '',]
[str page = ''])

A RGUMENTS
objects Objects to be listed. The listing is in detailed mode, if only one kind of objects (e.g.
only ElmTerm) is contained.
detailMode (optional)

DIgSILENT PowerFactory 2018, Python Function Reference 29


Chapter 3. Application Methods

0 Show browser in normal mode (default).


1 Show browser in detail mode.
title (optional)
String for user defined window title. The default window title is shown when no or
an empty string is given.
page (optional)
Name of page to be shown in browser e.g. 'Flexible Data' (only in detailed mode).
The default page is shown when no or an empty string is given.

ShowModalSelectBrowser
Opens a modal browser window and lists all given objects. The user can make a selection from
the list.
list [Link](list objects,
[str title,]
[str classFilter,]
[str page = ''])

A RGUMENTS
objects Objects to be listed. The listing is in detailed mode, if only one kind of objects (e.g.
only ElmTerm) is contained.
title (optional)
String for user defined window title. The default window title is shown when no or
an empty string is given.
classFilter (optional)
Class name filter. If set, only objects matching that filter will be listed in the dialog
e.g. ’Elm*’, ’ElmTr?’ or ’ElmTr2,ElmTr3’.
page (optional)
Name of page to be shown in browser e.g. 'Flexible Data' (only in detailed mode).
The default page is shown when no or an empty string is given.

R ETURNS
Set of selected objects. The set is empty if “cancel” is pressed.

ShowModelessBrowser
Opens a modeless browser window and lists all given objects.
None [Link](list objects,
[int detailMode = 0,]
[str title = '',]
[str page = ''])

A RGUMENTS
objects Objects to be listed. The listing is in detailed mode, if only one kind of objects (e.g.
only ElmTerm) is contained.
detailMode (optional)
0 Show browser in normal mode (default).

DIgSILENT PowerFactory 2018, Python Function Reference 30


Chapter 3. Application Methods

1 Show browser in detail mode.

title (optional)
String for user defined window title. The default window title is shown when no or
an empty string is given.
page (optional)
Name of page to be shown in browser e.g. 'Flexible Data' (only in detailed mode).
The default page is shown when no or an empty string is given.

UpdateTableReports
Updates all open table reports.
None [Link]()

3.4 Environment
Overview

EchoOff
EchoOn
IsAutomaticCalculationResetEnabled
IsFinalEchoOnEnabled
SetAutomaticCalculationResetEnabled
SetFinalEchoOnEnabled
SetGraphicUpdate
SetGuiUpdateEnabled
SetUserBreakEnabled

EchoOff
Freezes (de-activates) the user-interface. For each EchoOff(), an EchoOn() should be called.
An EchoOn() is automatically executed at the end of the execution of a ComDpl or ComPython.
This could be changed with [Link]().
None [Link]()

S EE ALSO

[Link](), [Link](), [Link]()

EchoOn
Re-activates the user interface. For more informations see [Link]().
None [Link]()

S EE ALSO

[Link](), [Link](), [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 31


Chapter 3. Application Methods

IsAutomaticCalculationResetEnabled
Returns whether the automatic calculation reset while setting attributes is enabled. See Appli-
[Link]() for more informations.
int [Link]()

S EE ALSO

[Link](), [Link]()

IsFinalEchoOnEnabled
Returns whether the automatic [Link]() at the end of each ComDpl or ComPython
is enabled.
int [Link]();

R ETURNS
1 Final [Link]() is enabled.
0 Final [Link]() is disabled.

S EE ALSO

[Link](), [Link](), [Link]()

SetAutomaticCalculationResetEnabled
Enables or disables the automatic calculation reset while setting attributes.
In Python/API the automatic calculation reset is by default enabled. Thus changing an object
attribute could lead to a calculation reset, e.g. changing the scaling factor of a load, but do not
have to, e.g. renaming an object.
Even if the automatic calculation reset is disabled, changing the ”outserv” attribute of an arbitrary
network element or the ”on off” attribute of a switch device resets automatically the current
calculation.
When the calculation is reset the load-flow will be calculated with a flat start. Thus switching
the automatic calculation reset off can be helpful e.g. when calculating a load-flow without a flat
start. On the other side it could lead to wrong results e.g. doing short-circuit calculations after
changing the short-circuit-location of a branch without calling [Link]().
None [Link](int enabled)

S EE ALSO

[Link](), [Link]()

SetFinalEchoOnEnabled
Enables or disables the automatic [Link]() at the end of each ComDpl or ComPython.

None [Link](int enabled);

DIgSILENT PowerFactory 2018, Python Function Reference 32


Chapter 3. Application Methods

A RGUMENTS
enabled
1 Enables the final [Link]().
0 Disables the final [Link]().

S EE ALSO

[Link](), [Link](), [Link]()

SetGraphicUpdate
Enables or disables the updates of the single line graphics.
None [Link](int enabled)

A RGUMENTS
enabled
0 disabled (graphic will not be updated automatically)
1 enabled

SetGuiUpdateEnabled
Enables or disables updates of the graphical user interface (e.g. application window) while the
script is running.
This can be useful to get maximum execution performance. However, the user interface might
look frozen and becomes not responsive. The updates will automatically be re-enabled after
termination of the script. In case of sub-scripts, the restore is done at termination of main
script.
int [Link](int enabled)

A RGUMENTS
enabled
0 Disables GUI updates.
1 Enables GUI updates.

R ETURNS
Previous state before the function was called

0 GUI updates were disabled before.


1 GUI updates were enabled before.

D EPRECATED N AMES
SetRescheduleFlag

S EE ALSO

[Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 33


Chapter 3. Application Methods

SetUserBreakEnabled
Enables or disables the “Break” button in main tool bar. After script execution it is disabled
automatically.
None [Link](int enabled)

A RGUMENTS
enabled
0 Disables “Break” button.
1 Enable “Break” button.

D EPRECATED N AMES
SetEnableUserBreak

3.5 Mathematics
Overview

GetRandomNumber
GetRandomNumberEx
InvertMatrix
RndExp
RndGetMethod
RndGetSeed
RndNormal
RndSetup
RndUnifInt
RndUnifReal
RndWeibull
SetRandomSeed

GetRandomNumber
This method is marked as deprecated since PowerFactory 2017. Please use [Link]()
instead.
Draws a uniformly distributed random number. Uses the ’global random number generator’. If
x1 and x2 are omitted, the distribution will be uniform in the intervall [0, 1]. If only x1 is given,
the distribution is uniform in [0, x1] and with both x1 and x2, the distribution is uniform in [x1,
x2].
float [Link]([float x1,]
[float x2])

A RGUMENTS
x1 (optional)
x2 not given: maximum; x1 and x2 given: minimum
x2 (optional)
maximum

R ETURNS
A uniformly distributed random number

DIgSILENT PowerFactory 2018, Python Function Reference 34


Chapter 3. Application Methods

GetRandomNumberEx
This method is marked as deprecated since PowerFactory 2017. Please use [Link](),
[Link]() or [Link]() instead.
Draws a random number according to a specific probability distribution. Uses the ’global random
number generator’.
float [Link](int distribution,
[float p1,]
[float p2])

A RGUMENTS
distribution
0 uniform distribution
1 normal distribution
2 weibull distribution
else returns 0.0
p1 (optional)
distribution = 0 (uniform), argument p2 is also given: min
distribution = 0 (uniform), argument p2 is not given: max (min is as-
sumed to be 0).
distribution = 1 (normal) : mean
distribution = 2 (weibull) : scale
p2 (optional)
distribution = 0 (uniform) : max
distribution = 1 (normal) : stddev
distribution = 2 (weibull) : weibull

R ETURNS
double Newly drawn random number from the specified distribution.
0.0 On failure e.g. non-supported mode.

InvertMatrix
This routine calculates the inverse matrix by the Gauss-Jordan method. It uses scaled partial
pivoting preceeded by column equilibration of the input matrix. The routine can be called in two
different versions:

• Real Inversion: Only one matrix, realP art, is provided as an input to the function. Then,
realP art is inverted and the result, realP art−1 , is stored into the input matrix realP art on
success.
• Complex Inversion: Two matrices, realP art and imaginaryP art, are provided as inputs
to this function. Then, a complex matrix C is formed, with entries
C(i,j) = A(i,j) + j · imaginaryP art(i,j).
The complex matrix C is inverted and, on success, the resulting real part of C −1 is written
to realP art whereas the resulting imaginary part of C −1 is written to imaginaryP art.
Please note that realP art and imaginaryP art must have the same dimensions.

int [Link](DataObject realPart,


[DataObject imaginaryPart])

DIgSILENT PowerFactory 2018, Python Function Reference 35


Chapter 3. Application Methods

A RGUMENTS
realPart If imaginaryPart is not set, realpart is the matrix to invert on input. In case of
success, it will be overwritten by the inverted input matrix. If imaginaryPart is set,
it holds the real part of the complex matrix to invert on input and is overwritten by
the real part of the inverted complex matrix on output.

imaginaryPart
If this is set, it should hold the imaginary part of the matrix to invert on input and
is overwritten by the imaginary part of the inverted matrix on output.

R ETURNS
1 Matrix inversion failed. The provided input matrix is singular.
0 Matrix inversion was successfull. Resulting inverted matrix returned in input ma-
trix/matrices.

RndExp
Returns a random number distributed according to exponential distribution with given rate. See
the example given in the DPL description of [Link]().
double RndExp(double rate, [int rngNum])

A RGUMENTS
rate Rate of exponetial distribution.
rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable via this number.

R ETURNS
double Random number

RndGetMethod
Returns the used method of a random number generator. See the example given in the DPL
description of [Link]().
str RndGetMethod([int rngNum])

A RGUMENTS
rngNum (optional)
Number of the random number generator of which the method type is returned.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable via this number.

R ETURNS
string Name of the used method

DIgSILENT PowerFactory 2018, Python Function Reference 36


Chapter 3. Application Methods

RndGetSeed
Returns the used seed of a random number generator. See the example given in the DPL
description of [Link]().
int RndGetSeed([int rngNum])

A RGUMENTS
rngNum (optional)
Number of the random number generator.

0 (default) ’Global random number generator’.


1, 2, ... Other random number generators accessable via this number.

R ETURNS
int Used seed

RndNormal
Returns a random number distributed according to normal distribution with given mean and
standard deviation. See the example given in the DPL description of [Link]().
double RndNormal(double mean, double stddev, [int rngNum])

A RGUMENTS
mean Mean of normal distribution.
stddev Standard deviation of normal distribution.

rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable via this number.

R ETURNS
double Random number

RndSetup
Initializes a random number generator. Allows to choose:

1. Whether to seed automatically or not.


2. The seed, if not automatically seeded.
3. The type or random number generator.

4. The random number generator to use.

Supported types of random number generators:

1. Mersenne Twister,
2. Linear Congruential,

DIgSILENT PowerFactory 2018, Python Function Reference 37


Chapter 3. Application Methods

3. Additive Lagged Fibonacci.

Internally a vector of random number generators is used. These can be accessed via the num-
ber passed as last argument. Number 0 corresponds to the ’global random number generator’,
updated also in ComInc and ComGenrelinc. Numbers 1,2, . . . will access different random num-
ber generators, which can be setup individually.
None RndSetup(int seedAutomatic, [int seed], [int rngType], [int rngNum])

A RGUMENTS
seedAutomatic
Seed the random number generator automatically
0 Do not seed automatically.
1 Seed automatically.

seed (optional)
Seed for the random number generator. (default: 0) Note, that for the Additive
Lagged Fibonacci generator, only the seeds 0,...,9 are supported.
rngType (optional)
Type of random number generator
0 Mersenne Twister (recommended) (default).
1 Linear Congruential.
2 Additive Lagged Fibonacci.

rngNum (optional)
Number of random number generator to be used
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable via this number.

RndUnifInt
Returns a random number distributed according to uniform distribution on the set of numbers
{min, . . . , max}. See the example given in the DPL description of [Link]().
int RndUnifInt(int min, int max, [int rngNum])

A RGUMENTS
min Smallest possible number
max Largest possible number

rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable via this number.

R ETURNS
int Random number

DIgSILENT PowerFactory 2018, Python Function Reference 38


Chapter 3. Application Methods

RndUnifReal
Returns a random number distributed according to uniform distribution on the intervall [min,max].
See the example given in the DPL description of [Link]().
double RndUnifReal(double min, double max, [int rngNum])

A RGUMENTS
min Lower endpoint of interval [min, max]

max Upper endpoint of interval [min, max]


rngNum (optional)
Number of the random number generator.
0 (default) ’Global random number generator’.
1, 2, ... Other random number generators accessable via this number.

R ETURNS
double Random number

RndWeibull
Returns a random number distributed according to Weibull distribution with given shape and
scale parameters. See the example given in the DPL description of [Link]().
double RndWeibull(double shape, double scale, [int rngNum])

A RGUMENTS
shape Shape parameter of Weibull distribution.
scale Scale parameter of Weibull distribution.
rngNum (optional)
Number of the random number generator.

0 (default) ’Global random number generator’.


1, 2, ... Other random number generators accessable via this number.

R ETURNS
double Random number

SetRandomSeed
This method is marked as deprecated since PowerFactory 2017. Please use [Link]()
instead.
Initializes the ’global random number generator’ as Additive Lagged Fibonacci random number
generator. Sets the seed for the random number generator. One out of 10 predefined initializa-
tion seeds can be selected.
None [Link](int seed)

DIgSILENT PowerFactory 2018, Python Function Reference 39


Chapter 3. Application Methods

A RGUMENTS
seed seed 0..9

3.6 Output Window


Overview

ClearOutputWindow
GetOutputWindow
PrintError
PrintInfo
PrintPlain
PrintWarn
SetOutputWindowState

ClearOutputWindow
Clears the output window.
None [Link]()

GetOutputWindow
Returns the PowerFactory Output Window.
OutputWindow [Link]()

R ETURNS
An instance of the class OutputWindow.

E XAMPLE
import powerfactory
app = [Link]()
outputWindow = [Link]()
[Link]([Link], "Hello World!")

PrintError
Prints a message as error into the PowerFactory Output Window. See [Link]()
for more informations.
None [Link](str message)

PrintInfo
Prints a message as information into the PowerFactory Output Window. See OutputWin-
[Link]() for more informations.
None [Link](str message)

DIgSILENT PowerFactory 2018, Python Function Reference 40


Chapter 3. Application Methods

PrintPlain
Prints a message as normal text into the PowerFactory Output Window. See OutputWin-
[Link]() for more informations.
None [Link](str message)

PrintWarn
Prints a message as warning into the PowerFactory Output Window. See [Link]()
for more informations.
None [Link](str message)

SetOutputWindowState
Changes the display state of the output window.
None [Link](int newState)

A RGUMENTS
newState
0 Minimized output window.
1 Maximized output window.
-1 Restore previous state.

DIgSILENT PowerFactory 2018, Python Function Reference 41


Chapter 4. Output Window

4 Output Window

Overview

Clear
GetContent
Print
Save
SetState

Clear
Clears the output window.
None [Link]()

GetContent
Returns the content (unfiltered or filtered) of the output window.
[str] [Link]()
[str] [Link]([Link] filter)

A RGUMENTS
filter (optional)
If given, then only text from messages of this type will be returned.

R ETURNS
List of texts of output window messages (unfiltered or filtered).

S EE ALSO

[Link]()

Print
Prints a message as normal text, as information, as warning or as error into the PowerFactory
Output Window.
None [Link](str message)
None [Link]([Link] type, str message)

A RGUMENTS
type Type of message to print:

DIgSILENT PowerFactory 2018, Python Function Reference 42


Chapter 4. Output Window

[Link] Normal text.


[Link] Information.
[Link] Warning.
[Link] Error.
The message is printed as normal text if no message type is given.

message Message to print.

E XAMPLE
import powerfactory
app = [Link]()
outputWindow = [Link]()
[Link]([Link], "Hello World!")

Save
Saves the content of current output window to a file.
None [Link](str filePath)

A RGUMENTS
filePath Full file name with path e.g. d:\data\[Link]. Possible file formats are html, txt
and out.

SetState
Changes the display state of the output window.
None [Link](int newState)

A RGUMENTS
newState
0 Minimized output window.
1 Maximized output window.
-1 Restore previous state.

DIgSILENT PowerFactory 2018, Python Function Reference 43


Chapter 5. Object Methods

5 Object Methods

5.1 General Methods


Overview

AddCopy
ContainsNonAsciiCharacters
CopyData
CreateObject
Delete
Energize
GetAttribute
GetAttributeDescription
GetAttributeLength
GetAttributeShape
GetAttributeType
GetAttributeUnit
GetChildren
GetClassName
GetCombinedProjectSource
GetConnectedElements
GetConnectionCount
GetContents
GetControlledNode
GetCubicle
GetFullName
GetImpedance
GetInom
GetNode
GetOperator
GetOwner
GetParent
GetReferences
GetRegion
GetSupplyingSubstations
GetSupplyingTransformers
GetSupplyingTrfstations
GetSystemGrounding
GetUnom
GetUserAttribute
GetZeroImpedance
HasAttribute
HasResults
IsCalcRelevant

DIgSILENT PowerFactory 2018, Python Function Reference 44


Chapter 5. Object Methods

IsDeleted
IsEarthed
IsEnergized
IsHidden
IsInFeeder
IsNetworkDataFolder
IsNode
IsObjectActive
IsObjectModifiedByVariation
Isolate
IsOutOfService
IsReducible
IsShortCircuited
MarkInGraphics
Move
PasteCopy
PurgeUnusedObjects
ReplaceNonAsciiCharacters
ReportNonAsciiCharacters
ReportUnusedObjects
SearchObject
SetAttribute
SetAttributeLength
SetAttributeShape
ShowEditDialog
ShowModalSelectTree
SwitchOff
SwitchOn
WriteChangesToDb

AddCopy
Copies a single object or a set of objects to the target object. “[Link](aObj)” copies
object 'aObj' into the target object 'Fold', “[Link](aSet)” copies all objects in 'aSet' to
“Fold”.
“[Link](aObj, nm1, nm2, ...)” will copy aObj and rename it to the result of the concate-
nation of 'nm1', 'nm2', etc. The object will not be renamed if it was an IntPrj.
The target object must be able to receive a copy of the objects. The function “[Link](aObj,...)”
returns the copy of “aObj”, “[Link](aSet)” returns “Fold”, when the copy operation was
successful. A None object is returned otherwise.
Copying a set of objects will respect all internal references between those objects. Copying a
set of lines and their types, for example, will result in a set of copied lines and line types, where
the copied lines will use the copied line types.
DataObject [Link](DataObject obj,
[int or str partOfName1,]
[...])
DataObject [Link](list objects)

A RGUMENTS
obj The object to copy.
partOfName1 (optional)
The first part of the new name.
objects The set of objects to copy.

DIgSILENT PowerFactory 2018, Python Function Reference 45


Chapter 5. Object Methods

R ETURNS
Returns the copy that has been created, unless the copied object was a set of objects.

ContainsNonAsciiCharacters
Checks whether an object contains texts attributes with non-ASCII characters.
int [Link]()

R ETURNS
Returns 1 if the object contains at least one non-ASCII characters. Otherwise 0.

CopyData
Copies all parameters except for loc name and containers from one object to another.
None [Link](DataObject source)

A RGUMENTS
source Object from which parameters are to be copied

R ETURNS
0 ok
1 error

CreateObject
Creates a new object of given class and name in the target object. The object name will be
concatenated by the given object name parts. The target object must be able to store an object
of the given class in its content otherwise the currently running script will stop with an error.
DataObject [Link](str className,
[int|str objectNamePart0,]
[...]
)

A RGUMENTS
className
The class name of the object to create.
objectNameParts (optional)
Parts of the name of the object to create (without classname) which will be con-
catenated to the object name.

R ETURNS
object Newly created object.
None When no object was created.

DIgSILENT PowerFactory 2018, Python Function Reference 46


Chapter 5. Object Methods

Delete
Deletes the object from the database. The object is not destroyed but moved to the recycle bin.
int [Link]()

R ETURNS
0 Object successfully deleted.
6= 0 Deletion failed e.g. not allowed.

S EE ALSO

[Link]()

Energize
Performs an “energize” action on the network element. This corresponds to removing earthings
from current region (if any) followed by a “switch on” action on the element.
The action is identical to that in the context menue.
[int error,
list changedSwitches] [Link]([int resetRA])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set.
resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.

1 All running arrangements that cause blocking of relevant switches are


applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail.

R ETURNS
Information about the success of the action:

0 Action was successful.


1 Action failed.

S EE ALSO

[Link](), [Link](), [Link]()

GetAttribute
Returns the value of an attribute.
int|float|str|DataObject|list [Link](str name)

A RGUMENTS
name Name of an attribute.

DIgSILENT PowerFactory 2018, Python Function Reference 47


Chapter 5. Object Methods

R ETURNS
Value of an attribute name in its current unit (like in the edit dialog seen). An
exception is thrown for invalid attribute names.

S EE ALSO

[Link](), [Link]()

GetAttributeDescription
Returns the description of an attribute.
str [Link](str name,
int short = 0)

A RGUMENTS
name Name of an attribute.
short 0 Return long attribute description (default).
1 Return short attribute description.

R ETURNS
”” For an invalid attribute name.
str Long or short attribute description.

S EE ALSO

[Link](), [Link]()

GetAttributeLength
Returns the length of a vector or matrix attribute. The length of a matrix attribute is the number
of rows.
int [Link](str name)

A RGUMENTS
name Name of an attribute.

R ETURNS
>0 Length of a valid vector or matrix attribute.
0 All other valid attributes.
−1 For invalid attribute names.

S EE ALSO

[Link](), [Link](), [Link]()

GetAttributeShape
Returns the shape of an attribute. The shape is a list of the form [number of rows, number of
colums].
[int rows,
int columns ] [Link](str name)

DIgSILENT PowerFactory 2018, Python Function Reference 48


Chapter 5. Object Methods

A RGUMENTS
name Name of an attribute.

R ETURNS
[≥ 0, ≥ 0 ] Shape of a valid vector or matrix attribute.
[0, 0 ] All other valid attributes.
[−1, 0 ] For invalid attribute names.

S EE ALSO

[Link](), [Link](), [Link]()

GetAttributeType
Returns the type of an attribute.
The following attribute types exist:
[Link] Attribute does not exist.
[Link] Integer attribute.
[Link] VEC Integer vector attribute.
[Link] Double attribute.
[Link] VEC Double vector attribute.
[Link] MAT Double matrix attribute.
[Link] Data object attribute.
[Link] VEC Data object vector attribute.
[Link] Integer attribute.
[Link] VEC Integer vector attribute.
AttributeType.INTEGER64 64-bit integer attribute.
AttributeType.INTEGER64 VEC 64-bit integer vector attribute.
AttributeType [Link](str name)

A RGUMENTS
name Name of an attribute.

R ETURNS
The type of an attribute or [Link] for an invalid attribute name.

S EE ALSO

[Link](), [Link]()

GetAttributeUnit
Retruns the unit of an attribute e.g. km, MW. . . .
str [Link](str name)

A RGUMENTS
name Name of an attribute.

R ETURNS
”” For invalid attribute names.
str Attribute unit.

DIgSILENT PowerFactory 2018, Python Function Reference 49


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link]()

GetChildren
This function returns the objects that are stored within the object the function was called on.
In contrast to [Link]() this function gives access to objects that are currently
hidden due to scheme management.
list [Link](int hiddenMode,
[str filter,]
[int subfolders])

A RGUMENTS
hiddenMode
Determines how hidden objects are handled.
0 Hidden objects are ignored. Only nonhidden objects are returned.
1 Hidden objects and nonhidden objects are returned.
2 Only hidden objects are returned. Nonhidden objects are ignored.
filter (optional)
Name filter, possibly containing '*' and '?' characters.
subfolder (optional)
Determines if children of subfolders are returned.

0 Only direct children are returned, children of subfolders are ignored


(Default).
1 Also children of subfolders are returned.

R ETURNS
Objects that are stored in the called object.

S EE ALSO

[Link]()

GetClassName
Returns the class name of the object.
str [Link]()

R ETURNS
The class name of the object.

GetCombinedProjectSource
For an object in a combined project return the intermediate folder where the object is contained,
indicating the original source project.
DataObject [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 50


Chapter 5. Object Methods

R ETURNS
The intermediate folder for that object or nothing when not applicable.

GetConnectedElements
Returns the set of connected elements. Only electrically connected elements are returned when
the conditions of all switches are regarded. Possible connections will also be returned when rBrk
and/or rDis is zero, in the case of open breakers and/or disconnectors. The default values are
(0,0,0).
list [Link]([int rBrk],
[int rDis],
[int rOut])

A RGUMENTS
rBrk (optional)
if 1, regards position of breakers
rDis (optional)
if 1, regards position of disconnectors
rOut (optional)
if 1, regards in-service or out-of-service status

R ETURNS
The set of connected elements.

GetConnectionCount
Returns the number of electrical connections.
int [Link]()

R ETURNS
The number of electrical connections.

GetContents
Returns the objects that are stored in the object and whose name matches the argument name.
No object is returned if the object's container is empty, or if the object is not capable of storing
objects. The argument name may contain the complete name and classname, or parts of the
name with wildcard and class name.
list [Link]([str Name,]
[int recursive])

A RGUMENTS
Name (optional)
loc [Link] name, name possibly contains wildcards: '*' and '?' characters
recursive (optional)
1 All contained objects will be added recursively.
0 (default) Only direct children of current object will be collected.

DIgSILENT PowerFactory 2018, Python Function Reference 51


Chapter 5. Object Methods

R ETURNS
Objects that are stored in the object.

GetControlledNode
Returns the target terminal and the resulting target voltage for generators and other voltage
regulating units.
[DataObject node,
float targetVoltage] [Link](int bus,
[int check])

A RGUMENTS
bus)
-1 currently controlled bus
0 HV bus
1 MV/ LV bus
2 LV bus

targetVoltage (out)
The target voltage of the voltage regulating unit in pu.
check (optional)
0 (default) Do not check if the control mode is set to voltage control.
1 Only return the controlled node if the control mode is set to voltage
control.

R ETURNS
Controlled node, None if no controlled terminal exists (or not voltage controlled if check=1)

GetCubicle
Returns the cubicle of an object at the connection with index n, or None if there is no cubicle
inside the object.
DataObject [Link](int side)

A RGUMENTS
side The connection number.

R ETURNS
The cubicle object or None.

GetFullName
Returns the full name of the object as a string.
str [Link]([int type])

DIgSILENT PowerFactory 2018, Python Function Reference 52


Chapter 5. Object Methods

A RGUMENTS
type(optional)
Is used to determine the format of the returned full name:

not given
No special formatting.
=0
Same format as used in [Link]() and also clickable when
printed to the output window.
> 0 (but less or equal to 190)
Formatted exactly to this length and also clickable when printed to the output
window.

R ETURNS
The fullname (complete database path including the name and class name) of the object.

GetImpedance
Returns the positive sequence impedance of an element referred to a given voltage.
[int error,
float real,
float imag] [Link](float refVoltage,
[int i3Trf])

A RGUMENTS
real (out) Real part of the impedance in Ohm.
imag (out)
Imaginary part of the impedance in Ohm.
refVoltage
Reference voltage for the impedance in kV.
i3Trf (optional)
When used with an ElmTr3
0 Return the HV-MV impedance.
1 Return the HV-LV impedance.
2 Return the MV-LV impedance.

R ETURNS
1 An error occurred.
0 Otherwise.

S EE ALSO

[Link]()

GetInom
Returns the nominal current of the object at given bus index.
float [Link]([int busIndex = 0])

DIgSILENT PowerFactory 2018, Python Function Reference 53


Chapter 5. Object Methods

A RGUMENTS
busIndex (optional)
Bus index, default value is 0.

R ETURNS
The nominal current at bus index.

S EE ALSO

[Link]()

GetNode
Returns the node connected to the object at specified bus index.
DataObject [Link](int busIndex,
[int considerSwitches = 0])

A RGUMENTS
busIndex Bus index.
considerSwitches (optional)
0 Ignore the status of the switches (default).
1 Consider the status of the switches.

R ETURNS
object Connected node object at specified bus index.
None If no node at bus index is found.

GetOperator
Returns the element’s operator (ElmOperator ).
DataObject [Link]()

R ETURNS
Object of class ElmOperator determined according to following rules

• If operator is set in current object instance (attribute “pOperator”) this operator object is
retured.
• Else the operator inherited from its parent is used (recursively applied).
• None if none if its parents have an operator set.

GetOwner
Returns the elements’s owner (ElmOwner ).
DataObject [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 54


Chapter 5. Object Methods

R ETURNS
Object of class ElmOwner determined according to following rules

• If owner is set in current object instance (attribute “pOwner”) this owner object is retured.
• Else the owner inherited from its parent is used (recursively applied).
• None if none if its parents have an operator set.

GetParent
Returns the parent folder object (same as parameter ’fold id’).
DataObject [Link]()

R ETURNS
DataObject The parent folder object.
None On the root database folder e.g. parent of a user.

S EE ALSO

[Link]()

GetReferences
Returns a set containing all objects with references to the object the method was called on.
list [Link]([str filter,] [int includeSubsets])

A RGUMENTS
filter (optional)
Object filter to get only objects whose name matches this filter string, e.g. '*.'.
includeSubsets (optional)
Forces references from IntSubset objects to be evaluated. These are normally not
included for performance reasons.

R ETURNS
Set of referenced objects.

GetRegion
All network components are internally associated with an artificial region. A region consists of
topologically connected elements. This means, two elements elm1 and elm2 are topologically
connected ⇔ [Link]() == [Link]().
A region is simply identified by a number that can be access via this function.
int [Link]()

R ETURNS
Region index >0. A value of ‘-1’ means status is unknown for that element (normally for not
topology relevant elements).

DIgSILENT PowerFactory 2018, Python Function Reference 55


Chapter 5. Object Methods

GetSupplyingSubstations
Returns the closest supplying substation(s) for a network component.
“Closest” means that there is no other supplying element of same type in topological path be-
tween network component and the supplying component(s) returned by this function.
list [Link]()

R ETURNS
List of substations (objects of class ElmSubstat). Can be empty.

S EE ALSO

[Link](), [Link](), [Link](),


[Link](), [Link](), [Link]

GetSupplyingTransformers
Returns the closest supplying transformer(s) for a network component. “Closest” means that
there is no other supplying element of same type in topological path between network compo-
nent and the supplying component(s) returned by this function.
list [Link]()

R ETURNS
List of transformers (objects of class ElmTr2 or ElmTr3). Can be empty.

S EE ALSO

[Link](), [Link](), [Link](),


[Link](), [Link](), [Link]()

GetSupplyingTrfstations
Returns the closest supplying transformer station(s) for a network component.
“Closest” means that there is no other supplying element of same type in topological path be-
tween network component and the supplying component(s) returned by this function.
list [Link]()

R ETURNS
List of transformer stations (objects of class ElmTrfstat). Can be empty.

S EE ALSO

[Link](), [Link](), [Link](),


[Link](), [Link](), [Link]

GetSystemGrounding
Returns the grounding type employed in the grounding area of the grid the object belongs to.
The grounding area is defined by network components separating the zero sequence system
(e.g. star-delta transformers).
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 56


Chapter 5. Object Methods

R ETURNS
-1 grounding type can not be determined
0 system is solidly grounded
1 system is compensated
2 system is isolated

GetUnom
Returns the nominal voltage of the object.
float [Link]([int busIndex = 0])

A RGUMENTS
busIndex (optional)
Bus index, default value is 0.

R ETURNS
The nominal voltage at bus index.

S EE ALSO

[Link]()

GetUserAttribute
This function offers read-access to a simple form of user-defined attributes. These attributes
must be defined in an XML-like syntax in the description field of an object (variable 'desc').
The syntax for a user-defined variable is:
<Attribute Name=“name” Type=“type”>value</>
With:

name Name of the attribute


type Attribute type, valid values 'string', 'integer', 'double'
value Current value of the attribute

Note: The format is case-sensitive!


Example:
<Attribute Name=“var1” Type=“int”>2008< / >
<Attribute Name=“var2” Type=“string”>Hello PowerFactory < / >

[int|float|str value,
int error ] [Link](str attName)

A RGUMENTS
attName Name of the user-defined attribute
error (out)
Parameter for returned error value

DIgSILENT PowerFactory 2018, Python Function Reference 57


Chapter 5. Object Methods

R ETURNS
0 Attribute found and value returned
1 Attribute could not be accessed (e.g. attribute not found in given object, definition
is incomplete or wrong, format value is not compatible with given type).

GetZeroImpedance
Returns the zero sequence impedance of an element referred to a given voltage.
[int error,
float real,
float imag] [Link](float refVoltage,
[int i3Trf])

A RGUMENTS
real (out) Real part of the impedance in Ohm.
imag (out)
Imaginary part of the impedance in Ohm.
refVoltage
Reference voltage for the impedance in kV.
i3Trf (optional)
When used with an ElmTr3
0 Return the HV-MV impedance.
1 Return the HV-LV impedance.
2 Return the MV-LV impedance.

R ETURNS
1 An error occurred.
0 Otherwise.

S EE ALSO

[Link]()

HasAttribute
Returns whether the given name is a currently valid attribute name.
int [Link](str name)

A RGUMENTS
name Name of an attribute.

R ETURNS
0 Given name is not a currently valid attribute name.
1 Given name is a currently valid attribute name.

S EE ALSO

[Link](), [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 58


Chapter 5. Object Methods

HasResults
Checks if the object has calculated result parameters.
int [Link]([int ibus])

A RGUMENTS
ibus (optional)
Bus index

-1(default) Checks if “c:” quantities exist


>= 0 Checks if 'm:xxxx:bus ' quantities exist for bus index=ibus
2 Hidden objects are returned

R ETURNS
0 no results available
1 results exist

IsCalcRelevant
Returns whether the object is relevant for calculation.
int [Link]()

R ETURNS
0 When the object is not used for calculations.
1 When the object is currently used for calculations.

S EE ALSO

[Link]()

IsDeleted
Returns 1 if the object is deleted.
int [Link]()

R ETURNS
1 Object is already deleted.
0 Object is not deleted.

IsEarthed
Checks if a network component is topologically connected to any earthed component. Earthing
components are terminals / busbars (ElmTerm) with attribute ‘iEarth’ = 1 and all closed ground-
ing switches (ElmGndswt). An energized component is never considered to be earthed.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 59


Chapter 5. Object Methods

R ETURNS
1 Component is earthed (connected to an earthing component)
0 Component is not earthed

IsEnergized
Checks if a network component is energized. A component is considered to be energized, if it is
topologically connected to a generator. All other elements are considered to be deenergized.
int [Link]()

R ETURNS
1 Component is energized
0 Component is deenergized
-1 Component has no energizing status (status unknown)

IsHidden
Checks whether an object is hidden with respect to currently activated variation. An object is
hidden if it is

• deleted in currently active variation or

• added in a variation that is currently not active

int [Link]()

R ETURNS
0 not hidden, currently ’active’
1 hidden, currently ’inactive’

IsInFeeder
Indicates if the object belongs to the feeder area defined by “Feeder”.
int [Link](DataObject Feeder,
[int OptNested=0])

A RGUMENTS
Feeder The Feeder definition object ElmFeeder
OptNested (optional
0 Nested feeders are not considered.
1 Nested feeders are considered.

R ETURNS
1 If “Feeder” is a feeder definition and the object is in the feeder area.
0 Otherwise

DIgSILENT PowerFactory 2018, Python Function Reference 60


Chapter 5. Object Methods

IsNetworkDataFolder
Checks whether given object is a special folder within a project that stores specific data ele-
ments. Each project can not have more than one instance per folder type.
The following folder types are distinguished (PowerFactory class names):

IntArea stores ElmArea objects


IntBbone stores ElmBbone and SetBbone objects
IntBmu stores ElmBmu objects

IntBoundary stores ElmBoundary objects


IntCircuit stores ElmCircuit objects
IntFeeder stores ElmFeeder objects

IntMeteostat stores ElmMeteostat objects


IntOperator stores ElmOperator objects
IntOwner stores ElmOwner objects
IntPath stores SetPath objects

IntRoute stores ElmRoute objects


IntScales stores Tri* objects

int [Link]()

R ETURNS
0 false, object is not a network data folder
1 true, object is a network data folder

S EE ALSO

[Link]()

IsNode
Indicates wtheter an object is a node (terminal or busbar).
int [Link]()

R ETURNS
1 Object is a node.
0 Otherwise.

IsObjectActive
Check if an object is active for specific time.
int [Link](int time)

DIgSILENT PowerFactory 2018, Python Function Reference 61


Chapter 5. Object Methods

R ETURNS
0 Object is not active (hidden or deleted)
1 Object is active

IsObjectModifiedByVariation
Check if an object is active for specific time.
int [Link](int considerADD, int considerDEL, int considerDELTA)

A RGUMENTS
considerADD
checks if an ADD-object exists
0 ignore ADD-objects
1 consider ADD-objects
considerDEL
check if a DELETE-Object exists or exist for the parent objects
0 ignore DELETE-objects
1 consider DELETE-objects
considerDELTA
check if a DELTA-Object exists
0 ignore DELTA-objects
1 consider DELTA-objects

R ETURNS
0 Object is not modified by an active variation
1 Object is modified by an active variation

Isolate
Performs an “isolate” action on the network element. This corresponds to performing a “switch
off” action followed by an additional earthing of switched off region.
The action is identical to that in the context menue.
[int error,
list changedSwitches] [Link]([int resetRA,]
[int isolateCBs])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set
resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.
1 All running arrangements that cause blocking of relevant switches are
applied and reset automatically before the switching is performed.

DIgSILENT PowerFactory 2018, Python Function Reference 62


Chapter 5. Object Methods

0 (default) Active running arrangements are not reset. Blocked switches


will cause the switching action to fail
isolateCBs (optional)
Determines if, in addition, circuit breakers should be isolated by opening its adja-
cent disconnectors (if not given, default will be taken from project settings)
0 No additional opening of disconnectors
1 Also open disconnectors adjacent to switched circuit breakers)

R ETURNS
Information about the success of the action:

0 Action was successful


1 Action failed

S EE ALSO

[Link](), [Link](), [Link]()

IsOutOfService
Indicates whether or not the object is currently out of service.
int [Link]()

R ETURNS
0 When the object is in service.
1 When the object is out of service.

IsReducible
Checks if object can be reduced during network reduction.
int [Link]()

R ETURNS
0 object can never be reduced.
1 object can be reduced (e.g. switch, zero-length lines)
2 in principle the object can be reduced, but not now (e.g. switch that is set to be
detailed)

IsShortCircuited
Returns whether an element is short-circuited or not.

R ETURNS
0 No short-circuit found.
1 Element is short-circuited.

DIgSILENT PowerFactory 2018, Python Function Reference 63


Chapter 5. Object Methods

MarkInGraphics
Marks the object in the diagram in which the element is found by hatch crossing it. By default
all the currently opened diagrams are searched for the element to mark beginning with the
diagram shown. The first diagram in which the element is found will be opened and the element
is marked.
Alternatively the search can be extended to all existing diagrams by passing 1 as parameter. If
the element exists in more than one diagram the user can select from a list of diagrams which
diagram shall be opened.
None [Link]([int SearchAllDiagramsAndSelect])

A RGUMENTS
SearchAllDiagramsAndSelect (optional)
Search can be extended to all diagrams, not only the ones which are currently
shown on the desktop.

0 Only search in currently opened diagrams and open the first diagram
in which the element was found.
1 Searching all diagrams, not only the ones which are currently shown
on the desktop. If there is more than one occurrence the user will be
prompted which diagrams shall be opened.

R ETURNS
A diagram in which the element is drawn is opened and the element is marked.

Move
Moves an object or a set of objects to this folder.
int [Link](DataObject O)
int [Link](list S)

A RGUMENTS
O(optional)
Object to move
S(optional)
Set of objects to move

R ETURNS
0 on success
1 on error

PasteCopy
This function pastes the copy of the given object(s) into this (=target) using the merge tool when
source and target are inside different projects (equivalent to a manual copy&paste operation).
int [Link](DataObject oCopyObj)
int [Link](list oCopyObj)

DIgSILENT PowerFactory 2018, Python Function Reference 64


Chapter 5. Object Methods

A RGUMENTS
oCopyObj
Object to be copied
sCopySet
Set of object to be copied

R ETURNS
0 Object(s) successfully copied
1 Error

PurgeUnusedObjects
The function deletes the following child objects:

1. All 'hidden' objects without corresponding ”Add” object. These objects are only deleted, if
the condition is fulfilled for all child objects (hidden without corresponding 'Add' object).
2. All internal expansion stage objects with invalid target object (target object reference is
missing).

It’s crucial that there is no study case active when executing the function.
None [Link]()

S EE ALSO

[Link]()

ReplaceNonAsciiCharacters
Replaces all non-ASCII characters in all text attributes by similar ASCII characters. Emits a
warning if a charcter can not replaced, because no replacement character was defined.
int [Link](DataObject map,
str defaultReplacementCharacter)

A RGUMENTS
map IntMat object with two columns: the first column contains the codes of the non-
ASCII character, the second column contains the code of the ASCII character.
defaultReplacementCharacter
String containing one ASCII character. If map does not contain a replacement for
a non-ASCII character, it is replaced by defaultReplacementCharacter.

R ETURNS
Returns 1 when the function was executed successfully.

ReportNonAsciiCharacters
Reports all text attributes of this objects containing non-ASCII characters in the output window.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 65


Chapter 5. Object Methods

ReportUnusedObjects
Prints a report in the PowerFactory output window, which object will be deleted when function
[Link]() is called. It’s crucial that there is no study case active when
executing the function.
None [Link]()

S EE ALSO

[Link]()

SearchObject
Searches for an object with a full name, such as
'[Link]\[Link]\...\[Link] '.
DataObject [Link](str name)

A RGUMENTS
name string to search

R ETURNS
Returns the searched object.

S EE ALSO

[Link]()

SetAttribute
Sets the value of an attribute.
None [Link](str name,
int|float|str|DataObject|list value)

A RGUMENTS
name Name of an attribute.
value Value to be set in its current unit (like in the edit dialog seen). An exception is
thrown for invalid attribute names.

S EE ALSO

[Link](), [Link]()

SetAttributeLength
Sets the length of a vector or matrix attribute. The length of a matrix attribute is the number of
rows.
int [Link](str name, int length)

A RGUMENTS
name Name of an attribute.
length New length of the attribute.

DIgSILENT PowerFactory 2018, Python Function Reference 66


Chapter 5. Object Methods

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link]()

SetAttributeShape
Sets the shape of a matrix or vector attribute. The shape is a list of the form [number of rows,
number of colums]. Number of colums has to be 0 for vectors.
int [Link](str name, list(int, int) shape)

A RGUMENTS
name Name of an attribute.
shape New shape of the attribute.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link]()

ShowEditDialog
Opens the edit dialogue of the object. Command objects (such as ComLdf ) will have their “Ex-
ecute” button disabled. The execution of the running script will be halted until the edit dialogue
is closed again.
Editing of command objects (ComDPL, ComPython) is not supported.
int [Link]()

R ETURNS
1 Edit dialogue was cancelled by the user.
0 Otherwise.

ShowModalSelectTree
Shows the current database object tree. The element on which the function is called on is
initially selected.
DataObject [Link]([str title,]
[str filter])

A RGUMENTS
title (optional)
Title of the dialog. If omitted, a default title will be used.

DIgSILENT PowerFactory 2018, Python Function Reference 67


Chapter 5. Object Methods

filter (optional)
Classname filter e.g. 'ElmLne' or 'Com*'. If set, a selection is only accepted if the
classname of the selected object matches that filter.

R ETURNS
DataObject Selected object.
None No object selcted e.g. 'Cancel' clicked.

SwitchOff
Performs a “switch off” action on the network element. This action is identical to that in the
context menue.
[int error,
list changedSwitches] [Link]([int resetRA]
[int simulateOnly])

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set

resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.
1 All running arrangements that cause blocking of relevant switches are
applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail
simulateOnly (optional)
Can be used to get the switches that would be changed. No switching is performed
if set to ‘1’. (default is ’0’)

R ETURNS
Information about the success of the action:

0 Action was successful


1 Action failed

S EE ALSO

[Link](), [Link](), [Link]()

SwitchOn
Performs a “switch on” action on the network element. This action is identical to that in the
context menue.
[int error,
list changedSwitches] [Link]([int resetRA,]
[int simulateOnly])

DIgSILENT PowerFactory 2018, Python Function Reference 68


Chapter 5. Object Methods

A RGUMENTS
changedSwitches (optional, out)
All switches whose switching state was changed by the action are filled into this
set

resetRA (optional)
Determines whether an active running arrangement that would prevent switching
action should be deactivated or not.
1 All running arrangements that cause blocking of relevant switches are
applied and reset automatically before the switching is performed.
0 (default) Active running arrangements are not reset. Blocked switches
will cause the switching action to fail
simulateOnly (optional)
Can be used to get the switches that would be changed. No switching is performed
if set to ‘1’. (default is ’0’)

R ETURNS
Iinformation about the success of the action:

0 Action was successful


1 Action failed

S EE ALSO

[Link](), [Link](), [Link]()

WriteChangesToDb
See [Link]() for a detailed description.
None [Link]()

5.2 Network Elements

5.2.1 ElmArea
Overview

CalculateInterchangeTo
DefineBoundary
GetAll
GetBranches
GetBuses
GetObjs

CalculateInterchangeTo
Calculates interchange power to the given area (calculated quantities are: Pinter, Qinter, Pex-
port, Qexport, Pimort, Qimport). Prior the calculation the valid load flow calculation is required.
int [Link](DataObject area)

DIgSILENT PowerFactory 2018, Python Function Reference 69


Chapter 5. Object Methods

A RGUMENTS
area Area to which the interchange is calculated

R ETURNS
<0 Calculation error (i.e. no valid load flow, empty area...)
0 No interchange power to the given area
1 Interchange power calculated

DefineBoundary
Defines boundary with this area as interior part. Resulting cubicles of boundary are busbar-
oriented towards the area.
DataObject [Link](int shift)

A RGUMENTS
shift Elements outside the area that are within a distance of shift many elements to a
boundary cubicle of the area are added to the interior part of the resulting bound-
ary

R ETURNS
The defined boundary is returned in case of success. Otherwise NULL, if an error appeared
in the definition of the boundary.

GetAll
Returns all objects which belong to this area.
list [Link]()

R ETURNS
The set of contained objects.

GetBranches
Returns all branches which belong to this area.
list [Link]()

R ETURNS
The set of branch objects.

GetBuses
Returns all buses which belong to this area.
list [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 70


Chapter 5. Object Methods

R ETURNS
The set of objects.

GetObjs
Returns all objects of the given class which belong to this area.
list [Link](str classname)

A RGUMENTS
classname
Name of the class (i.e. ”ElmTr2”).

R ETURNS
The set of objects.

5.2.2 ElmAsm
Overview

GetAvailableGenPower
GetElecTorque
GetGroundingImpedance
GetMechTorque
GetMotorStartingFlag
GetStepupTransformer
IsPQ

GetAvailableGenPower
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the av-
erage of the power values (in MW) obtained from all the specified time characteristics for
the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

DIgSILENT PowerFactory 2018, Python Function Reference 71


Chapter 5. Object Methods

For motors, the available power is zero.


float [Link]()

R ETURNS
Available generation power

GetElecTorque
Calculates the electrical torque for a given speed and voltage.
float [Link](float speed,
float uReal,
[float addZReal,]
[float addZImag]
)

A RGUMENTS
speed speed value in p.u.
uReal voltage value (real part) in p.u.
addZReal (optional)
additional impedance (real part) in p.u.
addZImag (optional)
additional impedance (imaginary part) in p.u.

R ETURNS
Returns the calculated electrical torque.

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

DIgSILENT PowerFactory 2018, Python Function Reference 72


Chapter 5. Object Methods

GetMechTorque
Calculates the electrical torque for a given speed and voltage.
float [Link](float speed,
float uReal
)

A RGUMENTS
speed speed value in p.u.
uReal voltage value (real part) in p.u.

R ETURNS
Returns the calculated mechanical torque.

GetMotorStartingFlag
Returns the starting motor condition.
int [Link]()

R ETURNS
Returns the motor starting condition. Possible values are:

-1 in the process of being calculated


0 not calculated
1 successful start
2 unsuccessful start

GetStepupTransformer
Performs a topological search to find the step-up transformer of the asynchronous machine.
DataObject [Link](float Voltage,
int swStatus
)

A RGUMENTS
hvVoltage
voltage level at which the search will stop
ignSwtStatus
consideration of switch status. Possible values are:
0 consider all switch status
1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

DIgSILENT PowerFactory 2018, Python Function Reference 73


Chapter 5. Object Methods

IsPQ
Informs whether or not it is a ”PQ” machine (constant Q control mode).
int [Link]()

R ETURNS
Returns 1 if it is a ”PQ” machine.

5.2.3 ElmAsmsc
Overview

GetAvailableGenPower
GetGroundingImpedance
GetStepupTransformer

GetAvailableGenPower
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the av-
erage of the power values (in MW) obtained from all the specified time characteristics for
the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


float [Link]()

R ETURNS
Available generation power

GetGroundingImpedance
Returns the impedance of the internal grounding.

DIgSILENT PowerFactory 2018, Python Function Reference 74


Chapter 5. Object Methods

[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetStepupTransformer
Performs a topological search to find the step-up transformer of the asynchronous machine.
DataObject [Link](float Voltage,
int swStatus
)

A RGUMENTS
hvVoltage
voltage level at which the search will stop
ignSwtStatus
consideration of switch status. Possible values are:

0 consider all switch status


1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

5.2.4 ElmBbone
Overview

CheckBbPath
GetBbOrder
GetCompleteBbPath
GetFOR
GetMeanCs
GetMinCs
GetTieOpenPoint
GetTotLength
HasGnrlMod

DIgSILENT PowerFactory 2018, Python Function Reference 75


Chapter 5. Object Methods

CheckBbPath
Check whether the backbone object is still valid. This means:

a Terminals determining backbone path are still directly connected.


b One switch is open on the path of an inter-feeder backbone.
c Contents of backbone match specified starting-feeder (and end feeder).
d Start and end of feeder are calculation-relevant.
e Path is unique via the defined terminals (no parallel elements (only warning!)).

int [Link](int outputMsg)

A RGUMENTS
outputMsg
1 Output resulting messages of check function.
0 Only check, no output of messages.

R ETURNS
0 Backbone is valid.
1 Backbone is invalid because of one or more of the above listed reasons.

GetBbOrder
Get order of backbone object, determined by backbone calculation according to the selected
criterion.
int [Link]()

R ETURNS
The order of the backbone object. The smaller the returned value, the better the backbone
according to chosen criterion. The order 1 is returned for the best backbone.

GetCompleteBbPath
Get the complete (ordered) path containing all terminals and connecting elements of the back-
bone.
list [Link](int iReverse,
[int iStopAtTieOpen = 0])

A RGUMENTS
AllElmsOnBb (out)
Ordered path containing all terminals and connecting elements of the backbone.
iReverse
0 Return ordered path from start feeder to end feeder
1 Return ordered path from end feeder to start feeder
iStopAtTieOpen
0 return complete path

DIgSILENT PowerFactory 2018, Python Function Reference 76


Chapter 5. Object Methods

1 only return part of path in start feeder (iReverse=0) / in end feeder


(iReverse=1)

GetFOR
Get aggregated forced outage rate (FOR) of all elements on the path of the backbone.
float [Link]()

R ETURNS
The aggregated forced outage rate (FOR) of all elements on the path of the backbone [in
1/a].

GetMeanCs
Get mean cross section value of all elements on the path of the backbone. Every cross section
value is weighted with the relative length corresponding to the total length of the backbone.
float [Link]()

R ETURNS
The mean cross section of the elements on the backbone path [in mm2].

GetMinCs
Get minimum cross section value of all elements on the path of the backbone. Optional: a set
with all elements on the backbone path featuring this cross section may be returned.
[float minCs,
set ElmsMinCs] [Link]()

A RGUMENTS
ElmsMinCs
Elements on the backbone path featuring minimum cross section value.

R ETURNS
The minimum cross section of all elements on the backbone path [in mm2].

GetTieOpenPoint
Search and obtain the first open switching device (ElmCoup, StaSwitch) on the backbone path
(starting from the infeeding point of the starting feeder).
DataObject [Link]()

R ETURNS
The switching device (ElmCoup or StaSwitch) or None if backbone is invalid.

DIgSILENT PowerFactory 2018, Python Function Reference 77


Chapter 5. Object Methods

GetTotLength
Get total lenth of all elements on the path of the backbone.
float [Link]()

R ETURNS
The total length of the backbone path [in km].

HasGnrlMod
Check whether backbone object ElmBbone has a valid CalBbone where corresponding results
are stored. This is only the case after a backbone calculation by scoring method (until the
calculation is reset).
int [Link]()

R ETURNS
1 ElmBbone has a calculation model,
0 no calculation model available.

5.2.5 ElmBmu
Overview

Apply
Update

Apply
Applies the power dispatch. Depending on the selected 'Distribution Mode ' this is done by a
built-in algorithm based on 'Merit Order' or by a user-defined DPL script that is stored in the
contents of the virtual power plant object.
int [Link]()

R ETURNS
0 on success, no error occurred
1 error during dispatch by virtual power plant. Please note, a value of 1 is also
returned in case the power plant is current set out-of-service.

Update
Updates the list of machines in the tables: 'Dispatchable Machines' and 'Non-dispatchable
(fixed) Machines'.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 78


Chapter 5. Object Methods

5.2.6 ElmBoundary
Overview

AddCubicle
CalcShiftedReversedBoundary
Clear
GetInterior
IsSplitting
Resize
Update

AddCubicle
Adds a given cubicle with given orientation to an existing boundary. The cubicle is added only if
it is not already contained within the boundary.
int [Link](DataObject cubicle,
int orientation
)

R ETURNS
0 cubicle was successfully added
1 cubicle was not added because it is already contained (including given orienta-
tion)

CalcShiftedReversedBoundary
Defines boundary where exterior and interior part of this boundary are exchanged. Resulting
boundary cubicles are branch-oriented.
[int error,
DataObject boundary] [Link](float shift)

A RGUMENTS
shift Elements that are within a distance of shift many elements to a boundary cubicle
of this boundary are added to the exterior part of the resulting boundary.
boundary (out)
Defined boundary.

R ETURNS
0 Successful call, boundary defined.
1 Error during determination of boundary cubicles.

Clear
Removes all boundary cubicles from an existing boundary.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 79


Chapter 5. Object Methods

GetInterior
Returns a set of all elements that are contained in the interior region of the boundary.
list [Link]()

R ETURNS
Returns the set of interior elements.

IsSplitting
Checks if the boundary splits the network into two regions. A boundary is called splitting, if and
only if, for each boundary cubicle, the adjacent terminal and the adjacent branch component
belong to different sides of the boundary.
[int isSplitting,
list notSplittingCubicles] [Link]()

A RGUMENTS
notSplittingCubicles (optional, out)
All cubicles that prevent the boundary from being splitting are filled into this set.

R ETURNS
0 not splitting boundary
1 splitting boundary

Resize
Resizes the boundary cubicle vector or the cubicle orientation vector. It is strongly advised that
the size of both vectors must be the same.
None [Link](float size,
str name
)

A RGUMENTS
size size of the referenced vector (number of cubicles)

name reference to the vector (’iorient’ or ’cubicles’)

R ETURNS
If the resize is unsuccessful the error message shall be issued.

Update
Updates cached information (such as topological interiour). Required when boundary definition
was changed via DPL or Python.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 80


Chapter 5. Object Methods

5.2.7 ElmBranch
Overview

Update

Update
Updates connection points and contained elements of the branch. If the branch element exter-
nally modified by the user, then the update shall refresh all connections in the correct manner.
Behaves same as the update button within the ElmBranch.
None [Link]()

5.2.8 ElmCabsys
Overview

FitParams
GetLineCable
Update

FitParams
Calculates distributed parameters for cable system elements. Whether this function calculates
constant parameters or frequency dependent parameters depends on the user setting of the
parameter 'i model' in the ElmCabsys dialog. The settings are as follows: i model=0: constant
parameters; i model=1: frequency dependent parameters.
int [Link]()

R ETURNS
0 on success
1 on error

GetLineCable
Gets cable type for the corresponding line, within the cable system.

R ETURNS
cable type on success
None on error
DataObject [Link]()

Update
Updates cable system element depending on configuration of the associated cable system
type.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 81


Chapter 5. Object Methods

R ETURNS
1 On success.
0 On error.

5.2.9 ElmComp
Overview

SlotUpdate

SlotUpdate
Performs a slot update for the composite model, to try to reassign each model found in the
composite model contents to the corresponding slot.
None [Link]()

D EPRECATED N AMES
Slotupd

5.2.10 ElmCoup
Overview

Close
GetRemoteBreakers
IsBreaker
IsClosed
IsOpen
Open

Close
Closes the switch by changing its status to ’close’. This action will fail if the status is currently
determined by an active running arrangement.
int [Link]()

R ETURNS
0 On success
6= 0 On error

S EE ALSO

[Link]()

GetRemoteBreakers
Returns the remote circuit breakers and connected bus bars.
This information is determined by a topological search that starts at given breaker in all direc-
tions, stopping at

DIgSILENT PowerFactory 2018, Python Function Reference 82


Chapter 5. Object Methods

• switches of type circuit breaker

• switches that are open


• busbars (ElmTerm::iUsage == 0)

which are connected by non-reducible components (see [Link]()) only. If


search stops at a breaker that is in given breaker state (desiredBreakerState), it is added to
the returned breakers collection. All busbars at which the search stops are added to the busbar
collection.
Note: the remote breakers found in the same direction as a found bus bar are excluded.
[list remoteBreakers,
list foundBreakers,
list foundBusbars ] [Link](int desiredBreakerState)

A RGUMENTS
desiredBreakerState
Only breakers with given status are collected.

-1 Return all remote circuit breakers


1 Return all closed remoted circuit breakers
0 Return all opened remoted circuit breakers
foundBreakers (out)
The list of the remote circuit breakers
foundBusbars (optional, out)
The list of the local bus bars

IsBreaker
Checks if type of current switch is ’circuit-breaker’.
int [Link]()

R ETURNS
1 switch is a circuit-breaker,
0 switch is not a circuit-breaker

IsClosed
Returns information about current switch state.
int [Link]()

R ETURNS
1 switch is closed
0 switch is open

S EE ALSO

[Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 83


Chapter 5. Object Methods

IsOpen
Returns information about current switch state.
int [Link]()

R ETURNS
1 switch is open
0 switch is closed

S EE ALSO

[Link]()

Open
Opens the switch by changing its status to ’open’. This action will fail if the status is currently
determined by an active running arrangement.
int [Link]()

R ETURNS
0 On success
6= 0 On error

S EE ALSO

[Link]()

5.2.11 ElmDsl
Overview

ExportToClipboard
ExportToFile

ExportToClipboard
Export the parameter list to clipboard.
None [Link]([str colSeparator],
[int useLocalHeader]
)

A RGUMENTS
colSeparator (optional)
Separator between the columns (default: tab character).

useLocalHeader (optional)
Use the localised version of the header. Possible values are:
1 Yes (default).
0 No (use English language header).

DIgSILENT PowerFactory 2018, Python Function Reference 84


Chapter 5. Object Methods

ExportToFile
Export the parameter list to CSV file(s).
None [Link](str filePath,
[str colSeparator],
[int useLocalHeader]
)

A RGUMENTS
filePath Path of the CSV target file. In case of array and matrix parameters (names: “ar-
ray NAME” and “matrix NAME”), additional CSV files are created in the same lo-
cation with names obtained by appending “ array NAME” and “ matrix NAME” to
the target file name.

colSeparator (optional)
Separator between the columns (default: “;”).
useLocalHeader (optional)
Use the localised version of the header. Possible values are:

1 Yes (default).
0 No (use English language header).

5.2.12 ElmFeeder
Overview

CalcAggrVarsInRadFeed
GetAll
GetBranches
GetBuses
GetNodesBranches
GetObjs

CalcAggrVarsInRadFeed
Computes all the aggregated variables in radial feeders.
int [Link]([int lookForRoot,]
[int considerNested])

A RGUMENTS
lookForRoot (optional)
Calculates the variables from the deepest root. Possible values are:

0 Start from this feeder


1 (default) Find the deepest root.
considerNested (optional)
Calculates the variables also for any nested subfeeders. Possible values are:

0 Ignore any nested feeders


1 (default) Consider nested feeders.

DIgSILENT PowerFactory 2018, Python Function Reference 85


Chapter 5. Object Methods

R ETURNS
Returns whether or not the aggregated variables were calculated. Possible values are:

0 error during calculation


1 calculated correctly

GetAll
Returns a set with all objects belonging to this feeder.
list [Link]([int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of network elements belonging to this feeder. Can be empty.

GetBranches
Returns a set with all branch elements belonging to this feeder.
list [Link]([int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of bus and branch elements in feeder.

GetBuses
Returns a set with all buses belonging to this feeder.
list [Link]([int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

DIgSILENT PowerFactory 2018, Python Function Reference 86


Chapter 5. Object Methods

R ETURNS
The set of bus elements in feeder.

GetNodesBranches
Returns a set with all buses and branches belonging to this feeder.
list [Link]([int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:
0 Only the objects of this feeder will be returned.
1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of bus and branch elements in feeder.

GetObjs
Returns a set with all objects of class 'ClassName' which belong to this feeder.
list [Link](str ClassName,
[int iNested])

A RGUMENTS
iNested (optional)
Affects the collection of objects in case of nested feeders:

0 Only the objects of this feeder will be returned.


1 (default) All elements including those of nested feeders will be re-
turned.

R ETURNS
The set of feeder objects.

5.2.13 ElmFile
Overview

LoadFile
SaveFile

LoadFile
(Re)Loads the file into a buffer.
int [Link]([int loadComplete = 1])

DIgSILENT PowerFactory 2018, Python Function Reference 87


Chapter 5. Object Methods

A RGUMENTS
loadComplete (optional)
0 Removes all points in the future simulation time and adds all points
from the file (including the current interpolated value).
1 Clears the buffer and reloads the complete file (default).

R ETURNS
0 On success.
6= 0 On error.

SaveFile
Saves the buffer and overwrites the file.
int [Link]()

R ETURNS
0 On success.
6= 0 On error.

5.2.14 ElmFilter
Overview

GetGroundingImpedance

GetGroundingImpedance
Returns the impedance of the internal grounding. Single phase filters connected to neutral are
considered as grounding devices themselves; i.e. instead of the dedicated grounding parame-
ters, the filters parameters are used.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

DIgSILENT PowerFactory 2018, Python Function Reference 88


Chapter 5. Object Methods

5.2.15 ElmGenstat
Overview

Derate
Disconnect
GetAvailableGenPower
GetGroundingImpedance
GetStepupTransformer
IsConnected
Reconnect
ResetDerating

Derate
Derates the value of the Max. Active Power Rating according to the specified value given in
MW.
The following formula is used: P max uc = P max uc − ”Deratingvalue”.
None [Link](float deratingP)

A RGUMENTS
deratingP Derating value

Disconnect
Disconnects a static generator by opening the first circuit breaker. The topological search per-
formed to find such a breaker, stops at any busbar.
int [Link]()

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

GetAvailableGenPower
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the av-
erage of the power values (in MW) obtained from all the specified time characteristics for
the current study time.

DIgSILENT PowerFactory 2018, Python Function Reference 89


Chapter 5. Object Methods

• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


float [Link]()

R ETURNS
Available generation power

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetStepupTransformer
Performs a topological search to find the step-up transformer of the static generator.
DataObject [Link](float voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop
swStatus consideration of switch status. Possible values are:
0 consider all switch status
1 ignore breaker status
2 ignore all switch status

DIgSILENT PowerFactory 2018, Python Function Reference 90


Chapter 5. Object Methods

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

IsConnected
Checks if generator is topologically connected to any busbar.
int [Link]()

R ETURNS
0 false, not connected to a busbar
1 true, generator is connected to a busbar

Reconnect
Connects a static generator by closing all switches (breakers and isolators) up to the first breaker
on the HV side of a transformer. The topological search to find all the switches, stops at any
busbar.
int [Link]()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

ResetDerating
Resets the derating value, setting the Max. Active Power Rating according to the rating factor.
The following formula is used: P max uc = pmaxratf ∗ P n ∗ ngnum.
None [Link]()

5.2.16 ElmGndswt
Overview

Close
GetGroundingImpedance
IsClosed
IsOpen
Open

Close
Closes the switch by changing its status to ’close’. If closed, the connected node will be consid-
ered as being earthed.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 91


Chapter 5. Object Methods

R ETURNS
1, always

S EE ALSO

[Link]()

GetGroundingImpedance
Returns the impedance of the internal grounding. ElmGndswt is only considered to have an
internal grounding if it is single phase and connected to neutral.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

IsClosed
Returns information about current switch state.
int [Link]()

R ETURNS
1 switch is closed
0 switch is open

S EE ALSO

[Link]()

IsOpen
Returns information about current switch state.
int [Link]()

R ETURNS
1 switch is open
0 switch is closed

DIgSILENT PowerFactory 2018, Python Function Reference 92


Chapter 5. Object Methods

S EE ALSO

[Link]()

Open
Opens the switch by changing its status to ’open’.
int [Link]()

R ETURNS
0, always

S EE ALSO

[Link]()

5.2.17 ElmLne
Overview

AreDistParamsPossible
CreateFeederWithRoutes
FitParams
GetIthr
GetType
GetY0m
GetY1m
GetZ0m
GetZ1m
GetZmatDist
HasRoutes
HasRoutesOrSec
IsCable
IsNetCoupling
MeasureLength
SetDetailed

AreDistParamsPossible
Check if the line fulfills conditions for the calculation of distributed parameters:

ElmLne No routes, no sections


TypTow only 1 circuit x 3 phases

TypGeo only 1 circuit x 3 phases


TypLne AC system, 3 phases and 0 neutral
TypCabsys only 1 circuit x 3 phases

int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 93


Chapter 5. Object Methods

R ETURNS
The returned value are:

0 All conditions fulfilled


1 Line contains routes
2 Line contains sections
3 Line has no type
4 TypTow/TypCabsys does not fulfill conditions for distributed paramters
5 TypLne does not fulfill conditions for distributed parameters
6 Short-circuit flag is set (EMT or RMS simulations)
7 TypLne/TypTow: B0 and B1 = 0
8 Error, no condition state could be determined

CreateFeederWithRoutes
Creates a new feeder in the line by splitting the line into 2 routes and inserting a terminal.
int [Link](float dis,
float rem,
DataObject O)
int [Link](float dis,
float rem,
DataObject O,
[int sw0,]
[int sw1])

A RGUMENTS
dis Inserting operation occurs after this distance
rem Remaining distance, percentage of distance ’dis’
O Branch object that is to be connected at the inserted terminal

sw0 If set to (1), switch is inserted on the first side


sw1 If set to (1), switch is inserted on the second side

R ETURNS
0 Success, feeders created
1 Error

FitParams
Calculates distributed parameters for line elements. Whether this function calculates constant
parameters or frequency dependent parameters depends on the user setting of the parameter
'i model' in the ElmLne dialogue. The settings are as follows: i model=0: constant parameters;
i model=1: frequency dependent parameters.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 94


Chapter 5. Object Methods

R ETURNS
0 Success
1 Error

GetIthr
Returns the rated short-time current of the line element.
float [Link]()

R ETURNS
Returns rated short-time current value

GetType
Returns the line type object.
DataObject [Link]()

R ETURNS
The TypLne object if exists or None

GetY0m
The function returns the zero-sequence mutual coupling admittance (G0m, B0m) in Ohm of the
line and input argument line (object Lne2). When Lne2 = line, the function returns the zero-
sequence self admittance.
[int error,
float G0m,
float B0m ] ElmLne.GetY0m(DataObject Lne2)

A RGUMENTS
Lne2 Line element
G0m (out)
Resulting G0m value
B0m (out)
Resulting B0m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

GetY1m
The function returns the positive-sequence mutual coupling admittance (G1m, B1m) in Ohm
of the line and input argument line (object Lne2). When Lne2 = line, the function returns the
positive-sequence self admittance.

DIgSILENT PowerFactory 2018, Python Function Reference 95


Chapter 5. Object Methods

[int error,
float G1m,
float B1m ] ElmLne.GetY1m (DataObject Lne2)

A RGUMENTS
Lne2 Line element
G1m (out)
Resulting G1m value

B1m (out)
Resulting B1m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

GetZ0m
Gets the zero-sequence mutual coupling impedance (R0m, X0m) in Ohm of the line and input
argument line (object otherLine). When otherLine = line, the function returns the zero-sequence
self impedance.
[int error,
float R0m,
float X0m ] ElmLne.GetZ0m(DataObject otherLine)

A RGUMENTS
otherLine Line element
R0m (out)
To be obtained R0m value
X0m (out)
To be obtained X0m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

GetZ1m
The function returns the positive-sequence mutual coupling impedance (R1m, X1m) in Ohm
of the line and input argument line (object Lne2). When Lne2 = line, the function returns the
positive-sequence self impedance.
[int error,
float R1m,
float X1m ] ElmLne.GetZ1m(DataObject Lne2)

DIgSILENT PowerFactory 2018, Python Function Reference 96


Chapter 5. Object Methods

A RGUMENTS
Lne2 Line element
R1m (out)
Resulting R1m value

X1m (out)
Resulting X1m value

R ETURNS
0 Success, data obtained
1 Error, e.g. no coupling objects defined

GetZmatDist
The function gets impedance matrix in phase domain (only amplitudes), for a line with distributed
parameters, short-circuit ended.
int [Link](float frequency,
int exact,
DataObject matrix)

A RGUMENTS
frequency
Frequency for which the calculation is carried out
exact 0: Approximated solution, 1: Exact solution for ‘frequency’

matrix Impedance matrix to be filled with the impedance amplitudes

R ETURNS
The returned value reports if the impedance matrix acquired:

1 Error, no matrix acquired


0 Success, matrix acquired

HasRoutes
Checks if the line is subdivided into routes.
int [Link]()

R ETURNS
0 When the line is a single line
1 When the line is subdivided into routes

HasRoutesOrSec
Checks if the line is subdivided into routes or sections.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 97


Chapter 5. Object Methods

R ETURNS
0 When the line is a single line
1 When the line is subdivided into routes
2 When the line is subdivided into sections

IsCable
Checks if this line is a cable.
int [Link]()

R ETURNS
1 Line is a cable
0 Line is not a cable

IsNetCoupling
Checks if the line connects two grids.
int [Link]()

R ETURNS
The returned value reports if the line is a coupler:

1 The line is a coupler (connects two grids)


0 The line is not a coupler

MeasureLength
Measures the length of this line using the active diagram. For graphical measurement the active
diagram needs to have a scaling factor. Geographic diagrams by default have a scaling factor.
If iUseGraphic = 1, the line length is determined directly from the positions given in (latitude/lon-
gitude) considering the earth as a perfect sphere. In this case no graphic needs to be open.
float [Link]([int iUseGraphic])

A RGUMENTS
iUseGraphic (optional)
Use SGL diagram for calculation or not.

1 Use displayed diagram for calculation (default)


0 Calculate distance without diagram

R ETURNS
≥0 Returns the graphical length of this line in its current unit
<0 Error: E.g. when line is not represented in the active diagram and iUseGraphic=1

DIgSILENT PowerFactory 2018, Python Function Reference 98


Chapter 5. Object Methods

SetDetailed
The function can be used to prevent the automatically reduction of a line e.g. if the line is a line
dropper (length = 0). The function should be called when no calculation method is valid (before
first load flow). The internal flag is automatically reset after the first calculation is executed.
int [Link]()

5.2.18 ElmLnesec
Overview

IsCable

IsCable
Checks if this line section is a cable.
int [Link]()

R ETURNS
1 Line section is a cable
0 Line section is not a cable
-1 Error

5.2.19 ElmNec
Overview

GetGroundingImpedance

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

DIgSILENT PowerFactory 2018, Python Function Reference 99


Chapter 5. Object Methods

5.2.20 ElmNet
Overview

Activate
CalculateInterchangeTo
Deactivate
DefineBoundary

Activate
Adds a grid to the active study case. Can only be applied if there are is no currently active
calculation (i.e. running contingency analysis).
int [Link]()

R ETURNS
0 on success
1 on error

CalculateInterchangeTo
This function calculates the power flow from current grid to a connected grid. The values are
stored in current grid in the following attributes (values from the previous load flow calculation
are overwritten):

- Pinter: Active Power Flow


- Qinter: Reactive Power Flow
- ExportP: Export Active Power Flow
- ExportQ: Export Reactive Power Flow
- ImportP: Import Active Power Flow
- ImportQ: Import Reactive Power Flow

int [Link](DataObject net)

A RGUMENTS
net Connected grid

R ETURNS
<0 error
=0 grids are not connected, no interchange exists
>0 ok

Deactivate
Removes a grid from the active study [Link] only be applied if there are is no currently active
calculation.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 100


Chapter 5. Object Methods

R ETURNS
0 on success
1 on error

DefineBoundary
Defines boundary with this grid as interior part. Resulting cubicles of boundary are busbar-
oriented towards the grid.
DataObject [Link](int shift)

A RGUMENTS
shift Elements outside the grid that are within a distance of shift many elements to a
boundary cubicle of the grid are added to the interior part of the resulting bound-
ary

R ETURNS
The defined boundary is returned in case of success. Otherwise NULL, if an error appeared
in the definition of the boundary.

5.2.21 ElmPvsys
Overview

Derate
Disconnect
GetAvailableGenPower
GetGroundingImpedance
IsConnected
Reconnect
ResetDerating

Derate
Derates the value of the Max. Active Power Rating according to the specified value given in
MW.
The following formula is used: P max uc = P max uc − ”Deratingvalue”.
None [Link](float deratingP)

A RGUMENTS
deratingP Derating value

Disconnect
Disconnects a PV system by opening the first circuit breaker. The topological search performed
to find such a breaker, stops at any busbar.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 101


Chapter 5. Object Methods

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

GetAvailableGenPower
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.


• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the av-
erage of the power values (in MW) obtained from all the specified time characteristics for
the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


float [Link]()

R ETURNS
Available generation power

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

DIgSILENT PowerFactory 2018, Python Function Reference 102


Chapter 5. Object Methods

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

IsConnected
Checks if a PV system is already connected to any busbar.
int [Link]()

R ETURNS
0 false, not connected to a busbar
1 true, generator is connected to a busbar

Reconnect
Connects a PV system by closing all switches (breakers and isolators) up to the first breaker
on the HV side of a transformer. The topological search to find all the switches, stops at any
busbar.
int [Link]()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

ResetDerating
Resets the derating value, setting the Max. Active Power Rating according to the rating factor.
The following formula is used: P max uc = pmaxratf ∗ P n ∗ ngnum.
None [Link]()

5.2.22 ElmRelay
Overview

CheckRanges
GetCalcRX
GetMaxFdetectCalcI
GetSlot
GetUnom
IsStarted
SetImpedance
SetMaxI
SetMaxIearth
SetMinI
SetMinIearth
SetOutOfService
SetTime
SlotUpdate
DIgSILENT PowerFactory 2018, Python Function Reference 103
Chapter 5. Object Methods

CheckRanges
Checks the settings of all elements in the relay for range violations.
int [Link]()

R ETURNS
0 All settings are valid.
1 At least one setting was forced into range.
-1 An error occurred.

GetCalcRX
Gets the calculated impedance from the polarising unit.
[int error,
float real,
float imag ] [Link](int inSec,
int unit)

A RGUMENTS
inSec
0 Get the value in pri. Ohm.
1 Get the value in sec. Ohm.
unit
0 Get the value from Phase-Phase or Multifunctional polarizing.
1 Get the value from Phase-Earth or Multifunctional polarizing.
2 Get the value from Multifunctional polarizing
real (out) Real part of the impedance in Ohm.
imag (out)
Imaginary part of the impedance in Ohm.

R ETURNS
0 No error occurred, the output is valid.
1 An error occurred, the output is invalid.

GetMaxFdetectCalcI
Get the current measured by the starting unit.
[int error,
float Iabs ] [Link](int earth,
int unit
)

A RGUMENTS
Iabs (out) The measured current in A
earth
0 Get the phase current.

DIgSILENT PowerFactory 2018, Python Function Reference 104


Chapter 5. Object Methods

1 Get the earth current.

unit
0 Get the current in pri. A.
1 Get the current in sec. A.

R ETURNS
0 No error, output is valid.
1 An error occourred, the output is invalid.

GetSlot
Returns the element in the slot with the given name.
DataObject [Link](str name,
[int iShowErr]
)

A RGUMENTS
name Exact name of the slot to search for (no wildcards).
iShowErr (optional)
0 Do not show error messages.
1 Show error messages if a slot is not found or empty.

R ETURNS
The object in the slot or None.

GetUnom
Returns the nominal voltage of the local bus of the relay.
float [Link]()

R ETURNS
The nominal voltage of the local bus of the relay in kV.

IsStarted
Checks if the starting unit detected a fault.
int [Link]()

R ETURNS
0 No fault was detected.
1 Fault was detected.
-1 An error occourred.

DIgSILENT PowerFactory 2018, Python Function Reference 105


Chapter 5. Object Methods

SetImpedance
Sets the the given impedance to the distance blocks matching the criteria.
int [Link](float real,
float imag,
int inSec,
int zone,
int unit
)
int [Link](float real,
float imag,
float lineAngle,
float Rarc,
int inSec,
int zone,
int unit
)

A RGUMENTS
real Real part of the impedance in Ohm.
imag Imaginary part of the impedance in Ohm.
inSec
0 The values are in pri. Ohm.
1 The values are in sec. Ohm.
zone Set the impedance for elments with this zone number.
unit
0 Set the impedance for Phase - Phase or Multifunctional elements.
1 Set the impedance for Phase - Earth or Multifunctional elements.
2 Set the impedance for Multifunctional elements.

A RGUMENTS
real Real part of the impedance in Ohm.
imag Imaginary part of the impedance in Ohm.
lineAngle The line angle in deg.
Rarc The arc resistance in Ohm.
inSec
0 The values are in pri. Ohm.
1 The values are in sec. Ohm.
zone Set the impedance for elments with this zone number.
unit
0 Set the impedance for Phase - Phase or Multifunctional elements.
1 Set the impedance for Phase - Earth or Multifunctional elements.
2 Set the impedance for Multifunctional elements.

R ETURNS
0 No error occurred.
1 An error occurred or no element was found.

DIgSILENT PowerFactory 2018, Python Function Reference 106


Chapter 5. Object Methods

SetMaxI
Sets the “Max. Phase Fault Current” of the relay to the currently measured value.
None [Link]()

SetMaxIearth
Sets the “Max. Earth Fault Current” of the relay to the currently measured value.
None [Link]()

SetMinI
Sets the “Min. Phase Fault Current” of the relay to the currently measured value.
None [Link]()

SetMinIearth
Sets the “Min. Earth Fault Current” of the relay to the currently measured value.
None [Link]()

SetOutOfService
Sets the “Out of Service” flag of elements contained in the relay.
int [Link](int outServ,
int type,
int zone
int unit
)

A RGUMENTS
outServ
0 Set elements in service.
1 Set Elements out of service.
type
1 Set the flag for overcurrent elements.
2 Set the flag for distance elements.
zone Set the flag for elments with this zone number (only when settings distance ele-
ments).
unit
0 Set the flag for Phase-Phase or Multifunctional elements.
1 Set the flag for Phase-Earth or Multifunctional elements.
2 Set the flag for Multifunctional elements.

DIgSILENT PowerFactory 2018, Python Function Reference 107


Chapter 5. Object Methods

R ETURNS
0 No error occurred.
1 An error occurred or no element was found.

SetTime
Sets the tripping time for elements contained in the relay.
int [Link](float time,
int type,
int zone,
int unit
)

A RGUMENTS
time Time in s.

type
1 Set the time for overcurrent elements.
2 Set the time for distance elements.
zone Set the time for elments with this zone number (only when settings distance ele-
ments).
unit
0 Set the time for Phase-Phase or Multifunctional elements.
1 Set the time for Phase-Earth or Multifunctional elements.
2 Set the time for Multifunctional elements.

R ETURNS
0 No error occurred.
1 An error occurred or no element was found.

SlotUpdate
Triggers a slot update of the relay.
None [Link]()

D EPRECATED N AMES
slotupd

DIgSILENT PowerFactory 2018, Python Function Reference 108


Chapter 5. Object Methods

5.2.23 ElmRes
Overview

AddVariable
Clear
FindColumn
FindMaxInColumn
FindMaxOfVariableInRow
FindMinInColumn
FindMinOfVariableInRow
FinishWriting
Flush
GetDescription
GetFirstValidObject
GetFirstValidObjectVariable
GetFirstValidVariable
GetNextValidObject
GetNextValidObjectVariable
GetNextValidVariable
GetNumberOfColumns
GetNumberOfRows
GetObj
GetObject
GetRelCase
GetSubElmRes
GetUnit
GetValue
GetVariable
InitialiseWriting
Load
Release
SetAsDefault
SetObj
SetSubElmResKey
SortAccordingToColumn
Write
WriteDraw

AddVariable
Adds a variable to the list of monitored variables for the Result object.
None [Link](DataObject element,
str varname)

A RGUMENTS
element An object.

varname Variable name for object O.

D EPRECATED N AMES
AddVars

DIgSILENT PowerFactory 2018, Python Function Reference 109


Chapter 5. Object Methods

Clear
Clears all data (calculation results) written to the result file. The Variable definitions stored in
the contents of ElmRes are not modified.
int [Link]()

R ETURNS
Always 0 and can be ignored.

FindColumn
Returns the index of the first header column matching the given object and/or variable name.
int [Link](DataObject obj,
[str varName]
)
int [Link](DataObject obj,
[int startCol]
)
int [Link](DataObject obj,
str varName
)

A RGUMENTS
obj (optional)
Object of matching column

varName (optional)
Variable name of matching column
startCol (optional)
Index of first checked column; Search starts at first column if colIndex is not given

R ETURNS
≥0 column index
<0 no valid column found
The index can be used in the ElmRes method GetData to retrieve the value of the column.

FindMaxInColumn
Find the maximum value of the variable in the given column.
[int row,
float value] [Link](int column)

A RGUMENTS
column The column index.
value (optional, out)
The maximum value found. The value is 0. in case that the maximum value was
not found.

DIgSILENT PowerFactory 2018, Python Function Reference 110


Chapter 5. Object Methods

R ETURNS
<0 The maximum value of column was not found.
≥0 The row with the maximum value of the column.

FindMaxOfVariableInRow
Find the maximum value for the given row and variable.
[int col,
float maxValue] [Link](str variable,
int row)

A RGUMENTS
variable The variable name
variable The row
maxValue (optional)
The corresponding maximum value.

R ETURNS
<0 There is no valid value of the corresponding variable in the row.
≥0 Column index of variable.

FindMinInColumn
Find the minimum value of the variable in the given column.
[int row,
float value] [Link](int column)

A RGUMENTS
column The column index.

value (optional, out)


The minimum value found. The value is 0. in case that the minimum value was
not found.

R ETURNS
<0 The minimum value of column was not found.
≥0 The row with the minimum value of the column.

FindMinOfVariableInRow
Find the minimum value for the given row and variable.
[int col,
float minValue] [Link](str variable,
int row)

DIgSILENT PowerFactory 2018, Python Function Reference 111


Chapter 5. Object Methods

A RGUMENTS
variable The variable name
variable The row
minValue (optional, out)
The corresponding minimum value.

R ETURNS
<0 There is no valid value of the corresponding variable in the row.
≥0 Column index of variable.

FinishWriting
Finishes the writing of values to a result file.
None [Link]()

D EPRECATED N AMES
Close

S EE ALSO

[Link](), [Link](), [Link]()

Flush
This function is required in scripts which perform both file writing and reading operations. While
writing to a results object (ElmRes), a small portion of this data is buffered in memory. This
is required for performance reasons. Therefore, all data must be written to the disk before
attempting to read the file. 'Flush' copies all data buffered in memory to the disk. After calling
'Flush'all data is available to be read from the file.
int [Link]()

GetDescription
Get the description of a column.
str [Link]([int column],
[int short]
)

A RGUMENTS
column (optional)
The column index. The description name of the default variable is returned if the
parameter is nor passed to the function.

short (optional)
0 long desc. (default)
1 short description

DIgSILENT PowerFactory 2018, Python Function Reference 112


Chapter 5. Object Methods

R ETURNS
Returns the description which is empty in case that the column index is not part of the data.

GetFirstValidObject
Gets the index of the column for the first valid variable in the given line. Starts at the beginning
of the given line and sets the internal iterator of the result file to the found position.
int [Link](int row,
[str classNames]
[str variableName,]
[float limit,]
[int limitOperator,]
[float limit2,]
[int limitOperator2]
)
int [Link](int row,
list objects
)

A RGUMENTS
row Result file row
classNames (optional)
Comma separated list of class names for valid objects. The next object of one
of the given classes is searched. If not set all objects are considered as valid
(default).
variableName (optional)
Name of the limiting variable. The searched object must have this variable. If not
set variables are not considered (default).
limit (optional)
Limiting value for the variable.
limitOperator (optional)
Operator for checking the limiting value:
0 all values are valid (default)
1 valid values must be < limit
2 valid values must be ≤ limit
3 valid values must be > limit
4 valid values must be ≥ limit
limit2 (optional)
Second limiting value for the variable.
limitOperator2 (optional)
Operator for checking the second limiting value:
<0 first OR second criterion must match,
>0 first AND second criterion must match,
0 all values are valid (default)
1/-1 valid values must be < limit2
2/-2 valid values must be ≤ limit2

DIgSILENT PowerFactory 2018, Python Function Reference 113


Chapter 5. Object Methods

3/-3 valid values must be > limit2


4/-4 valid values must be ≥ limit2
objects Valid objects

R ETURNS
≥0 column index
<0 no valid column found

GetFirstValidObjectVariable
Gets the index of the first valid variable of the current object in the current line. Starts at the
internal iterator of the given result file and sets it to the position found.
int [Link]([str variableNames])

A RGUMENTS
variableNames (optional)
Comma separated list of valid variable names. The next column with one of the
given variables is searched. If empty all variables of the current object are consid-
ered as valid (default).

R ETURNS
≥0 column index
<0 no valid column found

GetFirstValidVariable
Gets the index of the column for the first valid variable in the given line. Starts at the beginning
of the given line and sets the internal iterator of the result file to the found position.
int [Link](int row,
[str variableNames]
)

A RGUMENTS
row Result file row
variableNames (optional)
Comma separated list of valid variable names. The next column with one of the
given variables is searched. If not set all variables are considered as valid (de-
fault).

R ETURNS
≥0 column index
<0 no valid column found

GetNextValidObject
Gets the index of the column for the next valid variable (after current iterator) in the given line.
Sets the internal iterator of the result file to the position found.

DIgSILENT PowerFactory 2018, Python Function Reference 114


Chapter 5. Object Methods

int [Link]([str classNames]


[str variableName,]
[float limit,]
[int limitOperator,]
[float limit2,]
[int limitOperator2]
)
int [Link](list objects)

A RGUMENTS
row Result file row
classNames (optional)
Comma separated list of class names for valid objects. The next object of one
of the given classes is searched. If not set all objects are considered as valid
(default).

variableName (optional)
Name of the limiting variable. The searched object must have this variable. If not
set variables are not considered (default).
limit (optional)
Limiting value for the variable.

limitOperator (optional)
Operator for checking the limiting value:
0 all values are valid (default)
1 valid values must be < limit
2 valid values must be ≤ limit
3 valid values must be > limit
4 valid values must be ≥ limit
limit2 (optional)
Second limiting value for the variable.

limitOperator2 (optional)
Operator for checking the second limiting value:
<0 first OR second criterion must match,
>0 first AND second criterion must match,
0 all values are valid (default)
1/-1 valid values must be < limit2
2/-2 valid values must be ≤ limit2
3/-3 valid values must be > limit2
4/-4 valid values must be ≥ limit2
objects Valid objects

R ETURNS
≥0 column index
<0 no valid column found

DIgSILENT PowerFactory 2018, Python Function Reference 115


Chapter 5. Object Methods

GetNextValidObjectVariable
Gets the index of the column for the next valid variable of the current object in the current line.
Starts at the internal iterator of the given result file and sets it to the found position.
int [Link]([str variableNames])

A RGUMENTS
variableNames (optional)
Comma separated list of valid variable names. The next column with one of the
given variables is searched. If not set all variables are considered as valid (de-
fault).

R ETURNS
≥0 column index
<0 no valid column found

GetNextValidVariable
Gets the index of the column for the next valid variable in the given line. Starts at the internal
iterator of the given line and sets the internal iterator of the result file to the found position.
int [Link]([str variableNames])

A RGUMENTS
variableNames (optional)
Comma separated list of valid variable names. The next column with one of the
given variables is searched. If not set all variables are considered as valid (de-
fault).

R ETURNS
≥0 column index
<0 no valid column found

GetNumberOfColumns
Returns the number of variables (columns) in result file excluding the default variable (e.g. time
for time domain simulation).
int [Link]()

R ETURNS
Number of variables (columns) in result file.

GetNumberOfRows
Returns the number of values per column (rows) stored in result object.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 116


Chapter 5. Object Methods

R ETURNS
Returns the number of values per column stored in result object.

GetObj
Returns an object used in the result file. Positive index means objects for which parameters
are being monitored (i.e. column objects). Negative index means objects which occur in written
result rows as values.
DataObject [Link](int index)

A RGUMENTS
index index of the object.

R ETURNS
The object found or None.

GetObject
Get object of given column.
DataObject [Link]([int column])

A RGUMENTS
col Column index. Object of default column is returned if col is not passed.

R ETURNS
The object of the variable stored in column ’column’.

GetRelCase
Get the contingency object for the given case number from the reliability result file.
DataObject [Link](int caseNumber)

A RGUMENTS
caseNumber
The reliability case number

R ETURNS
Returns the contingency of case number. None is returned if there is no corresponding
contingency.

GetSubElmRes
Get sub-result file stored inside this.
DataObject [Link](int value)
DataObject [Link](DataObject obj)

DIgSILENT PowerFactory 2018, Python Function Reference 117


Chapter 5. Object Methods

A RGUMENTS
value The cnttime to look for
obj The pResElm to look for

R ETURNS
None The sub result file with value=cnttime (obj=pResElm) was not found.
any other value The sub result file with value=cnttime (obj=pResElm).

GetUnit
Get the unit of a column.
str [Link]([int column])

A RGUMENTS
column (optional)
The column index. The unit of the default variable is returned if the parameter is
nor passed to the function.

R ETURNS
Returns the unit which is empty in case that the column index is not part of the data.

GetValue
Returns a value from a result object for row iX of curve col.
[int error,
float d ] [Link](int iX,
[int col])

A RGUMENTS
d (out) The value retrieved from the data.

iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g. by
the contingency, the value is invalid in case that it was not written, bcause it was
below the recording limit. Result files created using DPL/Python are always full
and will not return invalid values.

DIgSILENT PowerFactory 2018, Python Function Reference 118


Chapter 5. Object Methods

GetVariable
Get variable name of column
str [Link]([int column])

A RGUMENTS
column (optional)
The column index. The variable name of the default variable is returned if the
parameter is nor passed to the function.

R ETURNS
Returns the variable name which is empty in case that the column index is not part of the
data.

InitialiseWriting
Opens the result object for writing. This function must be called before writing data for result
files not stored in the script object. If arguments are passed to the function they specify the
variable name, unit... of the default variable (e.g. to be used by plots as x-axis).
int [Link]()
int [Link](str variableName,
str unit,
str description,
[str shortDescription]
)

A RGUMENTS
variableName
The variable name for the default variable (e.g. “distance”)
unit The unit (e.g. “km”)
description
The description of the variable (e.g. “Distance from infeed”)

shortDescription
The short description (e.g. “Dist. Infeed”)

R ETURNS
Always 0 and can be ignored

D EPRECATED N AMES
Init

S EE ALSO

[Link](), [Link](), [Link]()

Load
Loads the data of a result object (ElmRes) in memory for reading.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 119


Chapter 5. Object Methods

Release
Releases the data loaded to memory. This function should be used whenever several result
objects are processed in a loop. Data is always released from memory automatically after
execution of the current script.
None [Link]()

SetAsDefault
Sets this results object as the default results object. Plots using the default result file will use
this file for displaying data.
None [Link]()

SetObj
Adds an object to the objects assigned to the result file
int [Link](DataObject element)

A RGUMENTS
element Element to store in result file

R ETURNS
The index which can be used to retrieve the object from the results file. The index is < 0 if
no results are recorded for the given object (e.g. a contingency in reliability calculation). The
index is ≥ if variables are recorded for the object.

SetSubElmResKey
Assigns a value or an object to the according ElmRes parameter.
None [Link](int value)
None [Link](DataObject obj)

A RGUMENTS
value Value to be assigned to parameter cnttime of ElmRes
value Object to be assigned to parameter pResElm of ElmRes

SortAccordingToColumn
Sorts all rows in the data loaded according to the given column. The ElmRes itself remains
unchanged.
int [Link](int column)

A RGUMENTS
col The column number.

DIgSILENT PowerFactory 2018, Python Function Reference 120


Chapter 5. Object Methods

R ETURNS
0 The function executed correctly, the data was sorted correctly according to the
given column.
1 The column with index column does not exist.

Write
Writes the current results to the result object.
int [Link]([float defaultValue])

R ETURNS
0 on success

S EE ALSO

[Link](), [Link](), [Link]()

WriteDraw
Writes current results to the result objects and updates all plots that display values from the
result object.
int [Link]()

R ETURNS
0 on success

5.2.24 ElmShnt
Overview

GetGroundingImpedance

GetGroundingImpedance
Returns the impedance of the internal grounding. Single phase shunts connected to neutral are
considered as grounding devices themselves; i.e. instead of the dedicated grounding parame-
ters, the shunt parameters are used.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

DIgSILENT PowerFactory 2018, Python Function Reference 121


Chapter 5. Object Methods

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

5.2.25 ElmStactrl
Overview

GetControlledHVNode
GetControlledLVNode
GetStepupTransformer
Info

GetControlledHVNode
Returns the corresponding voltage controlled HV node for the machine at the specified index.
Switch status are always considered.
DataObject [Link](int index)

A RGUMENTS
index Index of machine (starting from 0 − . . . ).

R ETURNS
object Busbar/Terminal ()
None not found

GetControlledLVNode
Returns the corresponding voltage controlled LV node for the machine at specified index. Switch
status are always considered.
DataObject [Link](int index)

A RGUMENTS
index Index of machine (starting from 0 − . . . ).

R ETURNS
object Terminal ()
None not found

GetStepupTransformer
Performs a topological search to find the step-up transformer of the machine at the specified
index.
DataObject [Link]([int index,]
[int iBrkMode]
)

DIgSILENT PowerFactory 2018, Python Function Reference 122


Chapter 5. Object Methods

A RGUMENTS
index Index of machine (starting from 0 − . . . ).
iBrkMode (optional)
0 (default) All switch status (open,close) are considered
1 Ignore breaker status (jump over open breakers)
2 Ignore all switch status (jump over open switches)

R ETURNS
object step-up transformer
None step-up transformer not found

Info
Prints the control information in the output window. It is the same information that the button
”Info” of the Station Control dialog prints.
int [Link]()

5.2.26 ElmSubstat
Overview

ApplyAndResetRA
GetSplit
GetSplitCal
GetSplitIndex
GetSuppliedElements
OverwriteRA
ResetRA
SaveAsRA
SetRA

ApplyAndResetRA
This function applies switch statuses of currently selected running arrangement to correspond-
ing switches and resets the running arrangement selection afterwards. Nothing happens if no
running arrangement is selected.
int [Link]()

R ETURNS
1 on success
0 otherwise, especially if no running arrangement is selected

GetSplit
A split of a station is a group of topologically connected elements. Such a group is called split
if all contained components are energized and there is at least one busbar (terminal of usage
'busbar') contained or it has connections to at least two main components (= all components

DIgSILENT PowerFactory 2018, Python Function Reference 123


Chapter 5. Object Methods

except switch devices and terminals).


These splits are ordered according to the count of nodes contained and according to their
priority. So each split becomes a unique index.
The function GetSplit offers access to the elements contained in a split. By calling GetSplit with
an index from 0 to n, the elements belonging to the corresponding split are filled into given sets
and returned.
[int error
list mainNodes,
list connectionCubicles,
list allElements ] [Link](int index)

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Value
must be ≥ 0.
mainNodes (out)
Terminals of same usage considered to form the most important nodes for that
group. In most cases, this is the group of contained busbars.

connectionCubicles (optional, out)


All cubicles (of terminals inside the station) that point to an element that sits out-
side the station or to an element that is connected to a terminal outside the station
are filled into the set connectionCubicles. (The connection element (branch) can
be accessed by calling GetBranch() on each of these cubicles. The terminals
of these cubicles (parents) must not necessarily be contained in any split. They
could also be separated by a disconnecting component.)
allElements(optional, out)
All elements (class Elm*) of the split that have no connection to elements outside
the station are filled into this set.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

S EE ALSO

[Link](), [Link](),

GetSplitCal
This function determines the elements that belong to a split. In contrast to [Link]()
it is based on calculation instead of pure edit object topology. This means the returned nodes
correspond to the calculation nodes, the interconnecting cubicles are those connecting nodes
of different splits.
Note: As this function relies on calculation nodes it can only be executed after a calculation has
been performed (e.g. load flow calculation).
[int error,
list nodes,
list connectionCubicles,
list elements ] [Link](int index)

DIgSILENT PowerFactory 2018, Python Function Reference 124


Chapter 5. Object Methods

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Refers
to same split as index in [Link]().
Value must be ≥ 0.
nodes (out)
A set that is filled with terminals. There is one terminal returned for each calcula-
tion node in the split.
connectionCubicles (optional, out)
This set is filled with all cubicles that point from a calculation node of current split
to another calculation node that does not belong to that split. The connecting
element can be accessed by calling GetBranch() on such a cubicle.
elements (optional, out)
This set is filled with network elements that are connected to a calculation node of
current split and have exactly one connection, i.e. these elements are completely
contained in the split.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

S EE ALSO

[Link]()

GetSplitIndex
This function returns the index of the split that contains passed object.
int [Link](DataObject o)

A RGUMENTS
o Object for which the split index is to be determined.

R ETURNS
≥0 index of split in which element is contained
-1 given object does not belong to any split of that station

S EE ALSO

[Link]()

GetSuppliedElements
Returns all network components that are supplied by the transformers located in the station.
list [Link]([int inclNested])

A RGUMENTS
inclNested (optional)
0 Do not include components that are supplied by nested supplying sta-
tions
1 (default) Include components that are supplied by nested stations

DIgSILENT PowerFactory 2018, Python Function Reference 125


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link]()

OverwriteRA
This function overwrites switch statuses stored in an existing running arrangement with actual
switch statuses of the substation. This is only possible if the substation has no running arrange-
ment selected and given running arrangement is valid for substation the method was called
on.
int [Link](DataObject ra)

A RGUMENTS
ra Given running arrangement

R ETURNS
1 If given running arrangement was successfully overwritten;
0 otherwise

ResetRA
This function resets the running arrangement selection for the substation it was called on.
None [Link]()

SaveAsRA
When called on a substation that has no running arrangement selected, a new running arrange-
ment is created and all switch statuses of all running arrangement relevant switches (for that
substation) are saved in it. The running arrangement is stored in project folder Running Ar-
rangement” and its name is set to given locname. The new running arrangement is not selected
automatically.
(No new running arrangement is created if this method is called on a substation that has cur-
rently a running arrangement selected).
DataObject [Link](str locname)

A RGUMENTS
locname Name of the new running arrangement (if name is already used, an increment
(postfix) is added to make it unique).

R ETURNS
Newly created 'IntRunarrange' object on success, otherwise None.

SetRA
This function sets the running arrangement selection for the substation it was called on. The
switch statuses are now determined by the values stored in the running arrangement.
int [Link](DataObject ra)

DIgSILENT PowerFactory 2018, Python Function Reference 126


Chapter 5. Object Methods

A RGUMENTS
ra running arrangement that is valid for the substation

R ETURNS
1 If given running arrangement was successfully set;
0 otherwise (e.g. given ra is not valid for that substation)

5.2.27 ElmSvs
Overview

GetStepupTransformer

GetStepupTransformer
Performs a topological search to find the step-up transformer of the static VAR system.
DataObject [Link](float voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop
swStatus consideration of switch status. Possible values are:
0 consider all switch status
1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

5.2.28 ElmSym
Overview

Derate
Disconnect
GetAvailableGenPower
GetGroundingImpedance
GetMotorStartingFlag
GetStepupTransformer
IsConnected
Reconnect
ResetDerating

DIgSILENT PowerFactory 2018, Python Function Reference 127


Chapter 5. Object Methods

Derate
Derates the value of the Max. Active Power Rating according to the specified value given in
MW.
The following formula is used: P max uc = P max uc − ”Deratingvalue”.
None [Link](float deratingP)

A RGUMENTS
deratingP Derating value

Disconnect
Disconnects a synchronous machine by opening the first circuit breaker. The topological search
performed to find such a breaker, stops at any busbar.
int [Link]()

R ETURNS
0 breaker already open or successfully opened
1 an error occurred (no breaker found, open action not possible (earthing / RA))

GetAvailableGenPower
Returns the available power that can be dispatched from the generator, for the particular study
time.
For the case of conventional generators (no wind generation selected), the available power is
equal to the nominal power specified.
For wind generators, the available power will depend on the wind model specified:

• No Wind Model: No available power.

• Stochastic Wind Model: Given the specified mean wind speed, the available power is
calculated from the Power Curve. If the units of the Power Curve are in MW, the returned
value is directly the available power. In the other hand, if the units are in PU, the returned
value is multiplied by the nominal power of the generator to return the available power.
• Time Series Characteristics of Active Power Contribution: The available power is the av-
erage of the power values (in MW) obtained from all the specified time characteristics for
the current study time.
• Time Series Characteristics of Wind Speed: The available power is calculated with the
average of the power values (in MW) calculated for all the specified time characteristics.
A power value for any time characteristic is calculated by obtaining the wind speed for the
current study time, and then calculating the power from the specified Power Curve. If the
units of the Power Curve are in MW, the returned value is directly the power value. In the
other hand, if the units are in PU, the returned value is multiplied by the nominal power of
the generator to return the power value.

For motors, the available power is zero.


float [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 128


Chapter 5. Object Methods

R ETURNS
Available generation power

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetMotorStartingFlag
Returns the starting motor condition.
int [Link]()

R ETURNS
Returns the motor starting condition. Possible values are:

-1 in the process of being calculated


0 not calculated
1 successful start
2 unsuccessful start

GetStepupTransformer
Performs a topological search to find the step-up transformer of the synchronous machine.
DataObject [Link](float voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop
swStatus consideration of switch status. Possible values are:
0 consider all switch status
1 ignore breaker status
2 ignore all switch status

DIgSILENT PowerFactory 2018, Python Function Reference 129


Chapter 5. Object Methods

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

IsConnected
Checks if a synchronous machine is already connected to any busbar.
int [Link]()

R ETURNS
0 false, not connected to a busbar
1 true, generator is connected to a busbar

Reconnect
Connects a synchronous machine by closing all switches (breakers and isolators) up to the first
breaker on the HV side of a transformer. The topological search to find all the switches, stops
at any busbar.
int [Link]()

R ETURNS
0 the machine was successfully closed
1 a error occurred and the machine could not be connected to any busbar

ResetDerating
Resets the derating value, setting the Max. Active Power Rating according to the rating factor.
The following formula is used: P max uc = pmaxratf ∗ P n ∗ ngnum.
None [Link]()

5.2.29 ElmTerm
Overview

GetBusType
GetCalcRelevantCubicles
GetConnectedBrkCubicles
GetConnectedCubicles
GetConnectedMainBuses
GetConnectionInfo
GetEquivalentTerminals
GetMinDistance
GetNextHVBus
GetNodeName
GetSepStationAreas
HasCreatedCalBus
IsElectrEquivalent

DIgSILENT PowerFactory 2018, Python Function Reference 130


Chapter 5. Object Methods

IsEquivalent
IsInternalNodeInStation
UpdateSubstationTerminals

GetBusType
Gets busbar calculation type.
int [Link]()

R ETURNS
0 No valid calculation (load flow).
1 QV busbar.
2 PV busbar.
3 Slack busbar.

GetCalcRelevantCubicles
This function gets calculation relevant cubicles of this terminal.
list [Link]()

R ETURNS
Set of calculation relevant cubicles.

GetConnectedBrkCubicles
Function gets the set of cubicles connected with the breaker and this terminal.
list [Link]([float ignoreSwitchStates])

A RGUMENTS
ignoreSwitchStates (optional)
Ignore switch status flag 1 or not 0 (=default).

R ETURNS
Set of cubicles.

GetConnectedCubicles
Function gets the set of cubicles connected with this terminal.
list [Link]([float ignoreSwitchStates])

A RGUMENTS
ignoreSwitchStates (optional)
Ignore switch status flag 1 or not 0 (=default).

R ETURNS
Set of cubicles.

DIgSILENT PowerFactory 2018, Python Function Reference 131


Chapter 5. Object Methods

GetConnectedMainBuses
Function gets the set of connected main buses.
list [Link]([float considerSwitches])

A RGUMENTS
considerSwitches (optional)
Consider switch state (default 1).

R ETURNS
Set of main buses connected to the terminal.

GetConnectionInfo
Gets connection information of this terminal. Requires valid load flow calculation. Input argu-
ments are filled with the value after function call.
[int error,
float closedSwitches,
float allSwitches,
float nonSwitchingDevices,
float closedAndNonSwitchingDevices,
float allDevices,
float connectedNodes,
float mainNodes] [Link]()

A RGUMENTS
closedSwitches
Number of closed switch devices.
allSwitches
Number of total switch devices.
nonSwitchingDevices
Number of non-switch devices.
closedAndNonSwitchingDevices
Number of total closed and non-switch devices (closedSwitches+nonSwitchingDevices).
allDevices
Number of total switch and non-switch devices (allSwitches+nonSwitchingDevices).
connectedNodes
Number of total nodes connected via couplers.
mainNodes
Number of total main nodes.

R ETURNS
Return value is always 0 and has no meaning.

GetEquivalentTerminals
Returns a set of all terminals that are equivalent to current one. Euqivalent means that those
terminals are topologically connected only by

DIgSILENT PowerFactory 2018, Python Function Reference 132


Chapter 5. Object Methods

• closed switching devices (ElmCoup, RelFuse) or

• lines of zero length (line droppers).

list [Link]()

R ETURNS
All terminals that are equivalent to current one. Current one is also included so the set is
never empty.

S EE ALSO

[Link]()

GetMinDistance
This function determines the shortest path between the terminal the function was called on and
the terminal that was passed as first argument. The distance is determined on network topology
regarding the length of the traversed component (i.e. only lines have an influence on distance).
[float minDistance,
set path ] [Link](DataObject term,
[int considerSwitches,]
[set limitToNodes])

A RGUMENTS
term Terminal to which the shortest path is determined.
considerSwitches (optional)
0 Traverse all components, ignore switch states
1 Do not traverse open switch devices (default)
path (optional, out)
If given, all components of the found shortest path are put into this set.
limitToNodes(optional)
If given, the shortest path is searched only within this set of nodes. Please note,
when limiting search to a given set of nodes, the start and end terminals (for which
the distance is determined) must be part of this set (otherwise distance =-1).

R ETURNS
<0 If there is no path between the two terminals
≥0 Distance of shortest path in km

GetNextHVBus
This function returns the nearest connected busbar that has a higher voltage level. To detect this
bus, a breath-first search on the net topology is executed. The traversal stops on each element
that is out of service and on each opened switch device. The criterion for higher voltage level is
passing a transformer to HV side. No junction nor internal nodes shall be considered.
DataObject [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 133


Chapter 5. Object Methods

R ETURNS
object First busbar found.
None If no busbar was found.

GetNodeName
For terminals inside a station, this function returns a unique name for the split the terminal is
located in. The name is built on first five characters of the station‘s short name plus the split
index separated by an underscore. E.g. “USTAT 1”.
For terminals inside a branch (ElmBranch) the returned name is just a concatenation of the
branch name and the terminal‘s name.
For all other terminals not inside a branch or a station the node name corresponds to the termi-
nal‘s name.
str [Link]()

R ETURNS
Node name as described above. Never empty.

GetSepStationAreas
Function gets all separate areas within the substation linked to this terminal. In this manner,
area is any part between two nodes.
list [Link]([float considerSwitches])

A RGUMENTS
considerSwitches (optional)
Consider switch state (default 1).

R ETURNS
Set of all separate areas in this substation.

HasCreatedCalBus
This function checks if the valid calculation exists for this terminal (i.e. load flow). If it exists,
then the calculation parameters could be retrieved.
int [Link]()

R ETURNS
1 Valid calculation exists.
0 No valid calculation.

IsElectrEquivalent
Function checks if two terminals are electrically equivalent. Two terminals are said to be electri-
cally equivalent if they are topologically connected only by

• closed switching devices (ElmCoup, RelFuse) or

DIgSILENT PowerFactory 2018, Python Function Reference 134


Chapter 5. Object Methods

• lines of zero length (line droppers) or


• branch components whose impedance is below given thresholds (R ≤ maxR and X ≤
maxX)

int [Link](DataObject terminal,


float maxR,
float maxX
)

A RGUMENTS
terminal Terminal to which the 'method called terminal' is connected to.
double maxR
Given threshold for the resistance of branch elements (must be given in Ohm).
double maxX
Given threshold for the reactance of branch elements (must be given in Ohm).

R ETURNS
1 If terminal on which the method was called is electrical equivalent to terminal that
was passed as argument
0 Otherwise

S EE ALSO

[Link]()

IsEquivalent
Function checks if two terminals are topologically connected only by

• closed switching devices (ElmCoup, RelFuse) or


• lines of zero length (line droppers).

IsEquivalent defines a relation that is

• symmetric ([Link](Term2) -> [Link](Term1)),


• reflexive ([Link](Term1)) and
• transitive ([Link](Term2) and [Link](Term3) -> [Link](Term3));

int [Link](DataObject terminal)

A RGUMENTS
terminal Terminal (object of class ElmTerm) that is checked to be equivalent to the terminal
on which the function was called on. Passing None is not allowed and will result
in a scripting error.

R ETURNS
1 If terminal on which the method was called is connected to terminal that was
passed as argument only by closed switching devices or by lines of zero length
0 Otherwise (terminals are not connected or connected by other components than
switching devices / lines of zero length)

DIgSILENT PowerFactory 2018, Python Function Reference 135


Chapter 5. Object Methods

S EE ALSO

[Link]() [Link]()

IsInternalNodeInStation
Function checks if the terminal is an internal node and in a station (ElmSubstat, ElmTrfstat).
int [Link]()

R ETURNS
1 Terminal is a node of usage ‘internal’ and is located in a station.
0 Not internal node or not in a station, or both.

UpdateSubstationTerminals
Updates all nodes within the substation to the new voltage and/or phase technology. Applicable
for all busbars and junction nodes. The highest voltage is taken as the leading one.
None [Link](int volt,
int phs
)

A RGUMENTS
volt Updates nominal voltages (<> 0)

phs Updates phase technology (<> 0)

5.2.30 ElmTr2
Overview

CreateEvent
GetGroundingImpedance
GetSuppliedElements
GetTapPhi
GetTapRatio
GetZ0pu
GetZpu
IsQuadBooster
NTap

CreateEvent
For the corresponding transformer, a Tap Event (EvtTap) is created for the simulation.
int [Link]([float tapAction,]
[float tapPos]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic

DIgSILENT PowerFactory 2018, Python Function Reference 136


Chapter 5. Object Methods

tapPos (optional)
Position of tap

R ETURNS
0 on success

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.

resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetSuppliedElements
Returns the network components that are supplied by the transformer.
A network component is considered to be supplied by a transformer if a topological path from
the transformer to the component exists. A valid topological path in this sense is a path that
starts at the transformer's HV side in direction of transformer (not in direction of HV connected
node) and stops at

• network components that are out of calculation,


• network components that are not active (e.g. hidden or those of currently inactive grids),
• open switches,
• connections leading to a higher voltage level.

Generally all network components of such a path are considered to be supplied by the trans-
former. Exceptions are components that are out of calculation or in-active. Those components
are never considered to be supplied by any transformer.
A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
list [Link]([int inclNested])

DIgSILENT PowerFactory 2018, Python Function Reference 137


Chapter 5. Object Methods

A RGUMENTS
inclNested (optional)
0 Only include components which are directly supplied by the transformer
(not nested components)
1 Include nested components and components that are directly supplied
by the transformer (default)

S EE ALSO

[Link](), [Link](), [Link]()

GetTapPhi
Gets the tap phase shift in deg of the transformer for given tap position.
float [Link](int itappos,
int inclPhaseShift
)

A RGUMENTS
itappos Tap position

inclPhaseShift
1 = Includes the vector group phase shift, 0 = consider only the tap phase shift

R ETURNS
Returns the tap phase shift angle of the transforrmer for given tap position

GetTapRatio
Gets the voltage ratio of the transformer for given tap position.
float [Link](int itappos,
int onlyTapSide,
int includeNomRatio
)

A RGUMENTS
itappos Tap position
onlyTapSide
1 = ratio only for given side., 0 = total ratio
includeNomRatio
1 = Includes nominal ratio of the transformer, 0 = consider only tap ratio

R ETURNS
Returns the voltage ratio of the transforrmer for given tap position

DIgSILENT PowerFactory 2018, Python Function Reference 138


Chapter 5. Object Methods

GetZ0pu
Gets the zero-sequence impedance in p.u. of the transformer for the specified tap position. If
the tap position is out of the tap changer range, the respective min. or max. position will be
used.
[float r0pu,
float x0pu ] ElmTr2.GetZ0pu(int itappos,
int systembase)

A RGUMENTS
itappos Tap position

r0pu (out)
Resistance in p.u.
x0pu (out)
Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

GetZpu
Gets the impedance in p.u. of the transformer for the specified tap position. If the tap position is
out of the tap changer range, the respective min. or max. position will be used.
[float rpu,
float xpu ] [Link](int itappos,
int systembase)

A RGUMENTS
itappos Tap position
rpu (out) Resistance in p.u.
xpu (out) Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

IsQuadBooster
Returns whether transformer is a quadbooster; i.e. checks phase shift angle modulus 180◦ .
int [Link]()

R ETURNS
'1' if quadbooster, else '0'

DIgSILENT PowerFactory 2018, Python Function Reference 139


Chapter 5. Object Methods

NTap
Gets the transformer tap position.
int [Link]()

R ETURNS
The tap position.

5.2.31 ElmTr3
Overview

CreateEvent
GetGroundingImpedance
GetSuppliedElements
GetTapPhi
GetTapRatio
GetTapZDependentSide
GetZ0pu
GetZpu
IsQuadBooster
NTap

CreateEvent
For the corresponding transformer, a Tap Event (EvtTap) is created for the simulation.
int [Link]([float tapAction,]
[float tapPos,]
[float busIdx]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic
tapPos (optional)
Position of tap
busIdx (optional)
Bus index

R ETURNS
0 on success

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

DIgSILENT PowerFactory 2018, Python Function Reference 140


Chapter 5. Object Methods

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetSuppliedElements
Returns the network components that are supplied by the transformer.
A network component is considered to be supplied by a transformer if a topological path from
the transformer to the component exists. A valid topological path in this sense is a path that
starts at the transformer's HV side in direction of transformer (not in direction of HV connected
node) and stops at

• network components that are out of calculation,


• network components that are not active (e.g. hidden or those of currently inactive grids),

• open switches,
• connections leading to a higher voltage level.

Generally all network components of such a path are considered to be supplied by the trans-
former. Exceptions are components that are out of calculation or in-active. Those components
are never considered to be supplied by any transformer.
A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
list [Link]([int inclNested])

A RGUMENTS
inclNested (optional)
0 Only include components which are directly supplied by the transformer
(not nested components)
1 Include nested components and components that are directly supplied
by the transformer (default)

S EE ALSO

[Link](), [Link](), [Link]()

GetTapPhi
Gets the tap phase shift in deg of the transformer for given tap position and side.

DIgSILENT PowerFactory 2018, Python Function Reference 141


Chapter 5. Object Methods

float [Link](int iSide,


int itappos,
int inclPhaseShift
)

A RGUMENTS
iSide for tap at side (0=Hv, 1=Mv, 2=Lv)
itappos Tap position for corresponding side
inclPhaseShift
1 = Includes the vector group phase shift, 0 = consider only the tap phase shift

R ETURNS
Returns the tap phase shift angle of the transforrmer for given tap position and side

GetTapRatio
Gets the voltage ratio of the transformer for given tap position and side.
float [Link](int iSide,
int itappos,
int includeNomRatio
)

A RGUMENTS
iSide for tap at side (0=Hv, 1=Mv, 2=Lv)
itappos Tap position at corresponding side
includeNomRatio
1 = Includes nominal ratio of the transformer, 0 = consider only tap ratio

R ETURNS
Returns the voltage ratio of the transforrmer for given tap position and side

GetTapZDependentSide
Get tap side used for the dependent impedance
None [Link]()

R ETURNS
-1 if no tap dependent impedance is defined
0 for HV tap
1 for MV tap
2 for LV tap

GetZ0pu
Gets the zero-sequence impedance in p.u. of the transformer for the specified tap position. If
the tap position is out of the tap changer range, the respective min. or max. position will be
used.

DIgSILENT PowerFactory 2018, Python Function Reference 142


Chapter 5. Object Methods

[float r0pu,
float x0pu ] ElmTr3.GetZ0pu(int itappos,
int iSide,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-MV impedance.
1 Get the MV-LV impedance.
2 Get the LV-HV impedance.
r0pu (out)
Resistance in p.u.
x0pu (out)
Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

GetZpu
Gets the impedance in p.u. of the transformer for the specified tap position. If the tap position is
out of the tap changer range, the respective min. or max. position will be used.
[float rpu,
float xpu ] [Link](int itappos,
int iSide,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-MV impedance.
1 Get the MV-LV impedance.
2 Get the LV-HV impedance.
rpu (out) Resistance in p.u.
xpu (out) Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

IsQuadBooster
Returns whether transformer is a quadbooster or not, i.e. checks phase shift angle modulus
180◦ .
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 143


Chapter 5. Object Methods

R ETURNS
'1' if the transformer phase shift angle modulus 180◦ does not equal 0 at any of the sides LV,
MV, HV, else '0'

NTap
Gets the transformer tap position.
int [Link](float busIdx)

A RGUMENTS
busIdx 0=HV, 1=MV, 2=LV

R ETURNS
The tap position.

5.2.32 ElmTr4
Overview

CreateEvent
GetGroundingImpedance
GetSuppliedElements
GetTapPhi
GetTapRatio
GetTapZDependentSide
GetZ0pu
GetZpu
IsQuadBooster
NTap

CreateEvent
For the corresponding transformer, a Tap Event (EvtTap) is created for the simulation.
int [Link]([float tapAction,]
[float tapPos,]
[float busIdx]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic
tapPos (optional)
Position of tap

busIdx (optional)
Bus index

R ETURNS
0 on success

DIgSILENT PowerFactory 2018, Python Function Reference 144


Chapter 5. Object Methods

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.

reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

GetSuppliedElements
Returns the network components that are supplied by the transformer.
A network component is considered to be supplied by a transformer if a topological path from
the transformer to the component exists. A valid topological path in this sense is a path that
starts at the transformer's HV side in direction of transformer (not in direction of HV connected
node) and stops at

• network components that are out of calculation,


• network components that are not active (e.g. hidden or those of currently inactive grids),

• open switches,
• connections leading to a higher voltage level.

Generally all network components of such a path are considered to be supplied by the trans-
former. Exceptions are components that are out of calculation or in-active. Those components
are never considered to be supplied by any transformer.
A transformer is never considered to supply itself.
Composite components such as ElmBranch, ElmSubstat, ElmTrfstat are considered to be sup-
plied by a transformer if all energized components inside that composite are supplied by the
transformer.
list [Link]([int inclNested])

A RGUMENTS
inclNested (optional)
0 Only include components which are directly supplied by the transformer
(not nested components)
1 Include nested components and components that are directly supplied
by the transformer (default)

DIgSILENT PowerFactory 2018, Python Function Reference 145


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link](), [Link]()

GetTapPhi
Gets the tap phase shift in deg of the transformer for given tap position and side.
float [Link](int iSide,
int itappos,
int inclPhaseShift
)

A RGUMENTS
iSide for tap at side (0=HV, 1=LV1, 2=Lv2, 3=Lv3)
itappos Tap position for corresponding side
inclPhaseShift
1 = Includes the vector group phase shift, 0 = consider only the tap phase shift

R ETURNS
Returns the tap phase shift angle of the transforrmer for given tap position and side

GetTapRatio
Gets the voltage ratio of the transformer for given tap position and side.
float [Link](int iSide,
int itappos,
int includeNomRatio
)

A RGUMENTS
iSide for tap at side (0=HV, 1=LV1, 2=Lv2, 3=Lv3)
itappos Tap position at corresponding side
includeNomRatio
1 = Includes nominal ratio of the transformer, 0 = consider only tap ratio

R ETURNS
Returns the voltage ratio of the transforrmer for given tap position and side

GetTapZDependentSide
Get tap side used for the dependent impedance
None [Link]()

R ETURNS
-1 if no tap dependent impedance is defined
0 for HV tap
1 for LV1 tap

DIgSILENT PowerFactory 2018, Python Function Reference 146


Chapter 5. Object Methods

2 for LV2 tap


2 for LV3 tap

GetZ0pu
Gets the zero-sequence impedance in p.u. of the transformer for the specified tap position. If
the tap position is out of the tap changer range, the respective min. or max. position will be
used.
[float r0pu,
float x0pu ] ElmTr4.GetZ0pu(int itappos,
int iSide,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-LV1 impedance.
1 Get the HV-LV2 impedance.
2 Get the HV-LV3 impedance.
3 Get the LV1-LV2 impedance.
4 Get the LV1-LV3 impedance.
5 Get the LV2-LV3 impedance.
r0pu (out)
Resistance in p.u.
x0pu (out)
Reactance in p.u.
systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

GetZpu
Gets the impedance in p.u. of the transformer for the specified tap position. If the tap position is
out of the tap changer range, the respective min. or max. position will be used.
[float rpu,
float xpu ] [Link](int itappos,
int iSide,
int systembase)

A RGUMENTS
itappos Tap position of the z-dependent tap
iSide
0 Get the HV-LV1 impedance.
1 Get the HV-LV2 impedance.
2 Get the HV-LV3 impedance.

DIgSILENT PowerFactory 2018, Python Function Reference 147


Chapter 5. Object Methods

3 Get the LV1-LV2 impedance.


4 Get the LV1-LV3 impedance.
5 Get the LV2-LV3 impedance.
rpu (out) Resistance in p.u.
xpu (out) Reactance in p.u.

systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

IsQuadBooster
Returns whether transformer is a quadbooster or not, i.e. checks phase shift angle modulus
180◦ .
int [Link]()

R ETURNS
'1' if the transformer phase shift angle modulus 180◦ does not equal 0 at any of the sides HV,
LV1, LV2, LV3, else '0'

NTap
Gets the transformer tap position.
int [Link](float busIdx)

A RGUMENTS
busIdx 0=HV, 1=MV, 2=LV

R ETURNS
The tap position.

5.2.33 ElmTrfstat
Overview

GetSplit
GetSplitCal
GetSplitIndex
GetSuppliedElements

GetSplit
A split of a station is a group of topologically connected elements. Such a group is called split
if all contained components are energized and there is at least one busbar (terminal of usage
'busbar') contained or it has connections to at least two main components (= all components
except switch devices and terminals).
These splits are ordered according to the count of nodes contained and according to their

DIgSILENT PowerFactory 2018, Python Function Reference 148


Chapter 5. Object Methods

priority. So each split becomes a unique index.


The function GetSplit offers access to the elements contained in a split. By calling GetSplit with
an index from 0 to n, the elements belonging to the corresponding split are filled into given sets
and returned.
[int error
list mainNodes,
list connectionCubicles,
list allElements ] [Link](int index)

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Value
must be ≥ 0.
mainNodes (out)
Terminals of same usage considered to form the most important nodes for that
group. In most cases, this is the group of contained busbars.
connectionCubicles (optional, out)
All cubicles (of terminals inside the station) that point to an element that sits out-
side the station or to an element that is connected to a terminal outside the station
are filled into the set connectionCubicles. (The connection element (branch) can
be accessed by calling GetBranch() on each of these cubicles. The terminals
of these cubicles (parents) must not necessarily be contained in any split. They
could also be separated by a disconnecting component.)
allElements(optional, out)
All elements (class Elm*) of the split that have no connection to elements outside
the station are filled into this set.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

S EE ALSO

[Link](), [Link](),

GetSplitCal
This function determines the elements that belong to a split. In contrast to [Link]()
it is based on calculation instead of pure edit object topology. This means the returned nodes
correspond to the calculation nodes, the interconnecting cubicles are those connecting nodes
of different splits.
Note: As this function relies on calculation nodes it can only be executed after a calculation has
been performed (e.g. load flow calculation).
[int error,
list nodes,
list connectionCubicles,
list elements ] [Link](int index)

A RGUMENTS
index Index of the split used to access the elements of the corresponding split. Refers
to same split as index in [Link]().
Value must be ≥ 0.

DIgSILENT PowerFactory 2018, Python Function Reference 149


Chapter 5. Object Methods

nodes (out)
A set that is filled with terminals. There is one terminal returned for each calcula-
tion node in the split.
connectionCubicles (optional, out)
This set is filled with all cubicles that point from a calculation node of current split
to another calculation node that does not belong to that split. The connecting
element can be accessed by calling GetBranch() on such a cubicle.
elements (optional, out)
This set is filled with network elements that are connected to a calculation node of
current split and have exactly one connection, i.e. these elements are completely
contained in the split.

R ETURNS
0 success, split of that index exists and is returned.
1 indicates that there exists no split with given index. (Moreover, this means that
there is no split with index n greater than this value.)

S EE ALSO

[Link]()

GetSplitIndex
This function returns the index of the split that contains passed object.
int [Link](DataObject o)

A RGUMENTS
o Object for which the split index is to be determined.

R ETURNS
≥0 index of split in which element is contained
-1 given object does not belong to any split of that station

S EE ALSO

[Link]()

GetSuppliedElements
Returns all network components that are supplied by the transformers located in the station.
list [Link]([int inclNested])

A RGUMENTS
inclNested (optional)
0 Do not include components that are supplied by nested supplying sta-
tions
1 (default) Include components that are supplied by nested stations

DIgSILENT PowerFactory 2018, Python Function Reference 150


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link]()

5.2.34 ElmVoltreg
Overview

CreateEvent
GetGroundingImpedance
GetZpu
NTap

CreateEvent
For the corresponding voltage regulator, a Tap Event (EvtTap) is created for the simulation.
int [Link]([float tapAction,]
[float tapPos]
)

A RGUMENTS
tapAction (optional)
0=increase tap; 1=decrease tap; 2=set tap to tapPos; 3=manual; 4=automatic
tapPos (optional)
Position of tap

R ETURNS
0 on success

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)
1 The values are valid.

DIgSILENT PowerFactory 2018, Python Function Reference 151


Chapter 5. Object Methods

GetZpu
Gets the impedance in p.u. of the voltage regulator for the specified tap position. If the tap
position is out of the tap changer range, the respective min. or max. position will be used.
[float rpu,
float xpu ] [Link](int itappos,
int systembase)

A RGUMENTS
itappos Tap position
rpu (out) Resistance in p.u.

xpu (out) Reactance in p.u.


systembase
0 p.u. is based on rated power.
1 p.u. is based on system base (e.g. 100MVA).

NTap
Gets the voltage regulator tap position.
int [Link]()

R ETURNS
The tap position.

5.2.35 ElmXnet
Overview

GetGroundingImpedance
GetStepupTransformer

GetGroundingImpedance
Returns the impedance of the internal grounding.
[int valid,
float resistance,
float reactance ] [Link](int busIdx)

A RGUMENTS
busIdx Bus index where the grounding should be determined.
resistance (out)
Real part of the grounding impedance in Ohm.
reactance (out)
Imaginary part of the grounding impedance in Ohm.

R ETURNS
0 The values are invalid (e.g. because there is no internal grounding)

DIgSILENT PowerFactory 2018, Python Function Reference 152


Chapter 5. Object Methods

1 The values are valid.

GetStepupTransformer
Performs a topological search to find the step-up transformer of an external grid
DataObject [Link](float voltage,
int swStatus
)

A RGUMENTS
voltage voltage level at which the search will stop
swStatus consideration of switch status. Possible values are:
0 consider all switch status
1 ignore breaker status
2 ignore all switch status

R ETURNS
Returns the first collected step-up transformer object. It is empty if not found (e.g. start
terminal already at hvVoltage).

5.2.36 ElmZone
Overview

CalculateInterchangeTo
DefineBoundary
GetAll
GetBranches
GetBuses
GetObjs
SetLoadScaleAbsolute

CalculateInterchangeTo
Calculates interchange power to the given zone (calculated quantities are: Pinter, Qinter, Pex-
port, Qexport, Pimort, Qimport). Prior the calculation the valid load flow calculation is required.
int [Link](DataObject zone)

A RGUMENTS
zone zone to which the interchage is calculated

R ETURNS
<0 calculation error (i.e. no valid load flow, empty zone...)
0 no interchage power to the given zone
1 interchange power calculated

DIgSILENT PowerFactory 2018, Python Function Reference 153


Chapter 5. Object Methods

DefineBoundary
Defines boundary with this zone as interior part. Resulting cubicles of boundary are busbar-
oriented towards the zone.
DataObject [Link](int shift)

A RGUMENTS
shift Elements outside the zone that are within a distance of shift many elements to a
boundary cubicle of the zone are added to the interior part of the resulting bound-
ary

R ETURNS
The defined boundary is returned in case of success. Otherwise NULL, if an error appeared
in the definition of the boundary.

GetAll
Returns all objects which belong to this zone.
list [Link]()

R ETURNS
The set of objects.

GetBranches
Returns all branches which belong to this zone.
list [Link]()

R ETURNS
The set of branch objects.

GetBuses
Returns all buses which belong to this zone.
list [Link]()

R ETURNS
The set of objects.

GetObjs
Returns all objects of the given class which belong to this zone.
list [Link](str classname)

A RGUMENTS
classname
name of the class (i.e. ”ElmTr2”)

DIgSILENT PowerFactory 2018, Python Function Reference 154


Chapter 5. Object Methods

R ETURNS
The set of contained objects.

SetLoadScaleAbsolute
Readjusts zonal load scaling factor to the given active power. The zonal load scaling factor is
the ratio of the given active power and the loads total actual power.
None [Link](float Pin)

A RGUMENTS
Pin active power in MW used for the load scaling factor.

5.3 Station Elements

5.3.1 StaCt
Overview

SetPrimaryTap

SetPrimaryTap
Function automatically sets primary tap depending on the nominal current of the measured
branch. The pattern according to which the tap current is found: BranchCurrent = BranchNomi-
nalCurrent * Factor. The primary tap currents are checked wheather there are equal or at least
first higher value than BranchCurrent, otherwise selects the maximum one.
int [Link]([float mltFactor])

A RGUMENTS
mltFactor (optional)
Multiplication factor (default 1.0)

R ETURNS
0 Correctly set.
1 Error.

5.3.2 StaCubic
Overview

GetAll
GetBranch
GetConnectedMajorNodes
GetConnections
GetNearestBusbars
GetPathToNearestBusbar
IsClosed
IsConnected
DIgSILENT PowerFactory 2018, Python Function Reference 155
Chapter 5. Object Methods

GetAll
This function returns a set of network components that are collected by a topological traversal
starting from this cubicle.
list [Link]([int direction = 1,]
[int ignoreOpenSwitches = 0]
)

A RGUMENTS
direction (optional)
Specifies the direction in which the network topology is traversed.

1 Traversal to the branch element (default).


0 Traversal to the terminal element.
ignoreOpenSwitches (optional)
Determines whether to pass open switches or to stop at them.

0 The traversal stops in a direction if an open switch is reached (default).


1 Ignore all switch statuses and pass every switch.

R ETURNS
A set of network components that are collected by a topological traversal starting at the
cubicle (StaCubic) where the function is called.

GetBranch
Function gets the branch of this cubicle.
DataObject [Link]()

R ETURNS
Branch object.

GetConnectedMajorNodes
This function returns all busbars being part of a split (inside a station) that can be reached by
starting a topology search from the cubicle in direction of the branch element.
list [Link] ([float swtStat])

A RGUMENTS
swtStat
0 (default) First perform a search that respects switch states (stoping at open
switches). If no switches are found, an additional search with ignoring
switch states.
1 Perform one search ignoring switch states (passing open and closed
switches).
2 Search with respecting switch states. But do no additional search when
switch is found.

DIgSILENT PowerFactory 2018, Python Function Reference 156


Chapter 5. Object Methods

R ETURNS
A set of all busbars that can be reached starting a topology search from the cubicle in direc-
tion of the branch element.

GetConnections
Function gets all elements connected with this cubicle.
list [Link](int swtStat)

A RGUMENTS
swtStat Consider switch status (1) or not (0).

R ETURNS
Set of elements.

GetNearestBusbars
Function searches for connected and connectable nearest busbars starting at the cubicle.
Search stops at the nearest busbars and out of service elements. Internal and junction nodes,
all types of branch elements and all types of switches i.e. circuit-breakers and disconnectors
are passed.
Connected busbars are all busbars which are topologically connected to the start cubicle without
passing open switches. Connectable busbars are all busbars which are connectable to the start
cubicle by closing switches. If the start cubicles terminal is a busbar then this busbar is not
included in the result sets.
If more than one path exists between cubicle and a nearest busbar the relevant busbar is added
only once to the result set.
[list connectedBusbars,
list connectableBusbars] [Link](int searchDirection)

A RGUMENTS
connectedBusbars (out)
Found connected busbars.
connectableBusbars (out)
Found connectable busbars.
searchDirection
Direction of the search relative to the cubicle. Possible values are
0 search in all directions
1 search in direction of cubicles terminal
2 search towards connected branch element

GetPathToNearestBusbar
Function determines the path from the cubicle to the given busbar. The busbar must be con-
nected or connectable to the start cubicle without passing additional busbars. If the given busbar
is not a nearest busbar in relation to the cubicle an empty path is returned.

DIgSILENT PowerFactory 2018, Python Function Reference 157


Chapter 5. Object Methods

If more than one closed path exists between cubicle and busbar the elements of all these paths
are combined.
list [Link](DataObject nearestBusbar)

A RGUMENTS
nearestBusbar
Nearest busbar in relation to cubicle.

R ETURNS
Net elements of the path from cubicle to busbar.

IsClosed
Function checks if this cubicle is directly connected with the busbar, considering the switch
status.
int [Link]()

R ETURNS
0 Disconnected cubicle.
1 Connected cubicle.

IsConnected
Function checks if the cubicle is connected to the passed terminal or coupler.
int [Link](DataObject elm,
int swtStat
)

A RGUMENTS
elm Terminal or coupler to check connection with.
swtStat Consider switch status (1) or not (0).

R ETURNS
0 Not connected.
1 Connected.

5.3.3 StaExtbrkmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp

DIgSILENT PowerFactory 2018, Python Function Reference 158


Chapter 5. Object Methods

ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for the switch position currently stored in the measurement object.
[int error,
float value] [Link]()

A RGUMENTS
value (out)
Value for switch status.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtbrk-
[Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

DIgSILENT PowerFactory 2018, Python Function Reference 159


Chapter 5. Object Methods

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details
on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtbrk-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

DIgSILENT PowerFactory 2018, Python Function Reference 160


Chapter 5. Object Methods

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value for the switch position currently stored in the measurement object.
int [Link](int value)

A RGUMENTS
value New value for switch status.

R ETURNS
Return value has no meaning. It is always 0.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint
bit6 0x00000040 On Event

DIgSILENT PowerFactory 2018, Python Function Reference 161


Chapter 5. Object Methods

bit7 0x00000080 Event Block.

bit8 0x00000100 Alarm Block.


bit9 0x00000200 Update Block.
bit10 0x00000400 Control Block.

bit29 0x20000000 Read


bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 162


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 163


Chapter 5. Object Methods

5.3.4 StaExtcmdmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for command interpreted as floating point value.
[int error,
float value] [Link]()

A RGUMENTS
value (out)
Value obtained by parsing stored command string as floating point value.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtcmd-
[Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

DIgSILENT PowerFactory 2018, Python Function Reference 164


Chapter 5. Object Methods

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details
on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtcmd-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the
status bits.
None [Link](int mask, int dbSync)

DIgSILENT PowerFactory 2018, Python Function Reference 165


Chapter 5. Object Methods

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

DIgSILENT PowerFactory 2018, Python Function Reference 166


Chapter 5. Object Methods

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

DIgSILENT PowerFactory 2018, Python Function Reference 167


Chapter 5. Object Methods

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 168


Chapter 5. Object Methods

5.3.5 StaExtdatmea
Overview

CopyExtMeaStatusToStatusTmp
CreateEvent
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

CreateEvent
Creates a “parameter change” event for controller object (’pCtrl’) and attribute (’varName’). The
event is stored in simulation event list and executed immediately.
None [Link]()

GetMeaValue
Returns the value stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value, optionally modified by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be modified by the multiplicator stored in the
measurement object (depending on Mode incremental/absolute). If 0, raw value
will be returned.

DIgSILENT PowerFactory 2018, Python Function Reference 169


Chapter 5. Object Methods

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtdat-
[Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details
on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtdat-
[Link]() for details on the status bits.

DIgSILENT PowerFactory 2018, Python Function Reference 170


Chapter 5. Object Methods

int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data

DIgSILENT PowerFactory 2018, Python Function Reference 171


Chapter 5. Object Methods

bit1 0x00000002 Tele-Measurement

bit2 0x00000004 Disturbance


bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect

bit5 0x00000020 Violated constraint


bit6 0x00000040 On Event
bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read

bit30 0x40000000 Write


bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

DIgSILENT PowerFactory 2018, Python Function Reference 172


Chapter 5. Object Methods

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

DIgSILENT PowerFactory 2018, Python Function Reference 173


Chapter 5. Object Methods

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

5.3.6 StaExtfmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for frequency currently stored in the measurement object.
[int error,
float value] [Link]()

A RGUMENTS
value (out)
Value for frequency.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See [Link]()
for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 174


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 175


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 176


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 177


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on the
status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 178


Chapter 5. Object Methods

5.3.7 StaExtfuelmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for fuel currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for fuel, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtfu-
[Link]() for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 179


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details
on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtfu-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 180


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 181


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 182


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 183


Chapter 5. Object Methods

5.3.8 StaExtimea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for current currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for current, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaEx-
[Link]() for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 184


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaEx-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 185


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 186


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 187


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on the
status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 188


Chapter 5. Object Methods

5.3.9 StaExtpfmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for power factor currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for current, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See [Link]()
for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 189


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 190


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 191


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 192


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 193


Chapter 5. Object Methods

5.3.10 StaExtpmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for active power stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for active power, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExtp-
[Link]() for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 194


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExtp-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 195


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 196


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 197


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 198


Chapter 5. Object Methods

5.3.11 StaExtqmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for reactive power currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for reactive power, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaEx-
[Link]() for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 199


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaEx-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 200


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 201


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 202


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 203


Chapter 5. Object Methods

5.3.12 StaExtsmea
Overview

CopyExtMeaStatusToStatusTmp
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See [Link]()
for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.

DIgSILENT PowerFactory 2018, Python Function Reference 204


Chapter 5. Object Methods

This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

DIgSILENT PowerFactory 2018, Python Function Reference 205


Chapter 5. Object Methods

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data

bit1 0x00000002 Tele-Measurement


bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect

bit5 0x00000020 Violated constraint


bit6 0x00000040 On Event
bit7 0x00000080 Event Block.

bit8 0x00000100 Alarm Block.


bit9 0x00000200 Update Block.
bit10 0x00000400 Control Block.
bit29 0x20000000 Read

bit30 0x40000000 Write


bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

DIgSILENT PowerFactory 2018, Python Function Reference 206


Chapter 5. Object Methods

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

DIgSILENT PowerFactory 2018, Python Function Reference 207


Chapter 5. Object Methods

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

5.3.13 StaExttapmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus

DIgSILENT PowerFactory 2018, Python Function Reference 208


Chapter 5. Object Methods

SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for tap position and tap info currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value.
type type of value to return

0 tap position
1 operation mode
2 tap changer command
3 tap operation mode
4 tap operation mode command
useTranslationTable
Only supported if type=0 (tap step), if 1 (default) returned value will be translated
according to given table. If 0 is passed, the raw value will be returned.

R ETURNS
0 on success
1 on error, e.g. unsupported type
Returns 1 on erroReturn value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See StaExttap-
[Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

DIgSILENT PowerFactory 2018, Python Function Reference 209


Chapter 5. Object Methods

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details
on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See StaExttap-
[Link]() for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

DIgSILENT PowerFactory 2018, Python Function Reference 210


Chapter 5. Object Methods

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance

bit3 0x00000008 Protection


bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

bit6 0x00000040 On Event


bit7 0x00000080 Event Block.
bit8 0x00000100 Alarm Block.

DIgSILENT PowerFactory 2018, Python Function Reference 211


Chapter 5. Object Methods

bit9 0x00000200 Update Block.


bit10 0x00000400 Control Block.
bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

DIgSILENT PowerFactory 2018, Python Function Reference 212


Chapter 5. Object Methods

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 213


Chapter 5. Object Methods

5.3.14 StaExtv3mea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for voltage currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for voltage, optionally multiplied by configured multiplicator
phase Index of desired phase. Index must be 0, 1 or 2.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
0 on success
1 on error, e.g. phase index does not exist

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See [Link]()
for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 214


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details
on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 215


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 216


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 217


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 218


Chapter 5. Object Methods

5.3.15 StaExtvmea
Overview

CopyExtMeaStatusToStatusTmp
GetMeaValue
GetStatus
GetStatusTmp
InitTmp
IsStatusBitSet
IsStatusBitSetTmp
ResetStatusBit
ResetStatusBitTmp
SetMeaValue
SetStatus
SetStatusBit
SetStatusBitTmp
SetStatusTmp
UpdateControl
UpdateCtrl

CopyExtMeaStatusToStatusTmp
Copies the (persistent) status of current measurement object to temporary (in memory) status.
None [Link]()

GetMeaValue
Returns the value for voltage currently stored in the measurement object.
[int error,
float value] [Link](int unused,
int applyMultiplicator)

A RGUMENTS
value (out)
Value for voltage, optionally multiplied by configured multiplicator
unused Not used.
applyMultiplicator
If 1 (default), returned value will be multiplied by the multiplicator stored in the
measurement object. If 0, raw value will be returned.

R ETURNS
Return value has no meaning. It is always 0.

GetStatus
Returns the status flags. Please note, this value is interpreted as a bitfield. See [Link]()
for details on the status bits.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 219


Chapter 5. Object Methods

R ETURNS
Status bitfield as an integer value.

GetStatusTmp
Returns the temporary (in memory) status flags. Please note, this value is interpreted as a
bitfield. See [Link]() for details on the status bits.
int [Link]()

R ETURNS
Status bitfield as an integer value.

InitTmp
Initialises the temporary (in memory) fields of the measurement object with the values currently
stored in the corresponding persistent fields. This affects temporary measurement value and
temporary status fields. The temporary measurement value is used internally for comparison of
new and old values for deadband violation. The temporary status is used during calculation in
order to not modify initial value.
This function should be called once after the link has been established and before the calculation
loop is executed.
None [Link]()

IsStatusBitSet
Checks if specific bit(s) are set in the status bitfield. See [Link]() for details on
the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

IsStatusBitSetTmp
Checks if specific bit(s) are set in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
int [Link](int mask)

R ETURNS
0 if at least one bit in mask is not set
1 if all bit(s) in mask are set

DIgSILENT PowerFactory 2018, Python Function Reference 220


Chapter 5. Object Methods

ResetStatusBit
Resets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

ResetStatusBitTmp
Resets specific bits in the temporary (in memory) status bitfield. See [Link]()
for details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 0. A bit is unchanged if already unset before.

SetMeaValue
Sets the value stored in the measurement object.
int [Link](float value)

A RGUMENTS
value New value.

R ETURNS
Return value has no meaning. It is always 0.

SetStatus
Sets the status flags of the measurement object. Please note, this value is interpreted as
a bitfield where the bits have the following meaning. An option is considered enabled if the
corresponding bit is set to 1.

bit0 0x00000001 Manually entered data


bit1 0x00000002 Tele-Measurement
bit2 0x00000004 Disturbance
bit3 0x00000008 Protection
bit4 0x00000010 Marked suspect
bit5 0x00000020 Violated constraint

DIgSILENT PowerFactory 2018, Python Function Reference 221


Chapter 5. Object Methods

bit6 0x00000040 On Event

bit7 0x00000080 Event Block.


bit8 0x00000100 Alarm Block.
bit9 0x00000200 Update Block.

bit10 0x00000400 Control Block.


bit29 0x20000000 Read
bit30 0x40000000 Write
bit31 0x80000000 Neglected by SE

None [Link](int status, int dbSync)

A RGUMENTS
status Bitfield for status flags, see above
dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBit
Sets specific bits in the status bitfield. See [Link]() for details on the status
bits.
None [Link](int mask, int dbSync)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

dbSync (optional)
0 New status flags are applied in memory only
1 Default, new status flags are stored on db (persistent)

SetStatusBitTmp
Sets specific bits in the temporary (in memory) status bitfield. See [Link]() for
details on the status bits.
None [Link](int mask)

A RGUMENTS
mask Mask of bits to set to 1. A bit is unchanged if already set before.

DIgSILENT PowerFactory 2018, Python Function Reference 222


Chapter 5. Object Methods

SetStatusTmp
Sets the temporary (in memory) status flags of the measurement object. This temporary value
is used during calculations so that changes do not lead to object modifications and initial value
remains unchanged.
Please note, this value is interpreted as a bitfield. See [Link]() for details on
the status bits.
None [Link](int status)

A RGUMENTS
status Bitfield for status flags, see above

UpdateControl
Transfers the value of current measurement object to the controller object (target object 'pCtrl'
and target attribute 'varName'). If target object is a command, it is automatically executed
afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

UpdateCtrl
Transfers the value of current measurement object to the controlled object (target object 'pOb-
ject' and target attribute 'variabName'). If target object is a command, it is automatically exe-
cuted afterwards.
Note: Calculation results will not be reset by this value transfer.
int [Link](int dbSync)

A RGUMENTS
dbSync (optional)
0 Value is copied in memory only
1 Default, copied value is stored on db (persistent)

R ETURNS
0 on success
1 on error, e.g. target object does not have an attribute with given name

DIgSILENT PowerFactory 2018, Python Function Reference 223


Chapter 5. Object Methods

5.3.16 StaSwitch
Overview

Close
IsClosed
IsOpen
Open

Close
Closes the switch by changing its status to ’close’. This action will fail if the status is currently
determined by an active running arrangement.
int [Link]()

R ETURNS
0 On success
6= 0 On error

S EE ALSO

[Link]()

IsClosed
Returns information about current switch state.
int [Link]()

R ETURNS
1 switch is closed
0 switch is open

S EE ALSO

[Link]()

IsOpen
Returns information about current switch state.
int [Link]()

R ETURNS
1 switch is open
0 switch is closed

S EE ALSO

[Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 224


Chapter 5. Object Methods

Open
Opens the switch by changing its status to ’open’. This action will fail if the status is currently
determined by an active running arrangement.
int [Link]()

R ETURNS
0 On success
6= 0 On error

S EE ALSO

[Link]()

5.4 Commands
Overview

Execute

Execute
Executes the command.
int Com*.Execute()

5.4.1 ComAddlabel
Overview

Execute

Execute
This function executes the Add Statistic Labels command itself for a given plot and curve.
int [Link](DataObject, int curveIndex)

A RGUMENTS
plot The plot to modify.
curveIndex
The index of the curve inside the plot’s table. The index is zero based, therefore
the index of the first curve is 0.

R ETURNS
0 The function executed without any errors.
1 The plot is visible on a single line graphic only.
2 The parameter plot is None.
3 The parameter plot is not a virtual instrument (classname should start with Vis).
4 The object plot was found in any open graphic.

DIgSILENT PowerFactory 2018, Python Function Reference 225


Chapter 5. Object Methods

5 The object plot is not a diagram.


6 An internal error occured (plot is incomplete).

5.4.2 ComAddon
Overview

CreateModule
DefineDouble
DefineDoubleMatrix
DefineDoublePerConnection
DefineDoubleVector
DefineDoubleVectorPerConnection
DefineInteger
DefineIntegerPerConnection
DefineIntegerVector
DefineIntegerVectorPerConnection
DefineObject
DefineObjectPerConnection
DefineObjectVector
DefineObjectVectorPerConnection
DefineString
DefineStringPerConnection
DeleteModule
FinaliseModule
GetActiveModule
ModuleExists
SetActiveModule

CreateModule
Creates the calculation module of this AddOn. Volatile object parameters are created for all
variable definitions stored inside this command. They are accessible like any other built in
object parameter.
int [Link]()

R ETURNS
0 Ok, module was created.
1 An error occurred.

S EE ALSO

[Link]() [Link]()

DefineDouble
Creates a new floating-point-number parameter for the given type of objects.
int [Link](str class,
str name,
str desc,
str unit,
float initial)

DIgSILENT PowerFactory 2018, Python Function Reference 226


Chapter 5. Object Methods

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]()

DefineDoubleMatrix
Creates a new floating-point-matrix parameter for the given type of objects.
int [Link](string class,
str name,
str desc,
str unit,
int rows,
int columns,
float initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
rows Number of initial rows. Number of rows will be 0 if a value smaller than 0 is given.
columns Number of initial columns. Number of columns will be 0 if a value smaller than 0
is given.
initial Default value for all entries of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

DIgSILENT PowerFactory 2018, Python Function Reference 227


Chapter 5. Object Methods

DefineDoublePerConnection
Creates a new floating-point-number parameter for every connection for the given type of ob-
jects.
int [Link](str class,
str name,
str desc,
str unit,
float initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineDouble shall be used instead.

S EE ALSO

[Link]()

DefineDoubleVector
Creates a new floating-point-number vector parameter for the given type of objects.
int [Link](str class,
str name,
str desc,
str unit,
float initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

DIgSILENT PowerFactory 2018, Python Function Reference 228


Chapter 5. Object Methods

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]() [Link]()

DefineDoubleVectorPerConnection
Creates a new floating-point-number vector parameter for the given type of objects for every
connection of the object.
int [Link](str class,
str name,
str desc,
str unit,
float initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.

name Name of the new parameter


desc Parameter description
unit Parameter’s unit

initial Default value of new parameter


size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineDoubleVector shall be used instead.

S EE ALSO

[Link]()

DefineInteger
Creates a new integer parameter for the given type of objects.

DIgSILENT PowerFactory 2018, Python Function Reference 229


Chapter 5. Object Methods

int [Link](str class,


str name,
str desc,
str unit,
int initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]()

DefineIntegerPerConnection
Creates a new integer parameter for every connection for the given type of objects.
int [Link](str class,
str name,
str desc,
str unit,
int initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineInteger shall be used instead.

DIgSILENT PowerFactory 2018, Python Function Reference 230


Chapter 5. Object Methods

S EE ALSO

[Link]()

DefineIntegerVector
Creates a new integer vector parameter for the given type of objects.
int [Link](str class,
str name,
str desc,
str unit,
int initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]() [Link]()

DefineIntegerVectorPerConnection
Creates a new integer vector parameter for the given type of objects for every connection of the
object.
int [Link](str class,
str name,
str desc,
str unit,
int initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter

DIgSILENT PowerFactory 2018, Python Function Reference 231


Chapter 5. Object Methods

desc Parameter description

unit Parameter’s unit


initial Default value of new parameter
size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineIntegerVector shall be used instead.

S EE ALSO

[Link]()

DefineObject
Creates a new object parameter for the given type of objects.
int [Link](str class,
str name,
str desc,
DataObject initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter

desc Parameter description


initial Default object of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 232


Chapter 5. Object Methods

DefineObjectPerConnection
Creates a new object parameter for every connection for the given type of objects.
int [Link](str class,
str name,
str desc,
DataObject initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter

desc Parameter description


initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineObject shall be used instead.

S EE ALSO

[Link]()

DefineObjectVector
Creates a new object vector parameter for the given type of objects.
int [Link](str class,
str name,
str desc,
str unit,
DataObject initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.

name Name of the new parameter


desc Parameter description
unit Parameter’s unit

initial Default value of new parameter


size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

DIgSILENT PowerFactory 2018, Python Function Reference 233


Chapter 5. Object Methods

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]() [Link]()

DefineObjectVectorPerConnection
Creates a new object vector parameter for the given type of objects for every connection of the
object.
int [Link](str class,
str name,
str desc,
str unit,
DataObject initial,
int size)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.

name Name of the new parameter


desc Parameter description
unit Parameter’s unit

initial Default value of new parameter


size Initial size of vector. Size will be 0 if a value smaller than 0 is given.

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineObjectVector shall be used instead.

S EE ALSO

[Link]()

DefineString
Creates a new text parameter for the given type of objects.

DIgSILENT PowerFactory 2018, Python Function Reference 234


Chapter 5. Object Methods

int [Link](str class,


str name,
str desc,
str unit,
str initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.

S EE ALSO

[Link]()

DefineStringPerConnection
Creates a new text parameter for every connection for the given type of objects.
int [Link](str class,
str name,
str desc,
str unit,
str initial)

A RGUMENTS
class The type of objects for which the new parameter is to be created, e.g. ElmLne for
the line.
name Name of the new parameter
desc Parameter description
unit Parameter’s unit
initial Default value of new parameter

R ETURNS
0 Ok, Parameter was created.
Other than 0 An error occurred, possible reasons:
• The module of this add on does not exist.
• An object with the given class does not exist in PowerFactory.
• The parameter name for the given class already exists in the module.
• The elements of class are not branch elements. Therefore there is no con-
nection count. DefineString shall be used instead.

DIgSILENT PowerFactory 2018, Python Function Reference 235


Chapter 5. Object Methods

S EE ALSO

[Link]()

DeleteModule
Deletes the module of this add on.
int [Link]()

0 Success. The module is deleted completely.

1 Failure. The module does not exist and can therefore not be deleted.

S EE ALSO

[Link]()

FinaliseModule
Finalises a user defined module which was created using the mthod CreateModule. All user
defined variables defined for this module are read-only after the call of finalise module. The
module is the one being used in the flexible data, single line graphic text boxes and colouring.
It can be reset like any other built-in calculation using the reset button.
int [Link]()

R ETURNS
0 Ok, module was finalised.
1 An error occurred, this command is not the one being currently active.

S EE ALSO

[Link]()

GetActiveModule
Gets the key of the module being currently active. An empty string is returned if there is no
active module.
str [Link]()

R ETURNS
The key of the active module. an empty string is returned if there is no active module.

S EE ALSO

[Link]()

ModuleExists
Checks if the module for this add-on was already created using the method CreateModule.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 236


Chapter 5. Object Methods

R ETURNS
0 The module was not created yet.
1 The module was already created.

S EE ALSO

[Link]() [Link]() [Link]()

SetActiveModule
Set this module as active module. This method is required only if several modules are created
concurrently. In case that only one module is being used, there is no need to use this method,
because CreateModule sets the created module automatically as active module.
int [Link]()

R ETURNS
0 Success. This command is set as active module.
1 Failure. This command is already the active module.

S EE ALSO

[Link]() [Link]() [Link]()

5.4.3 ComCapo
Overview

ConnectShuntToBus
LossCostAtBusTech
TotalLossCost

ConnectShuntToBus
Connects the equivalent shunt in the specified terminal and executes the load flow command.
The shunt is not physically added in the database, just the susceptance is added for the calcu-
lation.
int [Link](DataObject terminal,
float phtech,
float Q
)

A RGUMENTS
terminal The terminal to which the shunt will be connected
phtech Phase technology. Possible values are
0 three-phase
1 ph-ph a-b
2 ph-ph b-c
3 ph-ph a-c
4 ph-e a
5 ph-e b

DIgSILENT PowerFactory 2018, Python Function Reference 237


Chapter 5. Object Methods

6 ph-e c

Note: In balanced load flow, the technology will always be three-phase.


Q Reactive power value in Mvar

R ETURNS
0 On succes.
1 An error occurred during load flow execution.

LossCostAtBusTech
Returns the losses cost of the selected terminal and configuration calculated during the sensi-
tivity analysis or the optimization.
float [Link](DataObject terminal,
float phtech
)

A RGUMENTS
terminal Specified bus
phtech Phase technology. Possible values are

0 three-phase
1 ph-ph a-b
2 ph-ph b-c
3 ph-ph a-c
4 ph-e a
5 ph-e b
6 ph-e c

R ETURNS
Returns the losses cost

TotalLossCost
Returns the total cost calculated after the sensitivity analysis or the optimization.
float [Link]([int iopt])

A RGUMENTS
iopt (optional)
Type of cost. Possible values are
0 Losses in MW (default)
1 Cost of losses
2 Cost of voltage violations
3 Cost of shunts

DIgSILENT PowerFactory 2018, Python Function Reference 238


Chapter 5. Object Methods

R ETURNS
Returns losses in MW or cost value.

5.4.4 ComConreq
Overview

Execute

Execute
Performs a Connection Request Assessment according to the selected method. Results are
provided for connection request elements in the single line graphic, and are summarised in a
report in the output window.
int [Link]()

R ETURNS
0 OK
1 Error: calculation function
2 Error: settings/initialisation/load flow

5.4.5 ComContingency
Overview

ContinueTrace
CreateRecoveryInformation
GetGeneratorEvent
GetInterruptedPowerAndCustomersForStage
GetInterruptedPowerAndCustomersForTimeStep
GetLoadEvent
GetNumberOfGeneratorEventsForTimeStep
GetNumberOfLoadEventsForTimeStep
GetNumberOfSwitchEventsForTimeStep
GetNumberOfTimeSteps
GetObj
GetSwitchEvent
GetTimeOfStepInSeconds
GetTotalInterruptedPower
JumpToLastStep
RemoveEvents
StartTrace
StopTrace

DIgSILENT PowerFactory 2018, Python Function Reference 239


Chapter 5. Object Methods

ContinueTrace
Continues trace execution for this contingency.
int [Link]()

R ETURNS
0 On success.
1 On error.

CreateRecoveryInformation
Creates recovery information for a contingency. The recovery information can later be retrieved
e.g. via [Link]().
Can only save one contingency at the same time.
int [Link](DataObject resultFileInput)

A RGUMENTS
resultFileInput
Read from this result file.

R ETURNS
0 On success.
1 On error.

GetGeneratorEvent
Gets generator event of a certain time step during recovery.
[Link]() has to be called beforehand to collect the data.
[ DataObject generator,
double changedP,
double changedQ ) ]
[Link](int currentTimeStep,
int loadEvent)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

switchEvent
Input: Number of generator events for a certain time step are get via ComContin-
[Link]()
generator (out)
Output: Generator that dispatched
changedP (out)
Output: Changed active power
changedQ (out)
Output: Changed reactive power

DIgSILENT PowerFactory 2018, Python Function Reference 240


Chapter 5. Object Methods

GetInterruptedPowerAndCustomersForStage
Gets recovery information of a contingency.
[Link]() has to be called beforehand to collect the data.
[ int error,
float interruptedPower,
float newInterruptedPower,
float interruptedCustomers,
float newInterruptedCustomers ]
[Link](float timeOfStageInMinutes)

A RGUMENTS
timeOfStageInMinutes
Input: Get Information for this time.
interruptedPower (out)
Output: Interrupted Power at this time.
newInterruptedPower (out)
Output: New interrupted Power at this time.
interruptedCustomers (out)
Output: Interrupted Customers at this time.
newInterruptedCustomers (out)
Output: New interrupted Customers at this time.

R ETURNS
0 On success.
1 On error.

GetInterruptedPowerAndCustomersForTimeStep
Gets recovery information of a contingency.
[Link]() has to be called beforehand to collect the data.
[ float interruptedPower,
float newInterruptedPower,
float interruptedCustomers,
float newInterruptedCustomers ]
[Link](int currentTimeStep)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

interruptedPower (out)
Output: Interrupted Power at this time.
newInterruptedPower (out)
Output: New interrupted Power at this time.
interruptedCustomers (out)
Output: Interrupted Customers at this time.
newInterruptedCustomers (out)
Output: New interrupted Customers at this time.

DIgSILENT PowerFactory 2018, Python Function Reference 241


Chapter 5. Object Methods

GetLoadEvent
Gets load event of a certain time step during recovery.
[Link]() has to be called beforehand to collect the data.
[ DataObject load,
double changedP,
double changedQ,
int& isTransfer ) ]
[Link](int currentTimeStep,
int loadEvent)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

switchEvent
Input: Number of load events for a certain time step are get via ComContin-
[Link]()
load (out) Output: Load that is shed or transfered
changedP (out)
Output: Changed active power
changedQ (out)
Output: Changed reactive power
isTransfer (out)
Output: = 0 : is load shedding event. >0 is load transfer event.

GetNumberOfGeneratorEventsForTimeStep
Returns the number of generator events of a certain step during recovery.
[Link]() has to be called beforehand to collect the data.
list(int, ...) [Link]([int currentTimeStep])

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

GetNumberOfLoadEventsForTimeStep
Returns the number of load events of a certain step during recovery.
[Link]() has to be called beforehand to collect the data.
list(int, ...) [Link]([int currentTimeStep])

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 242


Chapter 5. Object Methods

GetNumberOfSwitchEventsForTimeStep
Returns the number of switch events of a certain step during recovery.
[Link]() has to be called beforehand to collect the data.
list(int, ...) [Link]([int currentTimeStep])

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

GetNumberOfTimeSteps
Returns the number of time steps during recovery.
[Link]() has to be called beforehand to collect the data.
int [Link]()

GetObj
Gets interrupted element by index (zero based).
DataObject [Link](int index)

A RGUMENTS
index Element order index, 0 for the first object.

R ETURNS
object Interupted element for given index.
None Index out of range.

GetSwitchEvent
Gets switch event of a certain time step during recovery.
[Link]() has to be called beforehand to collect the data.
[ DataObject switchToBeActuated,
int isClosed,
int sectionalizingStep ) ]
[Link](int currentTimeStep,
int switchEvent)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

switchEvent
Input: Number of switch event for a certain time step are get via ComContin-
[Link]()
switchToBeActuated (out)
Output: Switch to be actuated

DIgSILENT PowerFactory 2018, Python Function Reference 243


Chapter 5. Object Methods

isClosed (out)
Output: > 0 if switch is closed
sectionalizingStep (out)
Output: sectionalizing step when this switch is actuated

GetTimeOfStepInSeconds
Returns the time of the current step during recovery.
[Link]() has to be called beforehand to collect the data.
list(float , ...) [Link](int currentTimeStep)

A RGUMENTS
currentTimeStep
Input: Number of time steps are get via [Link]()

GetTotalInterruptedPower
Gets the total interrupted power (in kW) during restoration. [Link]()
has to be called beforehand to collect the data.
float [Link]()

JumpToLastStep
Gets the last trace execution for this contingency.
int [Link]([float timeDelay])

A RGUMENTS
timeDelay (optional)
time delay in seconds between trace steps

R ETURNS
0 On success.
1 On error.

RemoveEvents
Removes events from this contingency.
None [Link]([float emitMessage])
None [Link](str whichEvents)
None [Link](float emitMessage,
str whichEvents
)
None [Link](str whichEvents,
float emitMessage
)

DIgSILENT PowerFactory 2018, Python Function Reference 244


Chapter 5. Object Methods

A RGUMENTS
emitMessage(optional)
0: no info message shall be issued after event removal
whichEvents(optional)
’lod’ removed load evenets, ’gen’ removes generator events, ’switch’ removes
switching events

StartTrace
Starts trace execution for this contingency.
int [Link]()

R ETURNS
0 On success.
1 Error, e.g. Contingency is not in trace.
2 On error.

StopTrace
Stops trace execution for this contingency.
int [Link]([int emitMessage])

A RGUMENTS
emitMessage (optional)
= 0: no trace-stop info messages shall be issued

R ETURNS
0 On Success.
1 Contingency is not in Trace.

5.4.6 ComDiff
Overview

Start
Stop

Start
Starts comparisons of calculation results. See [Link]() for more information.

S EE ALSO

[Link](), [Link](), [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 245


Chapter 5. Object Methods

Stop
Stops comparisons of calculation results. See [Link]() for more information.

S EE ALSO

[Link](), [Link](), [Link]()

5.4.7 ComDllmanager
Overview

Report

Report
Prints a status report of currently available external user-defined dlls (e.g. dpl, exdyn) to the
output window. (Same as pressing the ’Report’ button in the dialog.)
None [Link]()

5.4.8 ComDpl
Overview

CheckSyntax
Encrypt
Execute
GetExternalObject
GetInputParameterDouble
GetInputParameterInt
GetInputParameterString
IsEncrypted
SetExternalObject
SetInputParameterDouble
SetInputParameterInt
SetInputParameterString

CheckSyntax
Checks the syntax and input parameter of the DPL script and all its subscripts.
int [Link]()

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 246


Chapter 5. Object Methods

Encrypt
Encrypts a script and all its subscripts. The password is needed only to decrypt the encrypted
script. Execution of encrypted scripts work without password. If no password is given a ’Choose
Password’ dialog appears.
int [Link]([str password], [int doRemoveHistoricRecords], [int masterCode])

A RGUMENTS
password (optional)
password for decryption
doRemoveHistoricRecords (optional)
0: do not remove historic copies in database. 1: do remove 2: show dialog and
ask.

masterCode (optional)
used for re-selling scripts. 3rd party licence codes already set in the script will be
overwritten by this value.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link]()

Execute
Executes the DPL script. It is not possible to call this function with input parameter. Use
[Link](), [Link]() and [Link]()
instead.
int [Link]()

R ETURNS
For scripts without the use of exit() the following values are returned:

0 On a successfull execution.
1 An error occured.
6 User hit the break button.

S EE ALSO

[Link]()

GetExternalObject
Gets the external object defined in the ComDpl edit dialog.
[int error,
DataObject value] [Link](str name)

DIgSILENT PowerFactory 2018, Python Function Reference 247


Chapter 5. Object Methods

A RGUMENTS
name Name of the external object parameter.
value (out)
The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

GetInputParameterDouble
Gets the double input parameter value defined in the ComDpl edit dialog.
[int error,
float value] [Link](str name)

A RGUMENTS
name Name of the double input parameter.
value (out)
Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

GetInputParameterInt
Gets the integer input parameter value defined in the ComDpl edit dialog.
[int error,
int value ] [Link](str name)

A RGUMENTS
name Name of the integer input parameter.
value (out)
Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

DIgSILENT PowerFactory 2018, Python Function Reference 248


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

GetInputParameterString
Gets the string input parameter value defined in the ComDpl edit dialog.
[int error,
str value ] [Link](str name)

A RGUMENTS
name Name of the string input parameter.
value (out)
Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

IsEncrypted
Returns the encryption state of the script.
int [Link]()

R ETURNS
1 Script is encrypted.
0 Script is not encrypted.

S EE ALSO

[Link]()

SetExternalObject
Sets the external object defined in the ComDpl edit dialog.
int [Link](str name,
DataObject value
)

A RGUMENTS
name Name of the external object parameter.

value The external object.

DIgSILENT PowerFactory 2018, Python Function Reference 249


Chapter 5. Object Methods

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

SetInputParameterDouble
Sets the double input parameter value defined in the ComDpl edit dialog.
int [Link](str name,
double value
)

A RGUMENTS
name Name of the double input parameter.
value Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

SetInputParameterInt
Sets the integer input parameter value defined in the ComDpl edit dialog.
int [Link](str name,
int value
)

A RGUMENTS
name Name of the integer input parameter.

value Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 250


Chapter 5. Object Methods

SetInputParameterString
Sets the string input parameter value defined in the ComDpl edit dialog.
int [Link](str name,
str value
)

A RGUMENTS
name Name of the string input parameter.
value Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](), [Link](),


[Link]()

5.4.9 ComFlickermeter
Overview

Execute

Execute
Calculates the short- and long-term flicker according to IEC 61000-4-15.
int [Link]()

R ETURNS
0 OK
1 Error: column not found in file; other internal errors
2 Error: empty input file
3 Error: cannot open file
4 Internal error: matrix empty

5.4.10 ComGenrelinc
Overview

GetCurrentIteration
GetMaxNumIterations

GetCurrentIteration
The command returns the current iteration number of the ’Run Generation Adequacy’ command
(ComGenrel).
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 251


Chapter 5. Object Methods

R ETURNS
Returns the current iteration number.

GetMaxNumIterations
The command returns the maximume number of iterations specified in the ’Run Generation
Adequacy’ command (ComGenrel).
int [Link]()

R ETURNS
Returns the maximum number of iterations.

5.4.11 ComGridtocim
Overview

ConvertAndExport
ConvertAndExport
SetAuthorityUri
SetBoundaries
SetGridsToExport

ConvertAndExport
Convert Grid to CIM and export CIM data to given file path without storing into database.
int [Link](str filePath,
int withValidation
)

A RGUMENTS
filePath File path for CIM data.
withValidation 0 Do not validate CIM-archive.
1 Validate CIM-archive.

ConvertAndExport
Convert Grid to CIM and export CIM data without storing into database.
int [Link](int withValidation
)

A RGUMENTS
withValidation 0 Do not validate CIM-archive.
1 Validate CIM-archive.

DIgSILENT PowerFactory 2018, Python Function Reference 252


Chapter 5. Object Methods

SetAuthorityUri
Sets the authority uri for a specific grid.
None [Link](DataObject grid,
str uri
)

A RGUMENTS
grid Grid to set the URI for.
uri Model authority URI to be set.

SetBoundaries
Sets the grids as ”Boundary Grid” and clears any previous setting.
None [Link](list grids)

A RGUMENTS
grids The grids to be considered as boundaries.

SetGridsToExport
Sets the grids as ”Selected” and clears any previous setting.
None [Link](list grids)

A RGUMENTS
grids The grids to be selected.

5.4.12 ComImport
Overview

GetCreatedObjects
GetModifiedObjects

GetCreatedObjects
Returns the newly created objects after execution of a DGS import.
list [Link]()

R ETURNS
Collection of objects that have been created during DGS import.

GetModifiedObjects
Returns the modified objects after execution of a DGS import.

DIgSILENT PowerFactory 2018, Python Function Reference 253


Chapter 5. Object Methods

list [Link]()

R ETURNS
Collection of objects that have been modified during DGS import.

5.4.13 ComInc
Overview

ZeroDerivative

ZeroDerivative
This function returns 1 if the state variable derivatives are less than the tolerance for the initial
conditions, provided that the Simulation method is set to RMS values and the Verify initial
conditions option is selected in the Calculation of initial conditions command. The tolerance
is defined on the Solver options page in the Maximum error for dynamic model equations field.
The function returns 0 if the aforementioned conditions are not met, or if at least one state
variable has a derivative larger than the tolerance.
int [Link]()

R ETURNS
0 At least one state variable has a derivative larger than the tolerance, or the re-
quired command options have not been set.
1 All state variable derivatives are less than the tolerance.

5.4.14 ComLdf
Overview

CalcLdf
CalcParams
CheckControllers
DoNotResetCalc
EstimateLoading
EstimateOutage
Execute
IsAC
IsBalanced
IsDC
PrintCheckResults
SetOldDistributeLoadMode

DIgSILENT PowerFactory 2018, Python Function Reference 254


Chapter 5. Object Methods

CalcLdf
Perform a load flow analysis with new topology rebuild, but without initialisation of calculation
parameters.
int [Link]()

R ETURNS
0 On success.
1 On error.

CalcParams
Initialise calculation parameters for all models.
int [Link]()

R ETURNS
Always return 1.

CheckControllers
Check the conditions of all controllers based on available load flow results. The report will be
printed out in output window.
int [Link]()

R ETURNS
Always return 1.

DoNotResetCalc
The load flow results will not be reset even the load flow calculation fails.
int [Link](int doNotReset)

A RGUMENTS
doNotReset
Specifies whether the results shall be reset or not.
0 Reset load flow results if load flow fails.
1 Load flow results will remain even load flow fails.

R ETURNS
Always return 0.

EstimateLoading
Estimate the loading of all branch elements if the power injections of given set of terminals
are changed. The changed power for each terminal is stored in dpl1 (active power) and dpl2
(reactive power).

DIgSILENT PowerFactory 2018, Python Function Reference 255


Chapter 5. Object Methods

int [Link](list nodes,


int init
)

A RGUMENTS
nodes The terminals whose power injections are changed.
init Initialisation of sensitivities.

0 No need to calculate sensitivities; it assumes that sensitivities have


been calculated before hand.
1 Sensitivities will be newly calculated.

R ETURNS
0 On success.
1 On error.

EstimateOutage
Estimate the loading of all branches with outages of given set of branch elements.
int [Link](list branches,
int init
)

A RGUMENTS
branches The branch elements to be in outage.
init Initialisation of sensitivities.
0 No need to calculate sensitivities; it assumes that sensitivities have
been calculated before hand.
1 Sensitivities will be newly calculated.

R ETURNS
0 On success.
1 On error.

Execute
Performs a load flow analysis on a network. Results are displayed in the single line graphic and
available in relevant elements.
int [Link]()

R ETURNS
0 OK
1 Load flow failed due to divergence of inner loops.
2 Load flow failed due to divergence of outer loops.

DIgSILENT PowerFactory 2018, Python Function Reference 256


Chapter 5. Object Methods

IsAC
Check whether this load flow is configured as AC method or not.
int [Link]()

R ETURNS
0 Is a DC method.
1 Is an AC method.

IsBalanced
Check whether this load flow command is configured as balanced or unbalanced.
int [Link]()

R ETURNS
Returns true if the load flow is balanced.

IsDC
Check whether this load flow is configured as DC method or not.
int [Link]()

R ETURNS
0 Is an AC method.
1 Is a DC method.

PrintCheckResults
Shows the verification report in the output window.
int [Link]()

R ETURNS
Always return 1.

SetOldDistributeLoadMode
Set the old scaling mode in case of Distributed Slack by loads.
None [Link](int iOldMode)

A RGUMENTS
iOldMode The flag showing if the old model is used.
0 Use standard mode.
1 Use old mode.

DIgSILENT PowerFactory 2018, Python Function Reference 257


Chapter 5. Object Methods

5.4.15 ComLink
Overview

LoadMicroSCADAFile
ReceiveData
SendData
SentDataStatus
SetOPCReceiveQuality
SetSwitchShcEventMode

LoadMicroSCADAFile
Reads in a MicroSCADA snapshot file.
int [Link](str filename,
[int populate]
)

A RGUMENTS
filename name of the file to read
populate (optional)
determines whether new values should be populated to the network elements
(0=no, 1=yes)

R ETURNS
0 On success.
1 On error.

ReceiveData
Reads and processes values for all (in PowerFactory configured) items from OPC server (OPC
only).
int [Link]([int force])

A RGUMENTS
force (optional)
0 (default) Processes changed values (asynchronously) received by Pow-
erFactory via callback
1 Forces (synchronous) reading and processing of all values (independet
of value changes)

R ETURNS
Number of read items

SendData
Sends values from configured measurement objects to OPC server (OPC only).
int [Link]([int force])

DIgSILENT PowerFactory 2018, Python Function Reference 258


Chapter 5. Object Methods

A RGUMENTS
force (optional)
0 (default) Send only data that have been changed and difference be-
tween old and new value is greater than configured deadband
1 Forces writing of all values (independet of previous value)

R ETURNS
Number of written items

SentDataStatus
Outputs status of all items marked for sending to output window.
int [Link]()

R ETURNS
Number of items configured for sending.

SetOPCReceiveQuality
Allows to override the actual OPC receive quality by this value. (Can be used for testing.)
int [Link](int quality)

A RGUMENTS
quality new receive quality (bitmask)

R ETURNS
0 On success.
1 On error.

SetSwitchShcEventMode
Configures whether value changes for switches are directly transferred to the object itself of
whether shc switch events shall be created instead.
None [Link](int enabled)

A RGUMENTS
enabled
0 Values are directly written to switches
1 For each value change a switch event will be created

DIgSILENT PowerFactory 2018, Python Function Reference 259


Chapter 5. Object Methods

5.4.16 ComMerge
Overview

CheckAssignments
Compare
CompareActive
ExecuteRecording
ExecuteWithActiveProject
GetCorrespondingObject
GetModification
GetModificationResult
GetModifiedObjects
Merge
PrintComparisonReport
PrintModifications
Reset
SetAutoAssignmentForAll
SetObjectsToCompare
ShowBrowser
WereModificationsFound

CheckAssignments
Checks if all assignments are correct and merge can be done.
int [Link]()

R ETURNS
0 On success.
1 Canceled by user.
2 Missing assignments found.
3 Conflicts found.
4 On other errors.

Compare
Starts a comparison according to the settings in this ComMerge object. The merge browser is
not shown.
int [Link]()

CompareActive
Starts a comparison according to the settings in this ComMerge object. The merge browser is
not shown. Can compare with the active project.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 260


Chapter 5. Object Methods

ExecuteRecording
Starts a comparison according to the settings in this ComMerge object and shows the merge
browser. Records modifications in the active scenario and/or expansion stage of the target
project.
int [Link]()

ExecuteWithActiveProject
Starts a comparison according to the settings in this ComMerge object and shows the merge
browser. Can compare with the active project.
None [Link]()

GetCorrespondingObject
Searches corresponding object for given object.
DataObject [Link](DataObject sourceObj,
[int target]
)

A RGUMENTS
sourceObj
Object for which corresponding object is searched.

target
0 Get corresponding object from “Base” (default)
1 Get corresponding object from “1st”
2 Get corresponding object from “2nd”

R ETURNS
object Corresponding object.
None Corresponding object not found.

GetModification
Gets kind of modification between corresponding objects of “Base” and “1st” or “2nd”.
int [Link](DataObject sourceObj,
[int taget]
)

A RGUMENTS
sourceObj
Object from any source for which modification is searched.
target
1 Get modification from “Base” to “1st” (default)
2 Get modification from “Base” to “2nd”

DIgSILENT PowerFactory 2018, Python Function Reference 261


Chapter 5. Object Methods

R ETURNS
0 On error.
1 No modifications (equal).
2 Modified.
3 Added in “1st”/“2nd”.
4 Removed in “1st”/“2nd”.

GetModificationResult
Gets kind of modifications between compared objects in “1st” and “2nd”.
int [Link](DataObject obj)

A RGUMENTS
obj Object from any source for which modification is searched.

R ETURNS
0 On error.
1 No modifications (equal).
2 Same modifications in “1st” and “2nd” (no conflict).
3 Different modifications in “1st” and “2nd” (conflict).

GetModifiedObjects
Gets all objects with a certain kind of modification.
list [Link](int modType,
[int modSource]
)

A RGUMENTS
modType
1 get unmodified objects
2 get modified objects
3 get added objects
4 get removed obejcts
modSource
1 consider modification between “Base” and “1st” (default)
2 consider modification between “Base” and “2nd”

R ETURNS
Set with matching objects.
Unmodified, modified and added objects are always from given “modSource”, removed ob-
jects are always from “Base” .

DIgSILENT PowerFactory 2018, Python Function Reference 262


Chapter 5. Object Methods

Merge
Checks assignments, merges modifications according to assignments into target and prints
merge report to output window.
None [Link](int printReport)

A RGUMENTS
printReport
1 print merge report (default)
0 do not print merge report
always set to 0 in paste and split mode

PrintComparisonReport
Prints the modifications of all compared objects as a report to the output window.
None [Link](int mode)

A RGUMENTS
mode
0 no report
1 only modified compare objects
2 all compare objects

PrintModifications
Prints modifications of given objects (if any) to the output window.
int [Link](list objs)
int [Link](DataObject obj)

A RGUMENTS
objs Set of objects for which the modifications are printed.
obj Object for which the modifications are printed.

R ETURNS
0 On error: object(s) not found in comparison.
1 On success: modifications were printed.

Reset
Resets/clears and deletes all temp. object sets, created internally for the comparison.
None [Link]()

SetAutoAssignmentForAll
Sets the assignment of all compared objects automatically.
None [Link](int conflictVal)

DIgSILENT PowerFactory 2018, Python Function Reference 263


Chapter 5. Object Methods

A RGUMENTS
conflictVal
Assignment of compared objects with undefined automatic values (e.g. conflicts)
0 no assignment
1 assign from “Base”
2 assign from 1st
3 assign from 2nd

SetObjectsToCompare
Sets top level objects for comparison.
None [Link](DataObject base,
[DataObject first,]
[DataObject second]
)

A RGUMENTS
base Top level object to be set as “Base”

first Top level object to be set as “1st”


second Top level object to be set as “2nd”

ShowBrowser
Shows merge browser with initialized settings and all compared objects. Can only be called
after a comparison was executed.
int [Link]()

R ETURNS
0 The browser was left with ok button.
1 The browser was left with cancel button.
2 On error.

WereModificationsFound
Checks, if modifications were found in comparison.
int [Link]()

R ETURNS
0 All objects in comparison are equal.
1 Modifications found in comparison.

DIgSILENT PowerFactory 2018, Python Function Reference 264


Chapter 5. Object Methods

5.4.17 ComMot
Overview

GetMotorConnections
GetMotorSwitch
GetMotorTerminal

GetMotorConnections
Finds the cables connecting the motor to the switch.
list [Link](DataObject motor)

A RGUMENTS
motor The motor element

R ETURNS
Returns the set of cables connecting the motor to the switch.

GetMotorSwitch
Finds the switch which will connect the motor to the network.
DataObject [Link](DataObject motor)

A RGUMENTS
motor The motor element

R ETURNS
Returns the switch element.

GetMotorTerminal
Finds the terminal to which the motor will be connected.
DataObject [Link](DataObject motor)

A RGUMENTS
motor The motor element

R ETURNS
Returns the terminal element.

5.4.18 ComNmink
Overview

AddRef
Clear
GetAll
DIgSILENT PowerFactory 2018, Python Function Reference 265
Chapter 5. Object Methods

AddRef
Adds shortcuts to the objects to the existing selection.
None [Link](DataObject O)
None [Link](list S)

A RGUMENTS
O(optional)
an object
S(optional)
a Set of objects

Clear
Delete all contents, i.e. to empty the selection.
None [Link]()

GetAll
Returns all objects which are of the class 'ClassName'.
list [Link](str className)

A RGUMENTS
className
The object class name.

R ETURNS
The set of objects

5.4.19 ComOmr
Overview

GetFeeders
GetOMR
GetRegionCount

GetFeeders
Get all feeders for which optimal manual switches have been determined. This function can be
used after execution of an Optimal Manual Restoration command only.
list [Link]()

R ETURNS
The set of all feeders used for optimisation.

DIgSILENT PowerFactory 2018, Python Function Reference 266


Chapter 5. Object Methods

GetOMR
Get terminal and connected optimal manual switches determined by the optimisation for the
given feeder and its region(pocket) of the given index. For a detailed description of a pocket,
please consult the manual. This function can be used after execution of an Optimal Manual
Restoration command only.
list [Link](DataObject arg0,
int arg1
)

A RGUMENTS
arg0 The feeder to derive the resulting optimal terminal with its connected (optimal)
manual switches for.
arg1 The index of the region(pocket) inside the given feeder to derive the resulting
optimal terminal with its connected (optimal) manual switches for.

R ETURNS
The resulting optimal terminal with its connected (optimal) manual switches for the region in
the feeder.

GetRegionCount
Get total number of regions(pockets) separated by infeeding point, feeder ends and certain
switches for the provided feeder. For a detailed description of a pocket, please consult the
manual. This function can be used after execution of an Optimal Manual Restoration command
only.
int [Link](DataObject feeder)

A RGUMENTS
feeder Feeder to derive number of regions(pockets) for.

R ETURNS
Number of regions(pockets) for the feeder.

5.4.20 ComOpc
Overview

ReceiveData
SendData

ReceiveData
Reads and processes values for all (in PowerFactory configured) items from OPC server (OPC
only).
int [Link]([int force])

A RGUMENTS
force (optional)

DIgSILENT PowerFactory 2018, Python Function Reference 267


Chapter 5. Object Methods

1 Forces (synchronous) reading and processing of all values (independet


of value changes)

R ETURNS
1 if successfully received data -1 if an error occured -2 if the link is not connected

SendData
Sends values from configured measurement objects to OPC server (OPC only).
int [Link]([int force])

A RGUMENTS
force (optional)
0 (default) Send only data that have been changed and difference be-
tween old and new value is greater than configured deadband
1 Forces writing of all values (independet of previous value)

R ETURNS
1 if successfully received data -1 if an error occured -2 if the link is not connected

5.4.21 ComOutage
Overview

ContinueTrace
ExecuteTime
GetObject
RemoveEvents
SetObjs
StartTrace
StopTrace

ContinueTrace
Continue the next step of the trace.
int [Link]()

R ETURNS
0 On success.
6 0
= On error.

ExecuteTime
Execute contingency (with multiple time phase) for the given time.
int [Link](float time)

A RGUMENTS
time the given time to be executed.

DIgSILENT PowerFactory 2018, Python Function Reference 268


Chapter 5. Object Methods

R ETURNS
=0 On success.
6= 0 On error.

GetObject
Get the element stored in line number “line” in the table of ComOutage. The line index starts
with 0.
DataObject [Link](int line)

A RGUMENTS
line line index, if index exceeds the range None is returned

R ETURNS
the element of line “line” in the table.

RemoveEvents
Remove all events defined in this contingency.
None [Link] ([int info])
None [Link] (str type)
None [Link] (int info, str type)
None [Link] (str type, int info)

A RGUMENTS
type
none Hidden objects are ignored and not added to the set
'Lod' remove all EvtLod
'Gen' remove all EvtGen
'Switch' remove all EvtSwitch

info(optional)
1 show info message in output window (default)
0 do not show info message

SetObjs
To fill up the ”interrupted components” with given elements.
Sets the list of objects according to S.
int [Link](list S)

A RGUMENTS
S the set of objects

DIgSILENT PowerFactory 2018, Python Function Reference 269


Chapter 5. Object Methods

R ETURNS
0 On success.
1 On error.

StartTrace
Start trace all post fault events of this contingency.
int [Link]()

R ETURNS
=0 On success.
6= 0 On error.

StopTrace
To stop the trace.
int [Link]([int msg])

A RGUMENTS
msg (optional)
Emit messages or not.
0 Suppress messages.
1 Emit messages.

R ETURNS
=0 On success.
6= 0 On error.

5.4.22 ComPython
Overview

GetExternalObject
GetInputParameterDouble
GetInputParameterInt
GetInputParameterString
SetExternalObject
SetInputParameterDouble
SetInputParameterInt
SetInputParameterString

GetExternalObject
Gets the external object defined in the ComPython edit dialog.
[int error,
DataObject value] [Link](str name)

DIgSILENT PowerFactory 2018, Python Function Reference 270


Chapter 5. Object Methods

A RGUMENTS
name Name of the external object parameter.
value (out)
The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

GetInputParameterDouble
Gets the double input parameter value defined in the ComPython edit dialog.
[int error,
float value] [Link](str name)

A RGUMENTS
name Name of the double input parameter.
value (out)
Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

GetInputParameterInt
Gets the integer input parameter value defined in the ComPython edit dialog.
[int error,
int value ] [Link](str name)

A RGUMENTS
name Name of the integer input parameter.
value (out)
Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

DIgSILENT PowerFactory 2018, Python Function Reference 271


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

GetInputParameterString
Gets the string input parameter value defined in the ComPython edit dialog.
[int error,
str value ] [Link](str name)

A RGUMENTS
name Name of the string input parameter.
value (out)
Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

SetExternalObject
Sets the external object defined in the ComPython edit dialog.
int [Link](str name,
DataObject value
)

A RGUMENTS
name Name of the external object parameter.
value The external object.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

SetInputParameterDouble
Sets the double input parameter value defined in the ComPython edit dialog.
int [Link](str name,
double value
)

DIgSILENT PowerFactory 2018, Python Function Reference 272


Chapter 5. Object Methods

A RGUMENTS
name Name of the double input parameter.
value Value of the double input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

SetInputParameterInt
Sets the integer input parameter value defined in the ComPython edit dialog.
int [Link](str name,
int value
)

A RGUMENTS
name Name of the integer input parameter.
value Value of the integer input parameter.

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

SetInputParameterString
Sets the string input parameter value defined in the ComPython edit dialog.
int [Link](str name,
str value
)

A RGUMENTS
name Name of the string input parameter.
value Value of the string input parameter.

R ETURNS
0 On success.
1 On error.

DIgSILENT PowerFactory 2018, Python Function Reference 273


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link](),
[Link](), [Link]()

5.4.23 ComRel3
Overview

AnalyseElmRes
ExeEvt
OvlAlleviate
RemoveEvents
RemoveOutages
ValidateConstraints

AnalyseElmRes
Evaluate the results object created by the last calculation. Performs exactly the same as press-
ing the button 'Perform Evaluation of Result File' in the dialogue box of the command.
int [Link]([int error])

A RGUMENTS
error (optional)
0 do not display an error message (default)
1 display error messages in case of errors

R ETURNS
=0 On success.
6= 0 On error.

ExeEvt
Executes a given event.
None [Link]([DataObject event])

A RGUMENTS
event The event that shall be executed.

OvlAlleviate
Performs an overload alleviation for given events.
int [Link]([list preCalcEvents])

A RGUMENTS
preCalcEvents (optional)
The events which will be executed before the calculation.

DIgSILENT PowerFactory 2018, Python Function Reference 274


Chapter 5. Object Methods

R ETURNS
0 On success.
1 Failure in load flow.
2 No overloading detected.
>2 On error.

RemoveEvents
Removes all events stored in all contingencies (*.ComContingency) inside the reliability com-
mand.
None [Link]()

RemoveOutages
Removes all contingency definitions (*.ComContingencies) stored inside the reliability com-
mand.
None [Link]([int msg])

A RGUMENTS
msg( optional)
1 Show info message in output window (default value).
0 Do not emit messages.

ValidateConstraints
Checks if the restoration of a contingency violates any constraint according to the current set-
tings of the reliability calculation. These do not necessarily have to be the settings used during
calculation. Of course the selected calculation method of ComRel3 has to be ’Load flow analy-
sis’ to check for constraint violations.
int [Link](DataObject contingency)

A RGUMENTS
contingency
The contingency which will be checked for constraint violations.

R ETURNS
0 No constraint violations, or all constraint violations could be solved.
1 Constraints are violated.
−1 Contingency not valid.

DIgSILENT PowerFactory 2018, Python Function Reference 275


Chapter 5. Object Methods

5.4.24 ComRelpost
Overview

CalcContributions
GetContributionOfComponent

CalcContributions
Calculates the contributions to load interruptions of the loads that are passed to this function.
The loads can be e.g. inside a feeder or a zone as well. If nothing is passed as input all loads
will be analysed.
int [Link]([list elements])

A RGUMENTS
elements (optional)
Elements (Loads) for which the contributions shall be calculated (default: all loads,
if no argument is passed).

R ETURNS
0 Calculation successful.
1 On error.

GetContributionOfComponent
Gets the contributions of a component to a certain reliability indice.
float [Link](int componentNr,
str indice)

A RGUMENTS
componentNr 1. Lines
2. Cables
3. Transformers
4. Busbars
5. Generators
6. Common Modes
7. Double Earth Faults
indice Avalaible indices are: ’SAIFI’, ’SAIDI’, ’ASIFI’, ’ASIDI’, ’ENS’, ’EIC’

R ETURNS
The contribution of this component to this reliability indice.

5.4.25 ComRelreport
Overview

GetContingencies
GetContributionOfComponent
DIgSILENT PowerFactory 2018, Python Function Reference 276
Chapter 5. Object Methods

GetContingencies
Gets all contingencies of reliability for reporting.
list [Link]()

R ETURNS
All contingencies of reliability for reporting.

GetContributionOfComponent
Is described in [Link]().
float [Link](int componentNr,
str indice)

5.4.26 ComRes
Overview

ExportFullRange
FileNmResNm

ExportFullRange
Executes the export command for the whole data range.
None [Link]()

FileNmResNm
Sets the filename for the data export to the name of the result object being exported (classes:
ElmRes, IntComtrade)
None [Link]()

5.4.27 ComShc
Overview

ExecuteRXSweep
GetFaultType
GetOverLoadedBranches
GetOverLoadedBuses

ExecuteRXSweep
Calculates RX Sweep. If no impedance passed, the value from the command shall be used. If
argument passed then the impedance changes are stored to the command (Rf, Xf).
int [Link]()
int [Link](float Zr,
float Zi

DIgSILENT PowerFactory 2018, Python Function Reference 277


Chapter 5. Object Methods

A RGUMENTS
Zr Impedance real part
Zi Impedance imaginary part

R ETURNS
=0 On success.
6= 0 On error.

GetFaultType
Returns the short-circuit fault type.
int [Link]()

R ETURNS
0 three phase fault
1 single phase to ground
2 two phase fault
3 two phase to ground fault
4 three phase unbalanced fault
5 single phase to neutral fault
6 single phase, neutral to ground fault
7 two phase to neutral fault
8 two phase, neutral to ground fault
9 three phase to neutral fault
10 three phase, neutral to ground fault
20 DC fault

GetOverLoadedBranches
Get overloaded branches after a short-circuit calculation.
[int error,
list branches] [Link](float ip,
float ith)

A RGUMENTS
ip Max. peak-current loading, in %
ith Max. thermal loading, in %
branches (out)
Set of branches which are checked

R ETURNS
=0 On error or 0 branches found.
6= 0 Number of branches.

DIgSILENT PowerFactory 2018, Python Function Reference 278


Chapter 5. Object Methods

E XAMPLE

GetOverLoadedBuses
Get overloaded buses after a short-circuit calculation.
[int error,
list buses] [Link](float ip,
float ith)

A RGUMENTS
ip Max. peak-current loading, in %

ith Max. thermal loading, in %


buses (optional, out)
Set of buses which are checked

R ETURNS
=0 On error or 0 buses found.
6= 0 Number of buses.

E XAMPLE

5.4.28 ComShctrace
Overview

BlockSwitch
ExecuteAllSteps
ExecuteInitialStep
ExecuteNextStep
GetBlockedSwitches
GetCurrentTimeStep
GetDeviceSwitches
GetDeviceTime
GetNonStartedDevices
GetStartedDevices
GetSwitchTime
GetTrippedDevices
NextStepAvailable

BlockSwitch
Blocks a switch from operating for the remainder of the trace.
int [Link](DataObject switchDevice)

A RGUMENTS
switchDevice
Switch device to block.

DIgSILENT PowerFactory 2018, Python Function Reference 279


Chapter 5. Object Methods

R ETURNS
0 Switch can not be blocked (e.g. because it already operated).
1 Switch is blocked.

ExecuteAllSteps
Executes all steps of the short circuit trace. This function requires the trace to be already
running
int [Link]()

R ETURNS
0 No error occourred, trace is complete.
!=0 An error occurred, calculation was reset.

S EE ALSO

[Link]()

ExecuteInitialStep
Executes the first step of the short circuit trace.
int [Link]()

R ETURNS
0 No error occourred, the short-circuit trace is now running.
!=0 An error occurred, calculation was reset.

ExecuteNextStep
Executes the next step of the short circuit trace. This function requires the trace to be already
running
int [Link]()

R ETURNS
0 No error occourred, step was executed .
!=0 An error occurred, calculation was reset.

S EE ALSO

[Link]()

GetBlockedSwitches
Returns all switches which are currently blocked.
list [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 280


Chapter 5. Object Methods

R ETURNS
All blocked switches.

GetCurrentTimeStep
Returns the current time step of the trace in seconds.
float [Link]()

R ETURNS
The current time step in [s].

GetDeviceSwitches
Returns all switches operated by a protection device.
list [Link](DataObject device)

A RGUMENTS
device Protection device to get the switches for.

R ETURNS
All switches devices operated by the protection device.

GetDeviceTime
Returns the time a protection device operated or will operate at.
float [Link](DataObject device)

A RGUMENTS
device Protection device to get the time for.

R ETURNS
The tripping time of the device itself, if the device already tripped, or the prospective tripping
time.

GetNonStartedDevices
Returns all protection devices which are not started.
list [Link]()

R ETURNS
All protection devices which are not started.

GetStartedDevices
Returns all started but not yet tripped protection devices.
list [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 281


Chapter 5. Object Methods

R ETURNS
All started but not yet tripped protection devices.

GetSwitchTime
Returns the time a switch device operated or will operate at.
float [Link](DataObject device,
DataObject switchDevice
)

A RGUMENTS
device Reference protection device for the switch.

device Switch device to get the time for.

R ETURNS
The tripping time of the switch device, based on the tripping time of the reference protection
device. If the switch already operated, the time of operation will be returned.

GetTrippedDevices
Returns all protection devices already tripped.
list [Link]()

R ETURNS
All protection devices already tripped.

NextStepAvailable
Indicates whether or not a next time step can be executed.
int [Link]()

R ETURNS
0 Next step is not available, the trace is completed.
1 A next step is available.

5.4.29 ComSim
Overview

GetSimulationTime
GetTotalWarnA
GetTotalWarnB
GetTotalWarnC
GetViolatedScanModules
LoadSnapshot
SaveSnapshot

DIgSILENT PowerFactory 2018, Python Function Reference 282


Chapter 5. Object Methods

GetSimulationTime
Get the actual simulation time.
double [Link]()

R ETURNS
The simulation time in seconds.

GetTotalWarnA
Returns the total number of type-A (serious) warnings related to the time-domain simulation.
int [Link]()

R ETURNS
Returns the total number of type-A (serious) warnings.

GetTotalWarnB
Returns the total number of type-B (moderate) warnings related to the time-domain simulation.
int [Link]()

R ETURNS
Returns the total number of type-B (moderate) warnings.

GetTotalWarnC
Returns the total number of type-C (minor) warnings related to the time-domain simulation.
int [Link]()

R ETURNS
Returns the total number of type-C (minor) warnings.

GetViolatedScanModules
Returns a set of scan modules of which each have at least one violation.
list [Link]()

R ETURNS
Returns a set of scan modules of which each have at least one violation.

LoadSnapshot
Load the state of a dynamic simulation from a file.
int [Link]([string snapshotFilePath], [int suppressUserMessage])

DIgSILENT PowerFactory 2018, Python Function Reference 283


Chapter 5. Object Methods

D EPRECATED N AMES
LoadSimulationState

A RGUMENTS
snapshotFilePath (optional)
The snapshot file to load. If no file is specified, the last snapshot stored in the
memory is used. (default = ”)

suppressUserMessage (optional)
The pop-up window asking for data overwrite is not displayed if this value is set to
1. (default = 0)

R ETURNS
0 Saved simulation state has been loaded.
1 Saved simulation state cannot be loaded.
2 Saved simulation state does not match actual model. Calculation will be reset.

SaveSnapshot
Save the state of a dynamic simulation to memory and to a file.
int [Link](string snapshotFilePath, [int suppressUserMessage])

D EPRECATED N AMES
SaveSimulationState

A RGUMENTS
snapshotFilePath (optional)
The snapshot file to save. If no file is specified, the last snapshot is saved in the
non-persistent memory slot. (default = ”)
suppressUserMessage (optional)
The pop-up window asking for file overwriting is not displayed if this value is set to
1. (default = 0)

R ETURNS
0 OK
1 Error

5.4.30 ComSimoutage
Overview

AddCntcy
AddContingencies
ClearCont
CreateFaultCase
Execute
ExecuteCntcy
GetNTopLoadedElms
MarkRegions

DIgSILENT PowerFactory 2018, Python Function Reference 284


Chapter 5. Object Methods

RemoveContingencies
Reset
SetLimits
Update

AddCntcy
Executes an (additional) ComOutage, without resetting results. The results of the outage anal-
ysis will be added to the intermediate results. Object “O” must be a ComOutage object. If
the outage definition has already been analyzed, it will be ignored. The ComOutage will be
renamed to “name” when “name” is given.
int [Link](DataObject O,
[str name]
)

A RGUMENTS
O The ComOutage object

name A name for the outage

R ETURNS
0 On success.
1 On error.

AddContingencies
Adds contingencies for fault cases/groups selected by the user to the command. Shows a modal
window with the list of available fault cases and groups. Functionality as “Add Cases/Groups”
button in dialog.
None [Link]()

ClearCont
Reset existing contingency analysis results and delete existing contingency cases.
int [Link]()

R ETURNS
0 On success.
1 On error.

CreateFaultCase
Create fault cases from the given elements.
int [Link](list elms,
int mode,
[int createEvt],
[object folder]
)

DIgSILENT PowerFactory 2018, Python Function Reference 285


Chapter 5. Object Methods

A RGUMENTS
elms Selected elements to create fault cases.
mode How the fault cases are created:
0 Single fault case containing all elements.
1 n-1 (multiple cases).
2 n-2 (multiple cases).
3 Collecting coupling elemnts and create fault cases for line couplings.
createEvt (optional)
Switch event:
0 Do NOT create switch events.
1 Create switch events.
folder (optional)
Folder in which the fault case is stored.

R ETURNS
0 On success.
1 On error.

Execute
Execute contingency analysis.
int [Link]()

R ETURNS
0 On success.
1 On error.

ExecuteCntcy
Execute additional contingency analysis without resetting results.
int [Link]()

R ETURNS
0 On success.
1 On error.

GetNTopLoadedElms
To get certain number of top loaded components (most close to its limit).
list [Link](int number)

DIgSILENT PowerFactory 2018, Python Function Reference 286


Chapter 5. Object Methods

A RGUMENTS
number The number of elements to be found.
elements (out)
The top loaded elements.

MarkRegions
To execute Region marker for certain system status (like prefault, post fault etc.), which will
indentifies energizing mode for each element.
int [Link](int stage)

A RGUMENTS
stage which system stage to be analyzed, 0¡=stage¡=2

R ETURNS
0 On success.
1 On error.

RemoveContingencies
Removes all contingencies from the command. Functionality as ”Remove All” button in dialog.
None [Link]()

Reset
Resets the intermediate results of the outage simulation.
int [Link]()

R ETURNS
0 On success.
1 On error.

SetLimits
Sets the limits for the outage simulation.
int [Link](float vlmin,
float vlmax,
float ldmax)

A RGUMENTS
vlmin The minimum voltage
vlmax The maximum voltage
ldmax The maximum loading

DIgSILENT PowerFactory 2018, Python Function Reference 287


Chapter 5. Object Methods

Update
To update contingency cases via topology search. It will find interrupted elements, required
switch actions for each contingency.
int [Link]()

R ETURNS
0 On success.
1 On error.

5.4.31 ComSvgexport
Overview

SetFileName
SetObject
SetObjects

SetFileName
Sets SVG file for export.
None [Link](str path)

A RGUMENTS
path Path of target SVG file

SetObject
Sets annotation layer or group for export.
None [Link](DataObject obj)

A RGUMENTS
obj Annotation layer (IntGrflayer) or group (IntGrfgroup) to be exported

SetObjects
Sets annotation layers and groups for export.
None [Link](set objs)

A RGUMENTS
objs Set of annotation layers (IntGrflayer) and/or groups (IntGrfgroup) to be exported

DIgSILENT PowerFactory 2018, Python Function Reference 288


Chapter 5. Object Methods

5.4.32 ComSvgimport
Overview

SetFileName
SetObject

SetFileName
Sets source SVG file for import.
None [Link](str path);

A RGUMENTS
path Path of SVG file to be imported

SetObject
Sets target annotation layer or group for import.
None [Link](DataObject obj);

A RGUMENTS
obj Target annotation layer (IntGrflayer) or group (IntGrfgroup)

5.4.33 ComTasks
Overview

AppendCommand
AppendStudyCase
RemoveCmdsForStudyCaseRow
RemoveStudyCases
SetResultsFolder

AppendCommand
Appends a command for calculation.
int [Link](DataObject command,
[int studyCaseRow]
)

R ETURNS
0 Command could not be added for calculation.
1 Command has been successfully added for calculation.

A RGUMENTS
command
Command to add for calculation.
studyCaseRow

DIgSILENT PowerFactory 2018, Python Function Reference 289


Chapter 5. Object Methods

<= 0 Command is added to the list of commands for its study case.
>0 Optionally, the row in the study case table containing the study case
for which this command shall be added can be passed. This is helpful,
e.g., if a study case has been added multiple times for calculation with
different command lists.

AppendStudyCase
Appends a study case to the list of study cases for calculation.
int [Link](DataObject studyCase)

R ETURNS
0 Study case could not be added for calculation.
1 Study case has been successfully added for calculation.

A RGUMENTS
studyCase
Study case to add for calculation.

RemoveCmdsForStudyCaseRow
Removes all commands selected for calculation for a given row in the study case table.
int [Link](int studyCaseRow)

R ETURNS
0 Commands could not be removed from calculation.
1 All commands of study case row were successfully removed from calculation.

A RGUMENTS
studyCaseRow
The row in the study case table containing the study case for which all commands
shall be removed.

RemoveStudyCases
Removes all selected study cases from calculation.
None [Link]()

SetResultsFolder
Set a folder to store results for a given row in the study case table.
int [Link](DataObject folder, int studyCaseRow)

DIgSILENT PowerFactory 2018, Python Function Reference 290


Chapter 5. Object Methods

R ETURNS
0 New folder could not be set as results folder for the given row in the study case
table.
1 Folder was successfully set as resuls folder for given row in the study case table.

A RGUMENTS
folder The new folder to store results in.

studyCaseRow
The row in the study case table containing the study case for which results folder
shall be set.

5.4.34 ComTececo
Overview

UpdateTablesByCalcPeriod

UpdateTablesByCalcPeriod
Update all calculation points with respect to a new start- and end year
int [Link](float start,
float end
)

A RGUMENTS
start Start year of the study period
end End year of the study period

R ETURNS
0 Calculation points have been successfully set.
1 Invalid input data: end year of study period must be greater or equal to start year.

5.4.35 ComTransfer
Overview

GetTransferCalcData
IsLastIterationFeasible

DIgSILENT PowerFactory 2018, Python Function Reference 291


Chapter 5. Object Methods

GetTransferCalcData
The function returns the calculated transfer capacity and the total number of iteration after the
transfer capacity command has been executed.
[float transferCapacity,
int totalIterations ] [Link]()

A RGUMENTS
transferCapacity (out)
Transfer capacity value at the last feasible iteration.

totalIterations (out)
Total iteration number.

IsLastIterationFeasible
The function verifies if the last transfer calculation iteration resulted in the feasible solution or
not.
[Link]()

5.4.36 ComUcte
Overview

SetBatchMode

SetBatchMode
The batch mode allows to suppress all messages except error and warnings. This can be useful
when used in scripts where additional output might be confusing.
None [Link](int enabled)

A RGUMENTS
enabled
0 disables batch mode, all messages are printed to output window (de-
fault).
1 enables batch mode, only error and warning messages are printed to
output window.

5.4.37 ComUcteexp
Overview

BuildNodeNames
DeleteCompleteQuickAccess
ExportAndInitQuickAccess
GetConnectedBranches
GetFromToNodeNames

DIgSILENT PowerFactory 2018, Python Function Reference 292


Chapter 5. Object Methods

GetOrderCode
GetUcteNodeName
InitQuickAccess
QuickAccessAvailable
ResetQuickAccess
SetGridSelection

BuildNodeNames
Builds the node names as used in UCTE export and makes them accessible via :UcteNode-
Name attribute. The node names will only be available as long as topology has not been
changed. They must be re-build after any topology relevant modification.
Furthermore, the method fills the quick access cache given by the cache index for node names
and branch topologies as used in UCTE export. The quick access cache endures also topology
changes. The cache index is optional. If no cache index is given the default quick access cache
is used.
int [Link]([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

R ETURNS
0 On success.
1 0n error (e.g. load flow calculation failed).

DeleteCompleteQuickAccess
Deletes all quick access caches.
None [Link]()

ExportAndInitQuickAccess
Performs an UCTE export and fills the quick access cache given by the cache index.
None [Link](int cacheIndex)

A RGUMENTS
cacheIndex
Index of the quick access cache (must be greater than or equals to 0)

GetConnectedBranches
Determines the connected branches for the given terminal from the quick access cache given
by the optional cache index. If no cache index is given the default quick access cache is used.
list [Link](DataObject terminal
[int cacheIndex])

DIgSILENT PowerFactory 2018, Python Function Reference 293


Chapter 5. Object Methods

A RGUMENTS
terminal Terminal to determine the connected branches from
connectedBranches (out)
Connected branches for the given terminal
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

GetFromToNodeNames
Determines the UCTE node names of the branch ends from the quick access cache given by
the optional cache index. If no cache index is given the default quick access cache is used.
[str nodeNameFrom,
str nodeNameTo ] [Link](DataObject branch,
[int cacheIndex])

A RGUMENTS
branch Branch to find the UCTE node names from
nodeNameFrom (out)
UCTE node name of start node
nodeNameTo (out)
UCTE node name of end node
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

GetOrderCode
Determines the order code of the given branch element as used for UCTE export from the quick
access cache given by the optional cache index. If no cache index is given the default quick
access cache is used.
str [Link](DataObject branch,
[int cacheIndex])

A RGUMENTS
branch Branch element to get the UCTE order code from
orderCode (out)
Order code of the given branch element
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

GetUcteNodeName
Determines the node name of the given terminal as used for UCTE export from the quick access
cache given by the optional cache index. If no cache index is given the default quick access
cache is used.
str [Link](DataObject terminal,
[int cacheIndex])

DIgSILENT PowerFactory 2018, Python Function Reference 294


Chapter 5. Object Methods

A RGUMENTS
terminal Terminal to get the UCTE node name from
ucteNodeName (out)
UCTE node name of the given terminal
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

InitQuickAccess
Initializes the quick access cache given by the optional cache index. The quick acess cache
contains node names and branch topologies as used in UCTE export and endures topology
changes. InitQuickAccess() requires a successful executed UCTE export as pre-condition. The
cache index is optional. If no cache index is given the default quick access cache is used.
None [Link]([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

QuickAccessAvailable
Checks if the quick access cache given by the optional cache index is available. If no cache
index is given the default quick access cache is checked for availability.
None [Link]([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

ResetQuickAccess
Resets the given quick access cache for node names and branch topologies as used in UCTE
export. The cache index is optional. If no cache index is given the default quick access cache
is reset.
None [Link]([int cacheIndex])

A RGUMENTS
cacheIndex (optional)
Index of the quick access cache (must be greater than or equals to 0)

SetGridSelection
Configures the selected grids in the UCTE export command.
None [Link](list gridsToExport)

DIgSILENT PowerFactory 2018, Python Function Reference 295


Chapter 5. Object Methods

A RGUMENTS
gridsToExport
Grids (instances of class ElmNet) to be selected for export. All not contained grids
will be de-selected.

5.5 Settings

5.5.1 SetCluster
Overview

CalcCluster
GetNumberOfClusters

CalcCluster
Performs a load flow calculation for the cluster index passed to the function. To execute properly
this function requires that a valid load flow result is already calculated before calling it.
int [Link](int clusterIndex,
[int messageOn]
)

A RGUMENTS
clusterIndex
The cluster index. Zero based value, the first cluster has index 0.

messageOn (optional)
Possible values:
0 Do not emit a message in the output window.
1 Emit a message in the output window in case that the function does
not execute properly.

R ETURNS
0 On success.
1 There are no clusters, the number of clusters is 0.
2 The cluster index exceeds the number of clusters.
3 There is no load flow in memory before running CalcCluster.

GetNumberOfClusters
Get the number of clusters.
int [Link]()

R ETURNS
The number of clusters.

DIgSILENT PowerFactory 2018, Python Function Reference 296


Chapter 5. Object Methods

5.5.2 SetColscheme
Overview

CreateFilter
SetColouring
SetFilter

CreateFilter
Creates filter used to determine objects to be colored.
int [Link]([int pageNr])

A RGUMENTS
pageNr empty Create filter for currently valid calculation
set Dialog page number for which filter is created (see table below)

DIgSILENT PowerFactory 2018, Python Function Reference 297


Chapter 5. Object Methods

Table 5.5.3

Dialog Page Name ”pageNr” value


Basic Data 101
Load Flow 102
AC Load Flow Sensitivities 120
AC Contingency Analysis 121
AC Quasi-dynamic Simulation 137
DC Load Flow 122
DC Load Flow Sensitivities 123
DC Contingenciy Analysis 124
DC Quasi-dynamic Simulation 138
VDE/IEC Short-Circuit 103
Complete Short-Circuit 111
ANSI Short-Circuit 112
IEC 61363 114
DC Short-Circuit 117
RMS-Simulation 104
Modal Analysis 128
EMT-Simulation 105
Harmonics/Power Quality 106
Frequency Sweep 127
D-A-CH-CZ Connection Request 139
BDEW/VDE Connection Request 142
Optimal Power Flow 108
DC Optimal Power Flow 130
DC OPF with Contingencies 135
State Estimation 113
Reliability 109
General Adequacy 115
Tie Open Point Opt. 116
Motor Starting Calculation 133
Arc Flash Calculation 129
Optimal Capacitor Placement 126
Voltage Profile Optimisation 125
Backbone Calculation 131
Optimal RCS Placement 132
Optimal Manual Restoration 136
Phase Balance Optimisation 141
User defined calculation 142

R ETURNS
0 On success.
1 On error.

SetColouring
Sets colouring for given or currently valid calculation.
int [Link](str page,
int energizing,
[int alarm,]
[int normal]
)

DIgSILENT PowerFactory 2018, Python Function Reference 298


Chapter 5. Object Methods

A RGUMENTS
page
empty set for currentlx valid calculation
set page for which modes are set (see table below)

energizing
Colouring for Energizing Status
-2 enable (set to previously selected mode),
-1 do not change
0 disable
>0 set to this mode (see table below)
alarm Colouring for Alarm
-2 enable (set to previously selected mode),
-1 do not change (default)
0 disable
>0 set to this mode (see table below)
normal Other Colouring

-2 enable (set to previously selected mode),


-1 do not change (default)
0 disable
>0 set to this mode (see table below)

DIgSILENT PowerFactory 2018, Python Function Reference 299


Chapter 5. Object Methods

Table 5.5.4

Dialog Page Name ”page” value


Basic Data basic
Load Flow ldf
AC Load Flow Sensitivities acsens
AC Contingency Analysis accont
AC Quasi-dynamic Simulation acldfsweep
DC Load Flow dcldf
DC Load Flow Sensitivities dcsens
DC Contingenciy Analysis dccont
DC Quasi-dynamic Simulation dcldfsweep
VDE/IEC Short-Circuit shc
Complete Short-Circuit shcfull
ANSI Short-Circuit shcansi
IEC 61363 shc61363
DC Short-Circuit shcdc
RMS-Simulation rms
Modal Analysis modal
EMT-Simulation emt
Harmonics/Power Quality harm
Frequency Sweep fsweep
D-A-CH-CZ Connection Request dachcz
BDEW/VDE Connection Request bdewvde
Optimal Power Flow opf
DC Optimal Power Flow dcopf
DC OPF with Contingencies dccontopf
State Estimation est
Reliability rel
General Adequacy genrel
Tie Open Point Opt. topo
Motor Starting Calculation motstart
Arc Flash Calculation arcflash
Optimal Capacitor Placement optcapo
Voltage Profile Optimisation mvplan
Backbone Calculation backbone
Optimal RCS Placement optrcs
Optimal Manual Restoration omr
Phase Balance Optimisation balance
User defined calculation usercalc

Table 5.5.5

Energizing State Name ”energizing” value


De-energized 33
Out of Calculation 37
De-energised, Planned Outage 61

DIgSILENT PowerFactory 2018, Python Function Reference 300


Chapter 5. Object Methods

Table 5.5.6

Alarm Name ”alarm” value


Voltage Violations / Overloading 29
Outages 31
Overloading of Thermal / Peak Short Circuit Current 32
Feeder Radiality Check 38

DIgSILENT PowerFactory 2018, Python Function Reference 301


Chapter 5. Object Methods

Table 5.5.7

Other Colouring Name Group ”normal” value


Voltages / Loading Results 1
Voltage Levels Topology 2
Individual Individual 4
Connected Grid Components Topology 5
According to Filter User-defined see notes below table
Grids Groupings 7
Modifications in Variations / System Stages Variations / System Stages 8
Loading of Thermal / Peak Short-Circuit Current Results 9
Paths Groupings 10
System Type AC/DC and Phases Topology 11
Relays, Current and Voltage Transformers Secondary Equipment 12
Fault Clearing Times Results 13
Feeders Topology 14
Switches, Type of Usage Secondary Equipment 15
Measurement Locations Secondary Equipment 16
Missing graphical connections Topology 17
Zones Groupings 18
State Estimation Results 19
Boundaries (Interior Region) Topology 20
Station Connectivity Topology 21
Outage Check Topology 22
Energizing Status Topology 23
Modifications in Recording Expansion Stage Variations / System Stages 24
Areas Groupings 25
Owners Groupings 26
Routes Groupings 27
Operators Groupings 28
Original Locations Variations / System Stages 30
Boundaries (Definition) Topology 34
Meteo Stations Groupings 35
Station Connectivity (Beach Balls only) Topology 36
Power Restoration Secondary Equipment 43
Connected Components Topology 39
Connected Components, Voltage Level Topology 40
Year of Construction Primary Equipment 41
Cross Section Primary Equipment 42
Forced Outage Rate Primary Equipment 44
Forced Outage Duration Primary Equipment 45
Loads: Yearly interruption frequency Results 46
Loads: Yearly interruption time Results 47
Loads: Average Interruption Duration Results 48
Loads: Load Point Energy Not Supplied Results 49
Supplied by Substation Topology 50
Supplied by Secondary Substation Topology 51
Incident Energy Results 52
PPE-Category Results 53
Optimal Manual Restoration Results 54
Connection Request: Approval Status Results 55
Voltage Angle Results 56
Contributions to SAIDI Results 57
Contributions to SAIFI Results 58
Contributions to ENS Results 59
Contributions to EIC Results 60
DIgSILENT PowerFactory 2018, Python Function Reference 302
Chapter 5. Object Methods

Note: User-defined filters can be set with a “normal” value of 1000 or higher. The first filter in
the list has the value 1000, the next one has 1001 and so on.

R ETURNS
0 error (at least one of the given colourings cannot be set, e.g. not available for
given page). Nothing is changed.
1 ok

SetFilter
Sets filter for given or currently valid calculation.
int [Link](int filter,
[int page]
)
int [Link](DataObject obj,
[int page]
)

A RGUMENTS
filter number of filter to be set

obj user-defined filter to be set


page (optional)
Dialog page number for which filter is set (for numbers see table listed in Set-
[Link]())

R ETURNS
0 ok
1 error (filter or page not found)

S EE ALSO

[Link]()

5.5.3 SetDesktop
Overview

AddPage
DoAutoScaleX
GetPage
SetAdaptX
SetAutoScaleX
SetResults
SetScaleX
SetXVar
Show
WriteWMF

DIgSILENT PowerFactory 2018, Python Function Reference 303


Chapter 5. Object Methods

AddPage
Adds an existing page to a graphics and activates it

• Opens the graphics board if not already open.


• Adds the page if it is not already part of the graphics board.

DataObject [Link](DataObject page2add)

A RGUMENTS
page2add
The page to add to the desktop.

• Page is a SetVipage (virtual instrument panel): A copy of the page is added.


• Page is an IntGrfnet (Single line graphic, block diagram): The graphic is
added.

R ETURNS
The page displayed or None if the desktop was not changed.

DoAutoScaleX
Scales the x-axes of all plots in the graphics board which use the x-axis scale defined in the
graphics board.
None [Link]()

GetPage
Searches, activates and returns a graphics page in the currently open graphics board. If “create”
is true, then a new virtual instrument panel will be created and added to the graphics board if
no page with name was found.
DataObject [Link](str name,
[int create]
)

A RGUMENTS
name Name of the page.
create (optional)
Possible values:
0 do not create new virtual instrument panel
1 create panel if it does not exist already

R ETURNS
Virtual instrument panel (SetVipage)

DIgSILENT PowerFactory 2018, Python Function Reference 304


Chapter 5. Object Methods

SetAdaptX
Sets the Adapt Scale option of the x-scale.
None [Link](int mode,
[float trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on

trigger (optional)
Trigger value, unused if mode is off or empty

SetAutoScaleX
Sets automatic scaling mode of the x-scale. A warning is issued if an invalid mode is passed to
the function.
None [Link](int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

SetResults
Sets default results object of graphics board.
None [Link](DataObject res)

A RGUMENTS
res Result object to set or None to reset. Valid result object is any of class ElmRes,
IntComtrade and IntComtradeset.

SetScaleX
Sets x-axis scale. A function call without arguments sets the Auto Scale setting to On without
changing the scale itself.
None [Link]()
None [Link](float min,
float max,
[int log]
)

DIgSILENT PowerFactory 2018, Python Function Reference 305


Chapter 5. Object Methods

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

SetXVar
Sets x-axis variable. If The default x-axis variable (time) is set if no argument is passed.
None [Link]()
None [Link](DataObject obj,]
str varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

Show
Shows the virtual instrument panel with the same name as 'pageObject' or the page with
name 'pageName' in the graphics board. The object 'pageObject' is typically a object of class
'SetVipage' (virtual instrument panel) but, as only its name is used, it may be any other type of
object. Calling the function without an argument opens the graphics board.
int [Link]()
int [Link](str pageName)
int [Link](DataObject pageObject)

A RGUMENTS
pageName (optional)
Name of graphics page.
pageObject (optional)
A graphics page oject.

R ETURNS
0 on success
1 on error

DIgSILENT PowerFactory 2018, Python Function Reference 306


Chapter 5. Object Methods

WriteWMF
Writes the currently open graphic to a windows metafile file (*.wmf).
int [Link](str filename)

A RGUMENTS
filename Filename without extension.

5.5.4 SetDistrstate
Overview

CalcCluster

CalcCluster
Calculates a load flow with a given load distribution state applied.
list(int, ...) [Link](float arg0,
[float arg1]
)

A RGUMENTS
clusterIndex
The number of the load cluster - 1
emitMessage (optional)
Emit messages if not equal to zero

R ETURNS
0 if ok. -1 if load flow of cluster did not converge.

5.5.5 SetFilt
Overview

Get

Get
Returns a container with the filtered objects.
list [Link]()

R ETURNS
The set of filtered objects.

DIgSILENT PowerFactory 2018, Python Function Reference 307


Chapter 5. Object Methods

5.5.6 SetLevelvis
Overview

AdaptWidth
Align
ChangeFont
ChangeFrameAndWidth
ChangeLayer
ChangeRefPoints
ChangeWidthVisibilityAndColour
Mark
Reset

AdaptWidth
This function resizes the in the object specified group of text boxes regarding their text contents.
None [Link]()

Align
This function aligns the text within a text box.
None [Link](int iPos)

A RGUMENTS
iPos Alignment position
0 left
1 middle
2 right

ChangeFont
This function sets the font number for the specified group of text boxes.
None [Link](int iFont)

A RGUMENTS
iFont Font number (default fonts range from 0 to 13)

ChangeFrameAndWidth
This method is not available anymore. Please use [Link]()
instead.
list(None, ...) [Link]([int iFrame,]
[int iWidth,]
[int iVisibility,]
[int iColour]
)

DIgSILENT PowerFactory 2018, Python Function Reference 308


Chapter 5. Object Methods

ChangeLayer
This function sets the specified group of text boxes to a given layer.
None [Link](str sLayer)

A RGUMENTS
sLayer Layer name (e.g. 'Object Names', 'Results', 'Invisible Objects',..)

ChangeRefPoints
This function sets the reference points between a text box (second parameter) and its parent
object (first parameter), e.g. if the result box of a busbar shall be shown on top of a drawn
bar instead of below the bar the values change from (6,4) to (4,6). The first number specifies
the reference number of the text box. The integer values describe the position of the reference
points within a rectangle (0=centre, 1=middle right, 2=top right,..):
432
501
678

None [Link](int iParRef,


int iTBRef
)

A RGUMENTS
iParRef Defines the reference point on the parent object (e.g. busbar)
iTBRef Defines the reference point on the text box

ChangeWidthVisibilityAndColour
This function sets the visibility of the frame, the width (in number of letters), the visibility and the
colour of text boxes.
None [Link]([int iWidth,]
[int iVisibility,]
[int iColour]
)

A RGUMENTS
iWidth Sets the width in number of letters
0..n width
iVisibility Sets the visibility

0 not visible
1 visible
iColour Sets the colour

0..255 colour

DIgSILENT PowerFactory 2018, Python Function Reference 309


Chapter 5. Object Methods

Mark
Marks the specified group of text boxes in the currently shown diagram.
None [Link]()

Reset
This function resets the individually modified text box settings.
None [Link](int iMode)

A RGUMENTS
iMode
0 Reset to default (changed reference points are not reset)
1 Only font
2 Shift to original layer (result boxes to layer 'Results', object names to
layer 'Object Names')

5.5.7 SetParalman
Overview

GetNumSlave
SetNumSlave
SetTransfType

GetNumSlave
To get the number of slaves which is currently configured.
int [Link]()

R ETURNS
the number of slaves which is currently configured.

SetNumSlave
To configue the number of slaves to be used for parallel computing.
int [Link](int numSlaves)

A RGUMENTS
numSlaves
Number of slaves to be used for parallel computing

−1 All cores available will be used.


>0 The number of slaves to be used.

DIgSILENT PowerFactory 2018, Python Function Reference 310


Chapter 5. Object Methods

R ETURNS
Always return 0.

SetTransfType
To change the data transfer type: via file or via socket communication.
int [Link](int viaFile)

A RGUMENTS
viaFile
0 The data will be transferred via socket communication.
1 The data will be transferred via file.

R ETURNS
0 the data will be transferred via socket communication.
1 the data will be transferred via file.

5.5.8 SetSelect
Overview

AddRef
All
AllAsm
AllBars
AllBreakers
AllClosedBreakers
AllElm
AllLines
AllLoads
AllOpenBreakers
AllSym
AllTypLne
Clear
GetAll

AddRef
Adds a reference to the objects to the existing selection.
None [Link](DataObject O)
None [Link](list S)

A RGUMENTS
O An object.
S A set of objects.

DIgSILENT PowerFactory 2018, Python Function Reference 311


Chapter 5. Object Methods

All
Returns all objects in the selection.
list [Link]()

R ETURNS
The set of objects

AllAsm
Returns all asynchronous machines in the selection.
list [Link]()

R ETURNS
The set of objects

AllBars
Returns all busbars and terminals in the selection.
list [Link]()

R ETURNS
The set of objects

AllBreakers
Returns all breakers in the selection.
list [Link]()

R ETURNS
The set of objects

AllClosedBreakers
Returns all closed breakers in the selection.
list [Link]()

R ETURNS
The set of objects

AllElm
Returns all elements (Elm*) in the selection.
list [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 312


Chapter 5. Object Methods

R ETURNS
The set of containing objects

AllLines
Returns all lines and line routes in the selection.
list [Link]()

R ETURNS
The set of objects

AllLoads
Returns all loads in the selection.
list [Link]()

R ETURNS
The set of objects

AllOpenBreakers
Returns all open breakers in the selection.
list [Link]()

R ETURNS
The set of objects

AllSym
Returns all synchronous machines in the selection.
list [Link]()

R ETURNS
The set of objects

AllTypLne
Returns all line types in the selection.
list [Link]()

R ETURNS
The set of objects

DIgSILENT PowerFactory 2018, Python Function Reference 313


Chapter 5. Object Methods

Clear
Clears (deletes) the selection.
None [Link]()

GetAll
Returns all objects in the selection which are of the class 'ClassName'.
list [Link](str ClassName)

A RGUMENTS
ClassName
The object class name.

R ETURNS
The set of objects

5.5.9 SetTboxconfig
Overview

Check
GetAvailableButtons
GetDisplayedButtons
Purge
SetDisplayedButtons

Check
Checks buttons to be displayed for invalid or duplicate ids and prints error messages.
int [Link]()

R ETURNS
0 No errors found.
1 Errors found.

GetAvailableButtons
Gets buttons available for selected tool bar.
str [Link]()

R ETURNS
String ids of all buttons available for selected tool bar; ids are separated by '\n'.

GetDisplayedButtons
Gets buttons configured to be displayed in selected tool bar.

DIgSILENT PowerFactory 2018, Python Function Reference 314


Chapter 5. Object Methods

str [Link]()

R ETURNS
String ids of all buttons configured to be displayed in selected tool bar; ids are separated by
'\n'.

Purge
Purges buttons to be displayed from invalid or duplicate ids.
int [Link]()

R ETURNS
0 No problems found.
1 Configuration was adapted.

SetDisplayedButtons
Sets buttons to be displayed in selected tool bar. Purges given buttons from invalid or duplicate
buttons (duplicate separators or breaks are kept).
int [Link](str buttonIds)

A RGUMENTS
buttonIds String ids of all buttons to be set as displayed buttons; ids have to be separated
by '\n'

R ETURNS
0 Given buttons were stored without modification.
1 Given buttons were purged from invalid or duplicate ids.

5.5.10 SetTime
Overview

Date
SetTime
SetTimeUTC
Time

Date
Sets date component to current system date.
None [Link]()

S EE ALSO

[Link](), [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 315


Chapter 5. Object Methods

SetTime
Sets the time in the current year. There is no restriction to the values for H, M and S, except
for the fact that negative values are interpreted as zero. Values higher than 24 or 60 will be
processed normally by adding the hours, minutes and seconds into an absolute time, from
which a new hour-of-year, hour-of-day, minutes and seconds are calculated.
None [Link](float H,
[float M,]
[float S]
)

A RGUMENTS
H The hours

M (optional)
The minutes
S (optional)
The seconds

SetTimeUTC
Sets date and time to given time. The time must be given in UTC format as seconds since
01.01.1970 00:00 GMT.
None [Link](int time)

A RGUMENTS
time UTC time in seconds since 01.01.1970 00:00 GMT

S EE ALSO

[Link](), [Link]()

Time
Sets time component to current system time.
None [Link]()

S EE ALSO

[Link](), [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 316


Chapter 5. Object Methods

5.5.11 SetVipage
Overview

DoAutoScaleX
DoAutoScaleY
GetOrInsertPlot
InsertPlot
SetAdaptX
SetAutoScaleX
SetResults
SetScaleX
SetStyle
SetTile
SetXVar

DoAutoScaleX
Scales the x-axes of all plots on the virtual instrument panel automatically.
None [Link]()

DoAutoScaleY
Scales the y-axes of all plots on the virtual instrument panel automatically.
None [Link]()

GetOrInsertPlot
Get or create a virtual instruments of the virtual instrument panel.
DataObject [Link] (str name,
[str class,]
[int create]
)

D EPRECATED N AMES
GetVI

A RGUMENTS
name Name of virtual instrument

class='VisPlot' (optional)
classname of virtual instrument.
create (optional)
Possible values:
0 do not create new virtual instrument
1 create virtual instrument if it does not exist already

R ETURNS
Virtual instrument

DIgSILENT PowerFactory 2018, Python Function Reference 317


Chapter 5. Object Methods

InsertPlot
Creates a copy of the virtual instrument passed and displays the copy on this panel.
DataObject [Link](DataObject vi)

D EPRECATED N AMES
CreateVI

A RGUMENTS
vi The virtual instrument which will be copied. Only virtual instruments are allowed
(classname 'Vis*').

R ETURNS
Returns the created virtual instrument.

SetAdaptX
Sets the Adapt Scale option of the x-scale.
None [Link](int mode,
[float trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on
trigger (optional)
Trigger value, unused if mode is off or empty

SetAutoScaleX
Sets automatic scaling mode of the x-scale. A warning is issued if an invalid mode is passed to
the function.
None [Link](int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

SetResults
Sets default results object of virtual instrument panel.
None [Link](DataObject res)

DIgSILENT PowerFactory 2018, Python Function Reference 318


Chapter 5. Object Methods

A RGUMENTS
res Result object to set or None to reset. Valid result object is any of class ElmRes,
IntComtrade and IntComtradeset.

SetScaleX
Sets x-axis scale. A function call without arguments sets the Auto Scale setting to On without
changing the scale itself.
None [Link]()
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

SetStyle
Sets style of virtual instrument panel. A warning message is issued in the case that a style with
the given name does not exist.
None [Link](str name)

A RGUMENTS
name Style Name

SetTile
Rearranges the virtual instrument on the panel.
None [Link]([int tile])

A RGUMENTS
tile=1 (optional) tile =0 arrange virtual instruments automatically (like tiles)
tile=1 arrange them horizontally

DIgSILENT PowerFactory 2018, Python Function Reference 319


Chapter 5. Object Methods

SetXVar
Sets x-axis variable. If The default x-axis variable (time) is set if no argument is passed.
None [Link]()
None [Link](DataObject obj,]
str varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

5.6 Others

5.6.1 BlkDef
Overview

Compile
Encrypt
GetCheckSum
Pack
PackAsMacro

Compile
Compiles the model to a DLL. Can be called on an already compiled model.
int [Link]([string modelPath])

A RGUMENTS
modelPath (optional)
Full path to a location where the model should be stored. Leave empty to use
default.

Encrypt
Encrypts this block definition. It has to be packed as macro before.
int [Link]([int doRemoveHistoricRecords])

A RGUMENTS
doRemoveHistoricRecords (optional)
0: do not remove historic copies in database. 1: do remove 2: show dialog and
ask.

R ETURNS
0 On success.
1 On error.

DIgSILENT PowerFactory 2018, Python Function Reference 320


Chapter 5. Object Methods

S EE ALSO

[Link]()

GetCheckSum
str [Link]()

D EPRECATED N AMES
CalculateCheckSum

R ETURNS
The checksum of the block definition (0000-0000-0000-0000 for frames).

Pack
Copies all used macros (i.e. referenced BlkDef) to this block.
int [Link]()

R ETURNS
0 On success.
1 On error.

PackAsMacro
Collects all equations, stores them to this model and deletes block diagram and all macro refer-
ences.
int [Link]()

R ETURNS
0 On success.
1 On error.

S EE ALSO

[Link]()

5.6.2 BlkSig
Overview

GetFromSigName
GetToSigName

DIgSILENT PowerFactory 2018, Python Function Reference 321


Chapter 5. Object Methods

GetFromSigName
str [Link]()

R ETURNS
The name of the output from which the signal is connected. In cases of no connection, an
empty string.

GetToSigName
str [Link]()

R ETURNS
The name of the input to which the signal is connected. In cases of no connection, an empty
string.

5.6.3 ChaVecfile
Overview

Update

Update
Reloads the file from disk. Same behaviour like button update.
int [Link]([int msgOn = 0])

A RGUMENTS
msgOn (optional)
Reporting of errors:
0 No error message is shown in case that the file can not be loaded
(default).
1 Emit an error message in case that the file can not be loaded.

R ETURNS
The number of samples (rows) read from the file.

5.6.4 CimModel
Overview

DeleteParameterAtIndex
GetAttributeEnumerationType
GetParameterCount
GetParameterNamespace
GetParameterValue
HasParameter
RemoveParameter
SetAssociationValue

DIgSILENT PowerFactory 2018, Python Function Reference 322


Chapter 5. Object Methods

SetAssociationValue
SetAttributeEnumeration
SetAttributeEnumeration
SetAttributeValue
SetAttributeValue

DeleteParameterAtIndex
Removes the parameter (attribute, or association) value at the given index.
None [Link](str parameter, int index)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

index Index of the parameter

GetAttributeEnumerationType
Returns the enumeration type of the attribute.
str [Link](str attribute)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)

GetParameterCount
Returns the number of parameters (attribute, or association) of given type.
int [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

GetParameterNamespace
Returns the namesace of the parameter (attribute, or association).
str [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

DIgSILENT PowerFactory 2018, Python Function Reference 323


Chapter 5. Object Methods

GetParameterValue
Returns the value of the parameter (attribute, or association) at the given index if available. If the
parameter (attribute, or association) is not available, or the index is out of bounds the function
returns an empty string.
str [Link](str parameter, [int index])

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)
index Index of the parameter:
0 Default index

HasParameter
Checks whether the CimModel has the parameter (attribute, or association) specified.
int [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

R ETURNS
1 if parameter is specified
0 if parameter is not specified

RemoveParameter
Removes all occurences of the parameter (attribute, or association).
None [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

SetAssociationValue
Adds the association if not available yet, and sets its value at the given index. If the association
is already added, the function sets a new value at the given index only.
None [Link](str association,
str value,
[int index])

DIgSILENT PowerFactory 2018, Python Function Reference 324


Chapter 5. Object Methods

A RGUMENTS
association
Full-name specifier of the association (e.g. ”[Link]”)
value Value of the association

index Index of the association:


0 Default index

SetAssociationValue
Adds the association if not available yet, and sets its namespace and value. If the association
is already added, the function sets its namespace and value only.
None [Link](str association,
str value,
str nspace)

A RGUMENTS
attribute Full-name specifier of the association (e.g. ”[Link]”)
value Value of the association
nspace Namespace of the association (e.g. ”md”)

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its enumeration type and value. If the attribute is
already added, the function sets its enumeration type and value only.
None [Link](str attribute,
str enumerationType,
str value)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
enumerationType
Enumeration type of the attribute (e.g. ”GeneratorControlSource”)

value Value of the enumeration (e.g. ”offAGC”)

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its namespace, enumeration type and value.
If the attribute is already added, the function sets its namespace, enumeration type and value
only.
None [Link](str attribute,
str enumerationType,
str value,
str nspace)

DIgSILENT PowerFactory 2018, Python Function Reference 325


Chapter 5. Object Methods

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
enumerationType
Enumeration type of the attribute (e.g. ”GeneratorControlSource”)

value Value of the attribute (e.g. ”offAGC”)


nspace Namespace of the attribute (e.g. ”cim”)

SetAttributeValue
Adds the attribute if not available yet, and sets its value at the given index. If the attribute is
already added, the function sets a new value at the given index only.
None [Link](str attribute,
str value,
[int index])

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
value Value of the attribute
index Index of the attribute:
0 Default index

SetAttributeValue
Adds the attribute if not available yet, and sets its namespace and value. If the attribute is
already added, the function sets its namespace and value only.
None [Link](str attribute,
str value,
str nspace)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
value Value of the attribute

nspace Namespace of the attribute (e.g. ”md”)

DIgSILENT PowerFactory 2018, Python Function Reference 326


Chapter 5. Object Methods

5.6.5 CimObject
Overview

DeleteParameterAtIndex
GetAttributeEnumerationType
GetParameterCount
GetParameterNamespace
GetParameterValue
HasParameter
RemoveParameter
SetAssociationValue
SetAssociationValue
SetAttributeEnumeration
SetAttributeEnumeration
SetAttributeValue
SetAttributeValue

DeleteParameterAtIndex
Removes the parameter (attribute, or association) value at the given index.
None [Link](str parameter, int index)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)
index Index of the parameter

GetAttributeEnumerationType
Returns the enumeration type of the attribute.
str [Link](str attribute)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)

GetParameterCount
Returns the number of parameters (attribute, or association) of given type.
int [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

DIgSILENT PowerFactory 2018, Python Function Reference 327


Chapter 5. Object Methods

GetParameterNamespace
Returns the namesace of the parameter (attribute, or association).
str [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

GetParameterValue
Returns the value of the parameter (attribute, or association) at the given index if available. If the
parameter (attribute, or association) is not available, or the index is out of bounds the function
returns an empty string.
str [Link](str parameter, [int index])

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)
index Index of the parameter:
0 Default index

HasParameter
Checks whether the CimObject has the parameter (attribute, or association) specified.
int [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

R ETURNS
1 if parameter is specified
0 if parameter is not specified

RemoveParameter
Removes all occurences of the parameter (attribute, or association).
None [Link](str parameter)

A RGUMENTS
parameter
Full-name specifier of the attribute, or association (e.g. ”[Link]”)

DIgSILENT PowerFactory 2018, Python Function Reference 328


Chapter 5. Object Methods

SetAssociationValue
Adds the association if not available yet, and sets its value at the given index. If the association
is already added, the function sets a new value at the given index only.
None [Link](str association,
str value,
[int index])

A RGUMENTS
association
Full-name specifier of the association (e.g. ”[Link]”)

value Value of the association


index Index of the association:
0 Default index

SetAssociationValue
Adds the association if not available yet, and sets its namespace and value. If the association
is already added, the function sets its namespace and value only.
None [Link](str association,
str value,
str nspace)

A RGUMENTS
attribute Full-name specifier of the association (e.g. ”[Link]”)
value Value of the association
nspace Namespace of the association (e.g. ”cim”)

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its enumeration type and value. If the attribute is
already added, the function sets its enumeration type and value only.
None [Link](str attribute,
str enumerationType,
str value)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
enumerationType
Enumeration type of the attribute (e.g. ”GeneratorControlSource”)
value Value of the enumeration (e.g. ”offAGC”)

DIgSILENT PowerFactory 2018, Python Function Reference 329


Chapter 5. Object Methods

SetAttributeEnumeration
Adds the attribute if not available yet, and sets its namespace, enumeration type and value.
If the attribute is already added, the function sets its namespace, enumeration type and value
only.
None [Link](str attribute,
str enumerationType,
str value,
str nspace)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
enumerationType
Enumeration type of the attribute (e.g. ”GeneratorControlSource”)
value Value of the attribute (e.g. ”offAGC”)
nspace Namespace of the attribute (e.g. ”cim”)

SetAttributeValue
Adds the attribute if not available yet, and sets its value at the given index. If the attribute is
already added, the function sets a new value at the given index only.
None [Link](str attribute,
str value,
[int index])

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)
value Value of the attribute
index Index of the attribute:

0 Default index

SetAttributeValue
Adds the attribute if not available yet, and sets its namespace and value. If the attribute is
already added, the function sets its namespace and value only.
None [Link](str attribute,
str value,
str nspace)

A RGUMENTS
attribute Full-name specifier of the attribute (e.g. ”[Link]”)

value Value of the attribute


nspace Namespace of the attribute (e.g. ”cim”)

DIgSILENT PowerFactory 2018, Python Function Reference 330


Chapter 5. Object Methods

5.6.6 IntCase
Overview

Activate
ApplyNetworkState
ApplyStudyTime
Consolidate
Deactivate
SetStudyTime

Activate
Activates the study case. Deactivates other study cases first.
int [Link]()

R ETURNS
0 on success
1 on error

ApplyNetworkState
For a study case in a combined project, copy the network state from another case.
Copies the active grids, scenarios and network variations configuration to the current case. The
data will be added to any already existing configuration.
int [Link](IntCase other)

A RGUMENTS
IntCase The source Study Case to copy data from

R ETURNS
0 On success
1 Source object is not an IntCase object
2 Case where function is called on is not the active case
3 Source case is not from active project
4 Source Study Case is not from a source project in a combined project
5 Other error. Details are given in an error message

ApplyStudyTime
For a study case in a combined project, apply the study time from another study case.
int [Link](IntCase other)

A RGUMENTS
IntCase The source study case to copy study time from

DIgSILENT PowerFactory 2018, Python Function Reference 331


Chapter 5. Object Methods

R ETURNS
0 On success
1 Source object is not an IntCase object
2 Study case where function is called on is not the active case
3 Source case is not from active project
4 Source case is not from a project part of a combined project

Consolidate
Changes that are recorded in a project’s active Variations are permanently applied to the Net-
work Data folder (like right mouse button Consolidate Network Variation)
Note: Modified scenarios are not saved!
Works only:

• For active study cases


• If a network variation is active

int [Link]()

R ETURNS
0 On success
1 If an error has occured

S EE ALSO

[Link]()

Deactivate
De-activates the study case.
int [Link]()

R ETURNS
0 on success
1 on error

SetStudyTime
Sets the Study Case time to seconds since 01.01.1970 00:00:00.
None [Link](float dateTime)

A RGUMENTS
dateTime Seconds since 01.01.1970 00:00:00

DIgSILENT PowerFactory 2018, Python Function Reference 332


Chapter 5. Object Methods

5.6.7 IntComtrade
Overview

ConvertToASCIIFormat
ConvertToBinaryFormat
FindColumn
FindMaxInColumn
FindMinInColumn
GetDescription
GetNumberOfColumns
GetNumberOfRows
GetUnit
GetValue
GetVariable
Load
Release
SortAccordingToColumn

ConvertToASCIIFormat
Creates new comtrade configuration and data files in ASCII format in the file system directory of
the original files. The new configuration file is linked automatically to a new IntComtrade object
created in the same PowerFactory folder like this object. An existing IntComtrade object is
already in ASCII format when its parameter ’Binary’ is set to 0.
int [Link]()

R ETURNS
0 File successfully converted.
1 Error occured, e.g. file is already in ASCII format.

ConvertToBinaryFormat
Creates new comtrade configuration and data files in binary format in the file system directory of
the original files. The new configuration file is linked automatically to a new IntComtrade object
created in the same PowerFactory folder like this object. An existing IntComtrade object is
already in binary format when its parameter ’Binary’ is set to 1.
int [Link]()

R ETURNS
0 File successfully converted.
1 Error occured, e.g. file is already in binary format.

FindColumn
Returns the first column matching the variable name.
int [Link](str variable,
[int startCol]
)

DIgSILENT PowerFactory 2018, Python Function Reference 333


Chapter 5. Object Methods

A RGUMENTS
variable The variable name to look for.
startCol (optional)
The index of the column at which to start the search.

R ETURNS
≥0 The column index found.
<0 The column with name variable was not found.

FindMaxInColumn
Find the maximum value of the variable in the given column.
[int row,
float value] [Link](int column)

A RGUMENTS
column The column index.
value (optional, out)
The maximum value found. The value is 0. in case that the maximum value was
not found.

R ETURNS
<0 The maximum value of column was not found.
≥0 The row with the maximum value of the column.

FindMinInColumn
Find the minimum value of the variable in the given column.
[int row,
float value] [Link](int column)

A RGUMENTS
column The column index.
value (optional, out)
The minimum value found. The value is 0. in case that the minimum value was
not found.

R ETURNS
<0 The minimum value of column was not found.
≥0 The row with the minimum value of the column.

GetDescription
Get the description of a column.
str [Link]([int column],
[int short]
)

DIgSILENT PowerFactory 2018, Python Function Reference 334


Chapter 5. Object Methods

A RGUMENTS
column (optional)
The column index. The description name of the default variable is returned if the
parameter is nor passed to the function.
short (optional)
0 long desc. (default)
1 short description

R ETURNS
Returns the description which is empty in case that the column index is not part of the data.

GetNumberOfColumns
Returns the number of variables (columns) in result file excluding the default variable (e.g. time
for time domain simulation).
int [Link]()

R ETURNS
Number of variables (columns) in result file.

GetNumberOfRows
Returns the number of values per column (rows) stored in result object.
int [Link]()

R ETURNS
Returns the number of values per column stored in result object.

GetUnit
Get the unit of a column.
str [Link]([int column])

A RGUMENTS
column (optional)
The column index. The unit of the default variable is returned if the parameter is
nor passed to the function.

R ETURNS
Returns the unit which is empty in case that the column index is not part of the data.

GetValue
Returns a value from a result object for row iX of curve col.
[int error,
float d ] [Link](int iX,
[int col])

DIgSILENT PowerFactory 2018, Python Function Reference 335


Chapter 5. Object Methods

A RGUMENTS
d (out) The value retrieved from the data.
iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g. by
the contingency, the value is invalid in case that it was not written, bcause it was
below the recording limit. Result files created using DPL/Python are always full
and will not return invalid values.

GetVariable
Get variable name of column
str [Link]([int column])

A RGUMENTS
column (optional)
The column index. The variable name of the default variable is returned if the
parameter is nor passed to the function.

R ETURNS
Returns the variable name which is empty in case that the column index is not part of the
data.

Load
Loads the data of a result object (IntComtrade) in memory for reading.
None [Link]()

Release
Releases the data loaded to memory. This function should be used whenever several result
objects are processed in a loop. Data is always released from memory automatically after
execution of the current script.
None [Link]()

SortAccordingToColumn
Sorts all rows in the data loaded according to the given column. The IntComtrade itself remains
unchanged.
int [Link](int column)

DIgSILENT PowerFactory 2018, Python Function Reference 336


Chapter 5. Object Methods

A RGUMENTS
col The column number.

R ETURNS
0 The function executed correctly, the data was sorted correctly according to the
given column.
1 The column with index column does not exist.

5.6.8 IntComtradeset
Overview

FindColumn
FindMaxInColumn
FindMinInColumn
GetDescription
GetNumberOfColumns
GetNumberOfRows
GetUnit
GetValue
GetVariable
Load
Release
SortAccordingToColumn

FindColumn
Returns the first column matching the variable name.
int [Link](str variable,
[int startCol]
)

A RGUMENTS
variable The variable name to look for.
startCol (optional)
The index of the column at which to start the search.

R ETURNS
≥0 The column index found.
<0 The column with name variable was not found.

FindMaxInColumn
Find the maximum value of the variable in the given column.
[int row,
float value] [Link](int column)

A RGUMENTS
column The column index.

DIgSILENT PowerFactory 2018, Python Function Reference 337


Chapter 5. Object Methods

value (optional, out)


The maximum value found. The value is 0. in case that the maximum value was
not found.

R ETURNS
<0 The maximum value of column was not found.
≥0 The row with the maximum value of the column.

FindMinInColumn
Find the minimum value of the variable in the given column.
[int row,
float value] [Link](int column)

A RGUMENTS
column The column index.
value (optional, out)
The minimum value found. The value is 0. in case that the minimum value was
not found.

R ETURNS
<0 The minimum value of column was not found.
≥0 The row with the minimum value of the column.

GetDescription
Get the description of a column.
str [Link]([int column],
[int short]
)

A RGUMENTS
column (optional)
The column index. The description name of the default variable is returned if the
parameter is nor passed to the function.
short (optional)
0 long desc. (default)
1 short description

R ETURNS
Returns the description which is empty in case that the column index is not part of the data.

GetNumberOfColumns
Returns the number of variables (columns) in result file excluding the default variable (e.g. time
for time domain simulation).
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 338


Chapter 5. Object Methods

R ETURNS
Number of variables (columns) in result file.

GetNumberOfRows
Returns the number of values per column (rows) stored in result object.
int [Link]()

R ETURNS
Returns the number of values per column stored in result object.

GetUnit
Get the unit of a column.
str [Link]([int column])

A RGUMENTS
column (optional)
The column index. The unit of the default variable is returned if the parameter is
nor passed to the function.

R ETURNS
Returns the unit which is empty in case that the column index is not part of the data.

GetValue
Returns a value from a result object for row iX of curve col.
[int error,
float d ] [Link](int iX,
[int col])

A RGUMENTS
d (out) The value retrieved from the data.
iX The row.
col (optional)
The curve number, which equals the variable or column number, first column value
(time,index, etc.) is returned when omitted.

R ETURNS
0 when ok
1 when iX out of bound
2 when col out of bound
3 when invalid value is returned from a sparse file. Sparse files are written e.g. by
the contingency, the value is invalid in case that it was not written, bcause it was
below the recording limit. Result files created using DPL/Python are always full
and will not return invalid values.

DIgSILENT PowerFactory 2018, Python Function Reference 339


Chapter 5. Object Methods

GetVariable
Get variable name of column
str [Link]([int column])

A RGUMENTS
column (optional)
The column index. The variable name of the default variable is returned if the
parameter is nor passed to the function.

R ETURNS
Returns the variable name which is empty in case that the column index is not part of the
data.

Load
Loads the data of a result object (IntComtradeset) in memory for reading.
None [Link]()

Release
Releases the data loaded to memory. This function should be used whenever several result
objects are processed in a loop. Data is always released from memory automatically after
execution of the current script.
None [Link]()

SortAccordingToColumn
Sorts all rows in the data loaded according to the given column. The IntComtradeset itself
remains unchanged.
int [Link](int column)

A RGUMENTS
col The column number.

R ETURNS
0 The function executed correctly, the data was sorted correctly according to the
given column.
1 The column with index column does not exist.

5.6.9 IntDataset
Overview

AddRef
All
Clear
GetAll
DIgSILENT PowerFactory 2018, Python Function Reference 340
Chapter 5. Object Methods

AddRef
Adds new reference(s) for passed object(s) as children to the dataset object. Nothing happens
if there exists already a reference for the passed object.
None [Link](DataObject object)
None [Link](list objects)

A RGUMENTS
obj/objects
Object(s) for which references should be created and added to the dataset object

All
Returns all children of the dataset object.
list [Link]()

R ETURNS
All objects contained in dataset object.

Clear
Deletes all children of the dataset object.
None [Link]()

GetAll
Returns all children of the dataset filtered according to given class name.
list [Link](str className)

A RGUMENTS
className
class name filter, e.g. ElmTerm

R ETURNS
All objects of given class stored in dataset object.

5.6.10 IntEvt
Overview

CreateCBEvents
RemoveSwitchEvents

CreateCBEvents
Create boundary breaker events for all shc locations which occur simultaneously in this fault
case.

DIgSILENT PowerFactory 2018, Python Function Reference 341


Chapter 5. Object Methods

None [Link]([int iRemoveExisting])

A RGUMENTS
iRemoveExisting (optional)
-1 Query user if circuit breaker events exist.
0 Do not create circuit breaker events if circuit breaker events are already
defined events exist (default)
1 Remove existing circuit breaker events.

RemoveSwitchEvents
Remove all switch events of this fault case.
None [Link]([int onlyContingency])

A RGUMENTS
onlyContingency (optional)
Condition to remove.
0 Remove all switch events regardless of the calculation type.
1 Remove all switch events only when this fault case is used for contin-
gency analysis.

5.6.11 IntExtaccess
Overview

CheckUrl

CheckUrl
Checks whether access to given url will be granted or not according to the security settings.
See also [Link]() for accessing that url.
int [Link](str url)

A RGUMENTS
url url to check

R ETURNS
0 access granted
1 access denied

DIgSILENT PowerFactory 2018, Python Function Reference 342


Chapter 5. Object Methods

5.6.12 IntGate
Overview

AddTrigger

AddTrigger
Adds either a condition or a gate to the gate.
list [Link](DataObject newTrigger)

A RGUMENTS
newTrigger
The condition or gate that shall be added.

5.6.13 IntGrf
Overview

MoveToLayer

MoveToLayer
Moves an annotation element stored as IntGrf object to an annotation layer (IntGrflayer ) or
group (IntGrfgroup).
None [Link](DataObject layer)

A RGUMENTS
layer Target IntGrflayer or IntGrfgroup object.

5.6.14 IntGrfgroup
Overview

ClearData
Export
Import

ClearData
Removes all annotation elements from this group.
None [Link]()

Export
Exports all objects of a group into svg-file.
None [Link](str path,

DIgSILENT PowerFactory 2018, Python Function Reference 343


Chapter 5. Object Methods

[int OpenDialog])

A RGUMENTS
path Full export file path
OpenDialog (optional)
Prompt for export path in dialog
0 Export directly and do not show any dialog (default)
1 Show dialog with path before exporting

Import
Imports svg-file into group object.
None [Link](str path)

A RGUMENTS
path Path of file to be imported.

5.6.15 IntGrflayer
Overview

ClearData
Export
Import

ClearData
Removes all annotation elements on this layer (keeps contained groups and annotation ele-
ments).
None [Link]()

Export
Exports all objects of a layer into svg-file, inclusive annotation objects of contained group ob-
jects.
None [Link](str path,
[int OpenDialog])

A RGUMENTS
path Full export file path
OpenDialog (optional)
Prompt for export path in dialog
0 Export directly and do not show any dialog (default)
1 Show dialog with path before exporting

DIgSILENT PowerFactory 2018, Python Function Reference 344


Chapter 5. Object Methods

Import
Imports svg file into layer.
None [Link](str path)

A RGUMENTS
path Path of file to be imported.

5.6.16 IntGrfnet
Overview

SetLayerVisibility
Show

SetLayerVisibility
Sets a layer visible or invisible.
None [Link](str sLayer,
int iVis)

A RGUMENTS
sLayer Layer to be modified.
iVis Visiblity
0 Make layer invisible.
1 Make layer visible.

Show
Opens a diagram.
int [Link]()

R ETURNS
0 On success, no error occurred.
1 Otherwise

5.6.17 IntMat
Overview

ColLbl
Get
GetColumnLabel
GetNumberOfColumns
GetNumberOfRows
GetRowLabel

DIgSILENT PowerFactory 2018, Python Function Reference 345


Chapter 5. Object Methods

Init
Invert
Multiply
Resize
RowLbl
Save
Set
SetColumnLabel
SetRowLabel
SortToColumn

ColLbl
Deprecated function to get or set the label of the given column. Please use [Link]()
or [Link]() instead.
str [Link](int column)
str [Link](str label,
int column
)

Get
Returns the value at the position (row, column) of the matrix. A run-time error will occur when
'row' or 'column' is out of range.
float [Link](int row,
int column
)

A RGUMENTS
row Row in matrix: 1 ... GetNumberOfRows().
column column in matrix: 1 ... GetNumberOfColumn()

R ETURNS
Value in matrix.

S EE ALSO

[Link]()

GetColumnLabel
Returns the label of a column.
str [Link](int column)

A RGUMENTS
column Column index (first column has index 1).

R ETURNS
Column label of given column.

D EPRECATED N AMES
ColLbl

DIgSILENT PowerFactory 2018, Python Function Reference 346


Chapter 5. Object Methods

S EE ALSO

[Link](), [Link]()

GetNumberOfColumns
Returns the number of columns in the matrix.
int [Link]()

R ETURNS
The number of columns of the matrix.

D EPRECATED N AMES
NCol, SizeY

S EE ALSO

[Link]()

GetNumberOfRows
Returns the number of rows in the matrix.
int [Link]()

R ETURNS
The number of rows.

D EPRECATED N AMES
NRow, SizeX

S EE ALSO

[Link]()

GetRowLabel
Returns the label of a row.
str [Link](int row)

A RGUMENTS
row Row index (first row has index 1).

R ETURNS
Row label of given row.

D EPRECATED N AMES
RowLbl

S EE ALSO

[Link](), [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 347


Chapter 5. Object Methods

Init
Initializes the matrix with given size and values, regardless of the previous size and data.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
int [Link](int numberOfRows,
int numberOfColumns,
[float initialValue = 0.0]
)

A RGUMENTS
numberOfRows
The number of rows.
numberOfColumns
The number of columns.
initialValue (optional)
Initial values: All matrix entries are initialised with this value. Matrix is initialized
with 0 if ommited.

R ETURNS
Always 1 and can be ignored.

S EE ALSO

[Link]()

Invert
Inverts the matrix.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
int [Link]()

R ETURNS
0 Success, the matrix is replaced by its inversion.
1 Error, inversion not possible. Original matrix was not changed.

Multiply
Multiplies 2 matrixes and stores the result in this matrix.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
int [Link](DataObject M1,
DataObject M2
)

A RGUMENTS
object M1
Matrix 1 to be multiplied.

DIgSILENT PowerFactory 2018, Python Function Reference 348


Chapter 5. Object Methods

object M2
Matrix 2 to be multiplied.

R ETURNS
Always 0 and can be ignored.

Resize
Resizes the matrix to a given size. Existing values will not be changed. Added values will be
set to the optional value, otherwise to 0.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
int [Link](int numberOfRows,
int numberOfColumns,
[float initialValue = 0.0]
)

A RGUMENTS
numberOfRows
The number of rows.

numberOfColumns
The number of columns.
initialValue (optional)
Initial values: Additional matrix entries are initialised with this value. Additional
values are initialized with 0. if ommited.

R ETURNS
Always 1 and can be ignored.

S EE ALSO

[Link]()

RowLbl
Deprecated function to get or set the label of the given row. Please use [Link]()
or [Link]() instead.
str [Link](int row)
str [Link](str label,
int row
)

Save
Saves the current state of this matrix to database.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 349


Chapter 5. Object Methods

Set
Sets a value at the position (row, column) of the matrix. The matrix is resized automatically if
the given coordinates exceed the size.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
int [Link](int row,
int column,
float value
)

A RGUMENTS
row Row index, 1 based. The first row has index 1. Invalid index (leq0) leads to
scripting error.
column Column index, 1 based. The first column has index 1. Invalid index (leq0) leads to
scripting error.
value Value to assign.

R ETURNS
Always 1 and can be ignored.

S EE ALSO

[Link]()

SetColumnLabel
Sets the label of a column.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
None [Link](int column,
str label
)

A RGUMENTS
column Column index (first column has index 1).
label Label to set.

S EE ALSO

[Link](), [Link]()

SetRowLabel
Sets the label of a row.
This operation is performed in memory only. Use [Link]() to save the modified matrix to
database.
str [Link](int row,
str label
)

DIgSILENT PowerFactory 2018, Python Function Reference 350


Chapter 5. Object Methods

A RGUMENTS
row Row index (first row has index 1).
label Label to set.

S EE ALSO

[Link](), [Link]()

SortToColumn
Sorts the matrix alphanumerically according to a column, which is specified by the input param-
eter. The row labels are sorted accordingly (if input parameter storeInDB is 1).
int [Link](int columnIndex,
double epsilon = 0.0,
int storeInDB = 1)

D EPRECATED N AMES
SortToColum

A RGUMENTS
columnIndex
The column index, 1 based. The first column has index 1.

epsilon (optional)
Accuracy for comparing equal values. Values which differ less than epsilon are
treated as being equal. Default value is 0.
storeInDb (optional)
Possible Values:
0 Non-persistent change. Values are not stored in database.
1 Values are stored in database. (default)

R ETURNS
0 On success.
1 Error. Original matrix was not changed.

5.6.18 IntMon
Overview

AddVar
ClearVars
GetVar
NVars
PrintAllVal
PrintVal
RemoveVar

DIgSILENT PowerFactory 2018, Python Function Reference 351


Chapter 5. Object Methods

AddVar
Appends the variable “name” to the list of selected variable names.
None [Link](str name)

A RGUMENTS
name The variable name to add.

ClearVars
Clears the list of selected variable names.
None [Link]()

GetVar
Returns the variable name on the given row of the variable selection text on the second page of
the IntMon dialogue, which should contain one variable name per line.
str [Link](int row)

A RGUMENTS
row Given row

R ETURNS
The variable name in line row.

NVars
Returns the number of selected variables or, more exact, the number of lines in the variable
selection text on the second page of the IntMon dialogue, which usually contains one variable
name per line.
int [Link]()

R ETURNS
The number of variables selected.

PrintAllVal
Writes all calculation results of the object assigned in obj id to the output window. The output
includes the variable name followed by the value, its unit and the description.
It should be noted that the variable set itself is modified by this method.
None [Link]()

PrintVal
Prints the values of the selected variables to the output window.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 352


Chapter 5. Object Methods

RemoveVar
Removes the variable “name” from the list of selected variable names.
int [Link](str name)

A RGUMENTS
name The variable name.

R ETURNS
0 If variable with name was found and removed.
1 If the variable name was not found.

5.6.19 IntOutage
Overview

Apply
ApplyAll
Check
CheckAll
IsInStudyTime
ResetAll

Apply
None [Link]([int reportSwitches])

Applies the outage object. The functionality corresponds to pressing the ’Apply’ button in edit
dialog with the difference that the scripting function can also be used without an active scenario.
A RGUMENTS
reportSwitches (optional)
Flag to enable the reporting of changed switches to the output window.
0 No output (default)
1 Print switches to output window

ApplyAll
None [Link]([int reportSwitches])

Applies all currently relevant (=in study time and not out-of-service) outage objects of current
project. The functionality corresponds to pressing the ’ApplyAll’ button in edit dialog with the
difference that the scripting function can also be used without an active scenario. It applies all
relevant outages independent of the one it was called on.
A RGUMENTS
reportSwitches (optional)
Flag to enable the reporting of changed switches to the output window.
0 No output (default)
1 Print switches to output window

DIgSILENT PowerFactory 2018, Python Function Reference 353


Chapter 5. Object Methods

Check
int [Link]([int outputMessage])

This function checks if the outage is correctly reflected by the network elements.
A RGUMENTS
outputMessage (optional)
Flag to enable detailed output to the output window.
0 No output (default)
1 Detailed report of mismatch to output window

R ETURNS
0 Ok, outage is correctly reflected
1 Not ok, status of network elements does not reflect outage

CheckAll
This function checks if all outages are correctly reflected by the network components for current
study time. It checks all outages independent of the one it was called on.
[list notOutaged,
list wronglyOutaged] [Link]([int emitMsg,]
[DataObject gridfilter,])

A RGUMENTS
int emitMsg (optional)
whether to report inconistencies to the output window
-1 No output
0 (Default) print inconsistencies but without start / end message
1 Full output, including start / end message
gridfilter (optional)
Possibility to restrict checking for accidentally outaged elements to given object
(e.g. grid) and its children (by default, all elements for all active grids are checked).

notOutaged (optional, out)(optional)


If given, all network components that should be outaged but are not are filled into
this set.
wronglyOutaged (optional, out)(optional)
If given, all network components that should be outaged but are not are filled into
this set.

IsInStudyTime
int [Link]()

Checks if outage is relevant for current study time, i.e. the study time lies within the outage’s
validity period.
R ETURNS
0 Outage is not relevant for current study time (outside validity period)
1 Outage is relevant for current study time (inside validity period)

DIgSILENT PowerFactory 2018, Python Function Reference 354


Chapter 5. Object Methods

D EPRECATED N AMES
IsInStudytime

ResetAll
None [Link]([int reportSwitches])

Resets all currently relevant (=in study time and not out-of-service) outage objects of current
project. The functionality corresponds to pressing the ’Reset’ button in all outage objects with
difference that the scripting function can also be used without an active scenario. It resets all
relevant outages independent of the one it was called on.
A RGUMENTS
reportSwitches (optional)
Flag to enable the reporting of changed switches to the output window.
0 No output (default)
1 Print switches to output window

5.6.20 IntPlot
Overview

SetAdaptY
SetAutoScaleY
SetScaleY

SetAdaptY
Sets the Adapt Scale option of the x-scale.
None [Link](int mode,
[float offset]
)

A RGUMENTS
mode Possible values:
0 off
1 on

offset (optional)
Offset, unused if mode is off or empty

SetAutoScaleY
Sets automatic scaling mode of the y-scale. A warning is issued if an invalid mode is passed to
the function.
None [Link](int mode)

DIgSILENT PowerFactory 2018, Python Function Reference 355


Chapter 5. Object Methods

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

SetScaleY
Sets y-axis scale limits. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
None [Link]()
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of y-scale.

max (optional)
Maximum of y-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

5.6.21 IntPrj
Overview

Activate
AddProjectToCombined
AddProjectToRemoteDatabase
Archive
CanAddProjectToRemoteDatabase
CanSubscribeProjectReadOnly
CanSubscribeProjectReadWrite
CreateVersion
Deactivate
GetDerivedProjects
GetGeoCoordinateSystem
GetLatestVersion
GetVersions
HasExternalReferences
LoadData
Migrate
Purge

DIgSILENT PowerFactory 2018, Python Function Reference 356


Chapter 5. Object Methods

RemoveProjectFromCombined
Restore
SetGeoCoordinateSystem
SubscribeProjectReadOnly
SubscribeProjectReadWrite
TransformGeoCoordinates
UnsubscribeProject
UpdateStatistics

Activate
Activates the project. If another project is already activated it will be deactivated first.
int [Link]()

R ETURNS
0 on success
1 on error

AddProjectToCombined
Adds a project to this using the Project Combination logic. The passed object must be an
IntVersion. The receiving project must be activated but not have a Study Case active, otherwise
this method will fail.
int [Link](object projectVersion)

A RGUMENTS
projectVersion
The verson of a project to add

R ETURNS
0 operation was successful
1 an error occurred

AddProjectToRemoteDatabase
Adds a project to the online database if possible.
Can only be used if the database driver is set to Offline Mode.
int [Link]()

Archive
Archives the project if the functionality is configured and activated. Does nothing otherwise.
int [Link]()

R ETURNS
0 project has been archived
1 project has not been archived

DIgSILENT PowerFactory 2018, Python Function Reference 357


Chapter 5. Object Methods

CanAddProjectToRemoteDatabase
Checks if the project can be pushed to the remote database.
The project must be subscribable as read and write and it must be unsubscribed. Can only be
used if the database driver is set to Offline Mode.
int [Link]()

R ETURNS
0 project cannot be added to the remote database
1 project can be added to the remote database

CanSubscribeProjectReadOnly
Checks if a project can be subscribed read-only by the user executing the script.
int [Link]()

R ETURNS
0 no permission to subscribe project
1 project can be subscribed

CanSubscribeProjectReadWrite
Checks if a project can be subscribed read-write by the user executing the script.
int [Link]()

R ETURNS
0 no permission to subscribe project
1 project can be subscribed

CreateVersion
Creates a new version of project it was called on.
Optionally allows to pass a bool to enforce project approval and user notifications, and version
name.
DataObject [Link]([int notifyUsersAndApprovalRequired [, str name]])

A RGUMENTS
notifyUsersAndApprovalRequired
Project approval required and user notifications activated:
0 Create version without approval and do not notify users (default).
1 Require approval and notify users.
name Version name

DIgSILENT PowerFactory 2018, Python Function Reference 358


Chapter 5. Object Methods

R ETURNS
DataObject Newly created IntVersion object.
None On failure e.g. missing permission rights.

Deactivate
De-activates the project if it is active. Does nothing otherwise.
int [Link]()

R ETURNS
0 on success
1 on error

GetDerivedProjects
Return a set holding all versions created in the project.
list [Link]()

R ETURNS
Set holding all versions of a project.

GetGeoCoordinateSystem
Returns the EPSG code of the geographic coordinate system in which the geo coordinates of
the project’s net elements are stored.
int [Link]()

R ETURNS
EPSG code of the project’s geographic coordinate system, or 0 if the coordinate system is
not known.

GetLatestVersion
Returns the most recent version available in the project which has the notify users option set.
Optionally allows to consider all versions, regardless of notify users option.
DataObject [Link]([int onlyregular])

A RGUMENTS
onlyregular (optional)
1 consider only regular version (default)
0 consider all versions

R ETURNS
Latest version of the project

DIgSILENT PowerFactory 2018, Python Function Reference 359


Chapter 5. Object Methods

GetVersions
Returns a set containing all versions of the project.
list [Link]()

R ETURNS
Set that contains all versions of the project

HasExternalReferences
Checks if any object inside the project references external non-system objects and prints a
report to the Output Window.
int [Link]([int iCheckGlobal,]
[int iCheckRemoteVariants]
)

A RGUMENTS
iCheckGlobal (optional)
0 global (non-system) references are ok
1 gloabal (non-system) references are not ok (default)
iCheckRemoteVariants (optional)
0 remote variants are ok (default)
1 remote variants are not ok

R ETURNS
0 no forbidden external references found
1 some forbidden external references were found

LoadData
Loads all objects of the project from the data base.
This function is useful to optimise searches which would traverse deep into an inactive project.
None [Link]()

Migrate
Migrates a project from version V13 to V14. Migration is only executed if project has been
created in build 400 or earlier (and is not yet migrated).
None [Link]([int createCopy])

A RGUMENTS
createCopy (optional)
1 Creates a copy of current project (original copy is maintained) (default)
0 Does an ”in-place” migration of the project (original is overwritten)

DIgSILENT PowerFactory 2018, Python Function Reference 360


Chapter 5. Object Methods

Purge
Purges project storage and updates storage statistics.
Requires write access to the project; the functions does nothing when the project is locked by
another user.
None [Link]()

RemoveProjectFromCombined
Removes a project from a combined project. For the removal the mapping key must be specified.
Mapping keys are stored in the project, parameter project mapped. The project this method is
called on must be activated but not have a Study Case active, otherwise this method will fail.
int [Link](str mappingKey)

A RGUMENTS
mappingKey
The mapping key for the project that should be removed

R ETURNS
0 operation was successful
1 an unknown error occurred
2 an error occurred and is documented in the output window

Restore
Restores an archived project so it can be used again. Does nothing if the project is not an
archived one.
int [Link]()

R ETURNS
0 project has not been restored
1 project has been restored

SetGeoCoordinateSystem
Defines the the geographic coordinate system in which the geo coordinates of the project’s net
elements are stored.
None [Link](int epsgCode)

A RGUMENTS
epsgCode
EPSG code of the geographic coordinate system to be used for this project. A
value of 0 denotes an unknown coordinate system.

DIgSILENT PowerFactory 2018, Python Function Reference 361


Chapter 5. Object Methods

SubscribeProjectReadOnly
Subscribes a project read only if the permission is granted.
Can only be used if the database driver is set to Offline Mode.
None [Link]()

SubscribeProjectReadWrite
Subscribes a project read/write if the permission is granted.
Can only be used if the database driver is set to Offline Mode.
None [Link]()

TransformGeoCoordinates
Transforms geographic coordinates from a source coordinate system to a destination coordinate
system. Geodetic coordinates (longitude/latitude) are specified in decimal degrees. Projected
coordinates are specified in meters.
int [Link](double xIn, double yIn,
double& xOut, double& yOut,
int sourceEpsg, int destEpsg
)

A RGUMENTS
xIn horizontal component of the input location: x position or longitude, resp.
yIn vertical component of the input location: y position or latitude, resp.

xOut (out)
horizontal component of the output location: x position or longitude, resp.
yOut (out)
vertical component of the output location: y position or latitude, resp.
sourceEpsg
EPSG code of the source coordinate system
destEpsg EPSG code of the destination coordinate system

R ETURNS
0 operation was successful
1 an error occurred

UnsubscribeProject
Unsubscribes a project.
Can only be used if the database driver is set to Offline Mode.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 362


Chapter 5. Object Methods

UpdateStatistics
Updates the storage statistics for a project. The statistics are displayed on the page Storage of
a project.
Note: This function requires write access to the project otherwise the update is not executed
and an error message is printed to the output window.
None [Link]()

5.6.22 IntPrjfolder
Overview

GetProjectFolderType
IsProjectFolderType

GetProjectFolderType
Returns the type of the project folder stored in attribute “iopt type”.
The following types are currently available (language independent):

• blk - User Defined Models


• cbrat - CB Ratings
• chars - Characteristics
• cim - CIM Model
• common - Common Mode Failures
• demand - Demand Transfers
• dia - Diagrams
• equip - Equipment Type Library
• fault - Faults
• ras - Remedial Action Schemes
• gen - Generic
• lib - Library
• mvar - Mvar Limit Curves
• netdat - Network Data
• netmod - Network Model
• oplib - Operational Library
• outage - Outages
• qpc - QP-Curves
• ra - Running Arrangements
• report - Table Reports
• scen - Operation Scenarios

DIgSILENT PowerFactory 2018, Python Function Reference 363


Chapter 5. Object Methods

• scheme - Variations

• script - Scripts
• study - Study Cases
• sw - StationWare

• tariff - Tariffs
• templ - Templates
• therm - Thermal Ratings

str [Link]()

R ETURNS
The type of the project folder as string. For possible return values see list above.

S EE ALSO

[Link]()

IsProjectFolderType
This function checks if a project folder is of given type.
int [Link](str type)

A RGUMENTS
type Folder type; for possible type values see [Link]()

R ETURNS
1 true, is of given type
0 false, is not of given type

S EE ALSO

[Link](), [Link]()

5.6.23 IntQlim
Overview

GetQlim

GetQlim
Returns either the current maximum or the minimum reactive power limit, given the specified
active power and voltage.
The active power must be given in the same units as the input mode definition of the capability
curve object (parameter ”inputmod” is 0 for MW/Mvar and 1 for p.u.).
float [Link](float p,
float v,
[float minmax]
)

DIgSILENT PowerFactory 2018, Python Function Reference 364


Chapter 5. Object Methods

A RGUMENTS
p the current value of active power in MW or p.u.
v the current value of voltage in p.u.
minmax (optional)
Returns either the maximum or minimum value. Possible values are:
0 minimum value. This is the default value
1 maximum value

R ETURNS
Returns the minimum/maximum limit. The units might be Mvar or p.u., depending on the
input mode of the capability curve. Also, the limits are calculated for a single machine.

5.6.24 IntRas
Overview

AddEvent
AddTrigger
IsValid

AddEvent
Adds an event to the Remedial Action Scheme.
list [Link](DataObject newEvent)

A RGUMENTS
newEvent
The event that shall be added.

AddTrigger
Adds either a condition or a gate to the Remedial Action Scheme.
list [Link](DataObject newTrigger)

A RGUMENTS
newTrigger
The condition or gate that shall be added.

IsValid
Checks if the Remedial Action Scheme is valid.
int [Link](int emitMessage = 0)

A RGUMENTS
emitMessage
Emit messages if not equal to zero.

DIgSILENT PowerFactory 2018, Python Function Reference 365


Chapter 5. Object Methods

R ETURNS
0 If invalid.
1 If valid.

5.6.25 IntRunarrange
Overview

GetSwitchStatus

GetSwitchStatus
Determines the status of the given switch in the running arrangement, without assigning or
applying the running arrangement.
int GetSwitchStatus(DataObject switch)

A RGUMENTS
switch ElmCoup or StaSwitch from which to get the status stored in running arrange-
ment

R ETURNS
Status of the switch in the running arrangement. Possible values are

-1 Switch is not part of the running arrangment


0 Switch is open
1 Switch is closed

5.6.26 IntScenario
Overview

Activate
Apply
ApplySelective
Deactivate
DiscardChanges
GetObjects
GetOperationValue
ReleaseMemory
Save
SetOperationValue

DIgSILENT PowerFactory 2018, Python Function Reference 366


Chapter 5. Object Methods

Activate
Activates a scenario. If there is currently another scenario active that one will be deactivated
automatically.
int [Link]()

R ETURNS
0 successfully activated
1 error, e.g. already activate, no project and study case active

Apply
Copies the values stored in a scenario to the corresponding network elements. The value
transfer is identical to scenario activation, however, the scenario will not be activated. In case of
having an active variation or another scenario, the values will be recorded there.
int [Link]([int requestUserConfirmation])
int [Link](int requestUserConfirmation,
DataObject parentfilter
)

A RGUMENTS
requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)
parentfilter (optional)
If given, scenario data is only applied for given object and all of its children (hier-
archical filter)

R ETURNS
0 on success

ApplySelective
Similar to function Apply() but copies only the set of attributes listed in the given apply configu-
ration. An apply configuration is a folder consisting of variable selection objects (IntMon), one
per class. For each class the attributes to be copied can be selected.
int [Link](DataObject configuration)
int [Link](int requestUserConfirmation,
DataObject applyConfiguration
)

A RGUMENTS
applyConfiguration
folder containing variable selection objects

requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

DIgSILENT PowerFactory 2018, Python Function Reference 367


Chapter 5. Object Methods

R ETURNS
0 on succes

Deactivate
Deactivates the currently active scenario.
int [Link]([int saveOrUndo])

A RGUMENTS
saveOrUndo(optional)
Determines whether changes in active scenario will be saved or discarded before
the scenario is deactivated. If this argument is omitted, the user will be asked.
0 discard changes
1 save changes

R ETURNS
0 on success

DiscardChanges
Discards all unsaved changes made to a scenario.
int [Link]()

R ETURNS
0 on success
1 error, scenario was not modified or not active

GetObjects
Returns a set of all objects for which operational data are stored in scenario.
list [Link]()

R ETURNS
Set of all objects for which operational data are stored in scenario

GetOperationValue
This function offers read access to the operation data values stored in the scenario.
[int error,
int|float|str|DataObject value] [Link](DataObject obj,
str attribute,
[int fromObject])

DIgSILENT PowerFactory 2018, Python Function Reference 368


Chapter 5. Object Methods

A RGUMENTS
value (out)
variable that holds the value after call
obj object for which the operation to be retrieved

attribute name of the operation data attribute


fromObject
only if current scenario is active:
0 value is taken from scenario (as stored on db)
1 (default), value is taken from object (reflects un-saved modifications)

R ETURNS
0 on success

ReleaseMemory
Releases the memory used by a scenario. Any further access to the scenario will reload the
data from database. The function can be called on inactive scenarios only. Use this function
with care!
int [Link]()

R ETURNS
0 on success
1 error, scenario is active

Save
Saves the current active value of all operational attributes for all active network elements to
database.
int [Link]()

R ETURNS
0 successfully saved
1 error, scenario was not modified or not active

SetOperationValue
Offers write access to operational data stored in a scenario.
int [Link](float newvalue,
DataObject obj,
str attribute,
[int toObject]
)
int [Link](int newvalue,
DataObject obj,
str attribute,
[int toObject]

DIgSILENT PowerFactory 2018, Python Function Reference 369


Chapter 5. Object Methods

)
int [Link](str newvalue,
DataObject obj,
str attribute,
[int toObject]
)
int [Link](DataObject newvalue,
DataObject obj,
str attribute,
[int toObject]
)

A RGUMENTS
newvalue new value to store in the scenario
obj object for which the operation data to store

attribute name of the operation data attribute


toObject only if current scenario is active:
0 value is only stored to scenario on db
1 (default), as 0 but value is also updated on object in memory

R ETURNS
0 on success

5.6.27 IntScensched
Overview

Activate
Deactivate
DeleteRow
GetScenario
GetStartEndTime
SearchScenario

Activate
Activates a scenario scheduler.
int [Link]()

R ETURNS
0 successfully activated
1 error, e.g. already activate, no project and study case active

Deactivate
Deactivates a scenario scheduler.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 370


Chapter 5. Object Methods

R ETURNS
0 successfully deactivated
1 error, e.g. already deactivates, no project and study case active

DeleteRow
Delete row(s) of the scenario scheduler.
None [Link](int row, [int numberOfRows])

A RGUMENTS
row row number (begin with 0)
numberOfRows (optional)
number of rows to delete (default = 1)

GetScenario
Get the scenario for corresponding time 'iTime'.
DataObject [Link](int iTime)

A RGUMENTS
iTime Time (UCTE) to get the corresponding scenario.

R ETURNS
None No scenario at time 'iTime'defined
IntScenario Scenario will be activated at time 'iTime'

GetStartEndTime
Gets the start and end time of the corresponding scenario.
[int error
int startTime,
int endTime ] [Link](DataObject scenario)

A RGUMENTS
scenario A scenario (IntScenario).
startTime (out)
Start time (time when the scenario is activated)).

endTime (out)
End time (time until the scenario is still activated).

R ETURNS
−1 Scenario not found (not part of scenario scheduler)
≥0 Vector index (index of scenario)

DIgSILENT PowerFactory 2018, Python Function Reference 371


Chapter 5. Object Methods

SearchScenario
Search at which table index (row) the corresponding scenario is defined in the scheduler.
int [Link](DataObject scenarioObject)

A RGUMENTS
scenarioObject
scenario object

R ETURNS
−1 Scenario not found (not part of scenario scheduler).
≥0 Vector index (row, index of scenario).

5.6.28 IntScheme
Overview

Activate
Consolidate
Deactivate
GetActiveScheduler
NewStage

Activate
Activates a variation and inserts a variation reference in a 'Variation Configuration Folder'stored
in the study case.
int [Link]()

R ETURNS
0 successfully activated
1 error, e.g. already activate, no project and study case active

Consolidate
Changes that are recorded in this variation will be permanently applied to the original location.
Note: Modified scenarios are not saved.
Works only:

• for non network variation e.g. used for Mvar Limit Curves, Thermal Ratings ...
• and the variation must be activated.

int [Link]()

R ETURNS
0 On success.
1 If an error has occured.

DIgSILENT PowerFactory 2018, Python Function Reference 372


Chapter 5. Object Methods

Deactivate
Deactivates a variation and removes the variation reference in the 'Variation Configuration
Folder'stored in the study case.
int [Link]()

R ETURNS
0 successfully deactivated
1 error, e.g. already deactivated, no project and study case active

GetActiveScheduler
Returns the corresponding active variation scheduler or None if no scheduler is active for this
variation (IntScheme).
DataObject [Link]()

NewStage
Adds a new expansion stage into the variation (name = sname).
int [Link](str sname,
int iUTCtime,
int iActivate
)

A RGUMENTS
sname Name of the new expansion stage.
iUTCtime Activation time of the new expansion stage.
iActivate
1 The actual study time is changed to the parameter iUTCtime and the
varation will be activated. If the variation is a network variation, the
new created expansion stage is used as 'recording 'expansion stage.
If the variation (this) is not active, the variation will be automatically
activated.
0 Expansion stage and/or variation will not be activated.

5.6.29 IntSscheduler
Overview

Activate
Deactivate
Update

DIgSILENT PowerFactory 2018, Python Function Reference 373


Chapter 5. Object Methods

Activate
Activates a variation scheduler. An already activated scheduler for same variation will be deac-
tivated automatically.
int [Link]()

R ETURNS
=0 On success
6= 0 If an error has occurred

Deactivate
Deactivates a variation scheduler.
int [Link]()

R ETURNS
=0 on success
6= 0 If an error has occurred especially if scheduler was not active (to be consistent
with scenario scheduler deactivate()).

Update
Update variation scheduler (updates internal reference stages).
int [Link]()

R ETURNS
=0 On success
6= 0 If an error has occurred

5.6.30 IntSstage
Overview

Activate
CreateStageObject
EnableDiffMode
GetVariation
IsExcluded
PrintModifications
ReadValue
WriteValue

Activate
Activates the expansion stage and sets the 'recording' expansion stage. The study time will be
automatically set to the correponsing time of the stage.
int [Link]([int iQueryOption])

DIgSILENT PowerFactory 2018, Python Function Reference 374


Chapter 5. Object Methods

A RGUMENTS
iQueryOption
0 (default) The user must confirm the query.
1 The “Yes” button is automatically applied.
2 The “No” button is automatically applied.

R ETURNS
0 Successfully activated.
1 Error, e.g. scheme is not active.

CreateStageObject
Creates a stage object (delta or delete object) inside corresponding IntSstage.
DataObject [Link](int type,
DataObject rootObject
)

A RGUMENTS
type Kind of object to create
1 Delete object
2 Delta object
rootObject
(Original) object for which the stage object should be created.

R ETURNS
Stage object on success.

EnableDiffMode
Enables the comparison mode for the variation management system. If the mode is enabled a
DELTA object is only created when the object is different.
None [Link](int enable)

A RGUMENTS
enable
0 disables the difference/comparison mode
1 enables the difference/comparison mode

GetVariation
Returns variation of expansion stage.
DataObject [Link]()

R ETURNS
Variation object corresponding to stage.

DIgSILENT PowerFactory 2018, Python Function Reference 375


Chapter 5. Object Methods

D EPRECATED N AMES
GetScheme

IsExcluded
Returns if expansion stage flag 'Exclude from Activation' is switched on (return value = 1) or not
(return value = 0). The function checks also if the stage is excluded regarding the restricted
validity period of the corresponding variation and considers also the settings of an variation
scheduler when defined.
float [Link]()

R ETURNS
1 if stage is excluded
0 if stage is considered

PrintModifications
Reports in the the output window the modification of the corresponding expansion stage. Works
only if the expansion stage is the active 'recording 'expansion stage.
int [Link]([int onlyNetworkData,]
[str ignoredParameter]
)

A RGUMENTS
onlyNetworkData (optional)
1 (default) Show only network data modifications. Graphical modifica-
tions are not report when the diagrams folder are recored.
0 Show all modifications

ignoredParameter (optional)
Comma separated list of parameters which are ignored for reporting.

R ETURNS
0 on success
1 if the actual expansion stage is not the 'recording 'expansion stage.

ReadValue
Get the value for an attribute of an ADD or DELTA object which modifies “rootObj” (root object).
[int error,
float|str|DataObject value] [Link](DataObject rootObj,
str attributeName)

R ETURNS
=0 On success.
6= 0 Error e.g. wrong data type.

DIgSILENT PowerFactory 2018, Python Function Reference 376


Chapter 5. Object Methods

WriteValue
Writes a value for an attribute to an ADD or DELTA object which modifies rootObj (root object).
int [Link](float|str|DataObject value,
DataObject rootObj,
str attributeName)

R ETURNS
=0 On success.
6= 0 Error e.g. wrong data type.

5.6.31 IntSubset
Overview

Apply
ApplySelective
Clear

Apply
Copies the values stored in a scenario to the corresponding network elements. The value
transfer is identical to scenario activation, however, the scenario will not be activated. In case of
having an active variation or another scenario, the values will be recorded there.
int [Link]([int requestUserConfirmation])

A RGUMENTS
requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

R ETURNS
0 on success

ApplySelective
Similar to function Apply() but copies only the set of attributes listed in the given apply configu-
ration. An apply configuration is a folder consisting of variable selection objects (IntMon), one
per class. For each class the attributes to be copied can be selected.
int [Link](DataObject applyConfiguration)
int [Link](int requestUserConfirmation,
DataObject applyConfiguration
)

A RGUMENTS
applyConfiguration
folder containing variable selection objects
requestUserConfirmation(optional)
0 silent, just apply the data without further confirmation requests
1 request a user confirmation first (default)

DIgSILENT PowerFactory 2018, Python Function Reference 377


Chapter 5. Object Methods

R ETURNS
0 on succes

Clear
Clears all values stored in the subset.
Please note that this function can only be called on subsets of currently in-active scenarios.
int [Link]()

R ETURNS

0 On success.
1 On error, e.g. subset belongs to a currently active scenario.

5.6.32 IntThrating
Overview

GetCriticalTimePhase
GetRating

GetCriticalTimePhase
This function returns the smallest duration (time-phase) for which the power flow is beyond the
rating.
float [Link](float Flow,
float Loading
)

A RGUMENTS
Flow Power from the load flow calculation, in MVA.
Loading Element loading, in %.

R ETURNS
>0 Smallest time-phase for which the flow is beyond the rating.
-1 In case that no rating is violated.

GetRating
This function returns the rating in MVA according to the thermal rating table, considering element
overloading and its duration (time-phase).
float [Link](float Loading,
float Duration
)

A RGUMENTS
Loading Element loading, in %.
Duration Duration or time phase for which the loading is considered, in minutes

DIgSILENT PowerFactory 2018, Python Function Reference 378


Chapter 5. Object Methods

R ETURNS
Rating in MVA or 0 if not found.

5.6.33 IntUrl
Overview

View

View
Requests the operating system to open given URL for viewing. The performed action depends
on the default action configured in the system. For example, by default '[Link]
would be opened in standard browser.
Please note, the action is only executed if access to given URL is enabled in the 'External
Access' configuration of PowerFactory (IntExtaccess).
int [Link]()

R ETURNS
The returned value reports the success of the operation:

0 Success, URL was opened


1 Error, URL was not opened (because of invalid address or security reasons)

5.6.34 IntUser
Overview

Purge
SetPassword
TerminateSession

Purge
Purges project storage and updates storage statistics for all projects of the user.
Requires write access to the project; the functions does nothing when the project is locked by
another user.
None [Link]()

SetPassword
Sets the password for the user the function is called on.
Note: A normal user is allowed to set the password for himself only. The administrator user is
allowed to set passwords for every user.
None [Link](str newpassword)

DIgSILENT PowerFactory 2018, Python Function Reference 379


Chapter 5. Object Methods

A RGUMENTS
newpassword
Case sensitive user password to set

TerminateSession
Allows the Administrator to log out another user. Prints an error if the current user is not the
Administrator.
None [Link]()

5.6.35 IntUserman
Overview

CreateGroup
CreateUser
GetGroups
GetUsers
UpdateGroups

CreateGroup
Creates a new user group of given name. If a group with given name already exists the existing
one is returned instead.
Note: Only Administrator user is allowed to call this function.
DataObject [Link](str name)

A RGUMENTS
name Given name of the user group

R ETURNS
Created user group (IntGroup)

CreateUser
Creates a new user with given name. If the user already exists the existing one is returned
instead.
Note: Only Administrator user is allowed to call this function.
DataObject [Link](str name)

A RGUMENTS
name Given name of the user

R ETURNS
Created user (IntUser)

DIgSILENT PowerFactory 2018, Python Function Reference 380


Chapter 5. Object Methods

GetGroups
Returns a container with all user groups.
Note: Only the administrator user is allowed to call this function.
list [Link]()

R ETURNS
Set of all available users

GetUsers
Returns a container with all users as they are currently visible in the Data Manager tree.
Note: Only the administrator user is allowed to call this function.
list [Link]()

R ETURNS
Set of all available users

UpdateGroups
Updates the Everybody group so it contains all currently existing users and cleans it of removed
users.
None [Link]()

5.6.36 IntVec
Overview

Get
Init
Max
Mean
Min
Resize
Save
Set
Size
Sort

Get
Get the value in row index. Index is one based, therefore the index of the first entry is 1.
float [Link](int index)

A RGUMENTS
index Index in vector, one based.

DIgSILENT PowerFactory 2018, Python Function Reference 381


Chapter 5. Object Methods

S EE ALSO

[Link]()

Init
Initializes the vector. Resizes the vector and initializes all values to 0.
This operation is performed in memory only. Use [Link]() to save the modified vector to
database.
None [Link](int size)

A RGUMENTS
size The new size of the vector.

Max
Gets the maximum value stored in the vector.
float [Link]()

R ETURNS
The maximum value stored in the vector. Empty vectors return 0 as maximum value.

Mean
Calculates the average value of the vector.
float [Link]()

R ETURNS
The average value of the vector. A value of 0. is returned for empty vectors.

Min
Gets the minimum value stored in the vector.
float [Link]()

R ETURNS
The minimum value stored in the vector. Empty vectors return 0 as minimum value.

Resize
Resizes the vector. Inserted values are initialized to 0.
This operation is performed in memory only. Use [Link]() to save the modified vector to
database.
None [Link](int size)

DIgSILENT PowerFactory 2018, Python Function Reference 382


Chapter 5. Object Methods

A RGUMENTS
size The new size.

Save
Saves the current state of this vector to database.
None [Link]()

Set
Set the value in row index. Index is one based, therefore the index of the first entry is 1.
The vector is resized automatically to size index in case that the index exceeds the current
vector size. Values inserted are automatically initialized to a value of 0.
This operation is performed in memory only. Use [Link]() to save the modified vector to
database.
None [Link](int index,
float value)

A RGUMENTS
index Index in vector.
value Value to assign in row index.

S EE ALSO

[Link]()

Size
Returns the size of the vector.
int [Link]()

R ETURNS
The size of the vector.

Sort
Sorts the vector.
This operation is performed in memory only. Use [Link]() to save the modified vector to
database.
None [Link]([int descending = 0]

A RGUMENTS
descending
Sort order:
0 Smallest value first (ascending, default).
1 Highest value first (descending).

DIgSILENT PowerFactory 2018, Python Function Reference 383


Chapter 5. Object Methods

5.6.37 IntVersion
Overview

CreateDerivedProject
GetDerivedProjects
GetHistoricalProject
Rollback

CreateDerivedProject
Creates a derived project from the version.
DataObject [Link](str name,
[DataObject parent]
)

A RGUMENTS
name The name of the project which will be created.
parent(optional)
The parent of the project which will be created. Default is the current user.

R ETURNS
Returns the created project.

GetDerivedProjects
list of projects derived from this version
list [Link]()

R ETURNS
list of derived projects

GetHistoricalProject
Returns historic project within version
DataObject [Link]()

R ETURNS
Returns the historic project object

Rollback
Roll backs the project to this version. No project have to be active. Furthermore no script from
the project of the version have to be running.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 384


Chapter 5. Object Methods

R ETURNS
0 on success
1 otherwise

5.6.38 IntViewbookmark
Overview

JumpTo
UpdateFromCurrentView

JumpTo
Opens the referenced diagram (if not already open) and sets the viewing area.
None [Link]()

UpdateFromCurrentView
Updates the bookmark’s diagram and view area from the current drawing window.
None [Link]()

5.6.39 RelZpol
Overview

AssumeCompensationFactor
AssumeReRl
AssumeXeXl

AssumeCompensationFactor
Triggers a calculation of the complex compensation factor and stores the result.
int [Link]()

R ETURNS
0 The compensation factor was sucessfully calculated.
1 An error occourred (e.g. conencted branch was not found).

AssumeReRl
Triggers a calculation of the real part of the decoupled compensation factor and stores the
result.
int [Link]()

R ETURNS
0 The compensation factor was sucessfully calculated.

DIgSILENT PowerFactory 2018, Python Function Reference 385


Chapter 5. Object Methods

1 An error occourred (e.g. conencted branch was not found).

AssumeXeXl
Triggers a calculation of the imaginary part of the decoupled compensation factor and stores
the result.
int [Link]()

R ETURNS
0 The compensation factor was sucessfully calculated.
1 An error occourred (e.g. conencted branch was not found).

5.6.40 ScnFreq
Overview

GetLimit
GetNumberOfViolations
GetValue
GetVariable
GetViolatedElement
GetViolationTime

GetLimit
Returns the limit value (in p.u.) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value (in p.u.) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

GetNumberOfViolations
Returns the number of violations.
int [Link]()

R ETURNS
The number of violations.

GetValue
Returns the ith value (in p.u.), given by vIdx, which causes the violation.
double [Link](int vIdx)

DIgSILENT PowerFactory 2018, Python Function Reference 386


Chapter 5. Object Methods

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value (in p.u.), given by vIdx, which causes the violation. If vIdx is negative, zero or
greater than the number of violations, then the function returns ’nan’.

GetVariable
Returns the name of the variable of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

GetViolatedElement
Returns name of the element of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the element of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoElement”.

GetViolationTime
Returns the time (in seconds) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

DIgSILENT PowerFactory 2018, Python Function Reference 387


Chapter 5. Object Methods

5.6.41 ScnFrt
Overview

GetLimit
GetNumberOfViolations
GetValue
GetVariable
GetViolatedElement
GetViolationTime

GetLimit
Returns the limit value of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns ’nan’.

GetNumberOfViolations
Returns the number of violations.
int [Link]()

R ETURNS
The number of violations.

GetValue
Returns the ith value, given by vIdx, which causes the violation.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value, given by vIdx, which causes the violation. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

GetVariable
Returns the name of the variable of the ith violation, given by vIdx.
str [Link](int vIdx)

DIgSILENT PowerFactory 2018, Python Function Reference 388


Chapter 5. Object Methods

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

GetViolatedElement
Returns name of the element of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
Returns name of the element of the ith violation, given by vIdx. If vIdx is negative, yero or
greater to the number of violations, then the function returns a ”NoElement”.

GetViolationTime
Returns the time (in seconds) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

5.6.42 ScnSpeed
Overview

GetLimit
GetNumberOfViolations
GetValue
GetVariable
GetViolatedElement
GetViolationTime

GetLimit
Returns the limit value (in p.u.) of the ith violation, given by vIdx.
double [Link](int vIdx)

DIgSILENT PowerFactory 2018, Python Function Reference 389


Chapter 5. Object Methods

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value (in p.u.) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

GetNumberOfViolations
Returns the number of violations.
int [Link]()

R ETURNS
The number of violations.

GetValue
Returns the ith value (in p.u.), given by vIdx, which causes the violation.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value (in p.u.), given by vIdx, which causes the violation. If vIdx is negative, zero or
greater than the number of violations, then the function returns ’nan’.

GetVariable
Returns the name of the variable of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

GetViolatedElement
Returns name of the element of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

DIgSILENT PowerFactory 2018, Python Function Reference 390


Chapter 5. Object Methods

R ETURNS
The name of the element of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoElement”.

GetViolationTime
Returns the time (in seconds) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

5.6.43 ScnSync
Overview

GetLimit
GetNumberOfViolations
GetValue
GetVariable
GetViolatedElement
GetViolationTime

GetLimit
Returns the limit value of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns ’nan’.

GetNumberOfViolations
Returns the number of violations.
int [Link]()

R ETURNS
The number of violations.

DIgSILENT PowerFactory 2018, Python Function Reference 391


Chapter 5. Object Methods

GetValue
Returns the ith value, given by vIdx, which causes the violation.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value, given by vIdx, which causes the violation. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

GetVariable
Returns the name of the variable of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

GetViolatedElement
Returns name of the element of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the element of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoElement”.

GetViolationTime
Returns the time (in seconds) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

DIgSILENT PowerFactory 2018, Python Function Reference 392


Chapter 5. Object Methods

5.6.44 ScnVar
Overview

GetLimit
GetNumberOfViolations
GetValue
GetVariable
GetViolatedElement
GetViolationTime

GetLimit
Returns the limit value of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value of the ith violation, given by vIdx. If vIdx is negative, zero or greater than the
number of violations, then the function returns ’nan’.

GetNumberOfViolations
Returns the number of violations.
int [Link]()

R ETURNS
The number of violations.

GetValue
Returns the ith value, given by vIdx, which causes the violation.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value, given by vIdx, which causes the violation. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

GetVariable
Returns the name of the variable of the ith violation, given by vIdx.
str [Link](int vIdx)

DIgSILENT PowerFactory 2018, Python Function Reference 393


Chapter 5. Object Methods

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

GetViolatedElement
Returns name of the element of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the element of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoElement”.

GetViolationTime
Returns the time (in seconds) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

5.6.45 ScnVolt
Overview

GetLimit
GetNumberOfViolations
GetValue
GetVariable
GetViolatedElement
GetViolationTime

GetLimit
Returns the limit value (in p.u.) of the ith violation, given by vIdx.
double [Link](int vIdx)

DIgSILENT PowerFactory 2018, Python Function Reference 394


Chapter 5. Object Methods

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The limit value (in p.u.) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

GetNumberOfViolations
Returns the number of violations.
int [Link]()

R ETURNS
The number of violations.

GetValue
Returns the ith value (in p.u.), given by vIdx, which causes the violation.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The ith value (in p.u.), given by vIdx, which causes the violation. If vIdx is negative, zero or
greater than the number of violations, then the function returns ’nan’.

GetVariable
Returns the name of the variable of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The name of the variable of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoVariable”.

GetViolatedElement
Returns name of the element of the ith violation, given by vIdx.
str [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

DIgSILENT PowerFactory 2018, Python Function Reference 395


Chapter 5. Object Methods

R ETURNS
The name of the element of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ”NoElement”.

GetViolationTime
Returns the time (in seconds) of the ith violation, given by vIdx.
double [Link](int vIdx)

A RGUMENTS
vIdx vIdx > 0

R ETURNS
The time (in seconds) of the ith violation, given by vIdx. If vIdx is negative, zero or greater
than the number of violations, then the function returns ’nan’.

5.6.46 StoMaint
Overview

SetElms

SetElms
Sets the maintenance elements.
None [Link](DataObject singleElement)
None [Link](list multipleElements)

A RGUMENTS
singleElement
single Element for Maintenance
multipleElements
multiple Elements for Maintenance

5.6.47 TypAsmo
Overview

CalcElParams

CalcElParams
Function calculates the electrical parameters from the input data. Behaves identically as the cal-
culate button on the basic data page was pressed. Shall be applied only if the ’Slip-Torque/Current
Characteristic’ chosen.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 396


Chapter 5. Object Methods

R ETURNS
0 Calculated successfully.
1 Error.

5.6.48 TypLne
Overview

IsCable

IsCable
Checks if the line type is a cable type.
int [Link]()

R ETURNS
1 Type is a cable
0 Type is not a cable

5.6.49 TypTr2
Overview

GetZeroSequenceHVLVT

GetZeroSequenceHVLVT
Returns the calculated star equivalent of the zero sequence impedances.
[int error,
float hvReal,
float hvImag,
float lvReal,
float lvImag,
float tReal ,
float tImag ] [Link]()

A RGUMENTS
hvReal (out)
Real part of the HV impedance in %.
hvImag (out)
Imaginary part of the HV impedance in %.
lvReal (out)
Real part of the LV impedance in %.
lvImag (out)
Imaginary part of the LV impedance in %.

tReal (out)
Real part of the tertiary (delta) impedance in %.

DIgSILENT PowerFactory 2018, Python Function Reference 397


Chapter 5. Object Methods

tImag (out)
Imaginary part of the tertiary (delta) impedance in %.

R ETURNS
0 No error occurred.
1 An error occurred; the values are invalid.

5.6.50 VisBdia
Overview

AddObjs
AddResObjs
Clear
SetScaleY
SetXVariable
SetYVariable

AddObjs
Adds objects to elements column in table 'Bars'.
None [Link](list elements)

A RGUMENTS
elements Elements to add in table.

AddResObjs
Adds objects to elements column in table 'Bars' (similar to AddObjs). Additionally a result file is
assigned to all rows added in the 'Result File' column.
None [Link](DataObject resultFileObj,
list elements
)

A RGUMENTS
resultFileObj
The result file to assign. Must be an object of class ElmRes.

elements Elements to add in table.

Clear
Removes all elements from plot by erasing all rows from the table named 'Bars'.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 398


Chapter 5. Object Methods

SetScaleY
Sets y-axis scale limits.
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of y-scale.
max (optional)
Maximum of y-scale.

log (optional)
Possible values:
0 linear
1 logarithmic

SetXVariable
Set the x-axis Variable of the Distortion Analysis Diagram
int [Link](str variable)

A RGUMENTS
variable x-axis variable to [Link] of variable must not exceed 37 characters.

R ETURNS
0 if ok, 1 if variable length exceeds 37 characters,

SetYVariable
Set the y-axis variable of the Distortion Analysis Diagram
int [Link](str variable)

A RGUMENTS
variable y-axis variable to [Link] of variable must not exceed 37 characters.

R ETURNS
0 if ok, 1 if variable length exceeds 37 characters,

DIgSILENT PowerFactory 2018, Python Function Reference 399


Chapter 5. Object Methods

5.6.51 VisDraw
Overview

AddRelay
AddRelays
CentreOrigin
Clear
DoAutoScaleX
DoAutoScaleY

AddRelay
Adds a relay to the plot and sets optionally the drawing style.
None [Link](DataObject relay,
[float colour,]
[float style,]
[float width])

A RGUMENTS
relay The protection device (ElmRelay or RelFuse) to be added.

colour (optional)
The colour to be used.
style (optional)
The line style to be used.

width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
None [Link](list relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

CentreOrigin
Centre the origin of the plot
None [Link]()

Clear
Removes all protection devices from the plot.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 400


Chapter 5. Object Methods

DoAutoScaleX
Scales the x-axis of the plot automatically. The function works for local x-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

5.6.52 VisHrm
Overview

Clear
DoAutoScaleX
DoAutoScaleY
GetScaleObjX
GetScaleObjY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY

Clear
Removes all curves by clearing table named 'Curves'.
None [Link]()

DoAutoScaleX
Scales x-axis automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scale is not local

DIgSILENT PowerFactory 2018, Python Function Reference 401


Chapter 5. Object Methods

DoAutoScaleY
Scales y-axis automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

GetScaleObjX
Gets the object used for scaling the x-axis.
DataObject [Link]()

R ETURNS
this object In case that 'Use local Axis' is set to 'Local'.
the virtual instrument panel In case that 'Use local axis' is set to 'Current Page'.
the graphics board In case that 'Use local axis' is set to 'Graphics Board'.

GetScaleObjY
Gets the object used for scaling the y-axis.
DataObject [Link]()

R ETURNS
this object In case that 'Use local Axis' is enabled.
the plot type In case that 'Use local axis' is disabled.

SetAutoScaleX
Sets Auto Scale setting of the x-scale. The scale is automatic set to local, in case that the
waveform plot is using the scale of the graphics board or the virtual instrument panel.
None [Link](int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation

SetAutoScaleY
Sets Auto Scale setting of the y-scale. The scale is automatic set to local, in case that the
waveform plot is using the scale of the plot type.
None [Link](int mode)

DIgSILENT PowerFactory 2018, Python Function Reference 402


Chapter 5. Object Methods

A RGUMENTS
mode Possible values:
0 never
1 after simulation

SetCrvDesc
Sets the user defined description of a curve.
None [Link](int curveIndex, str curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.

curveDescription
Description to set

SetDefScaleX
Sets the x-scale to be used to the graphics board.
None [Link]()

SetDefScaleY
Sets the y-scale to be used to the plot type.
None [Link]()

5.6.53 VisMagndiffplt
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY
Refresh

AddRelay
Adds a relay to the plot and optionally sets the drawing style at the same time.
None [Link](DataObject relay,
[float colour,]
[float style,]
[float width]
)

DIgSILENT PowerFactory 2018, Python Function Reference 403


Chapter 5. Object Methods

A RGUMENTS
relay Relay to be added.
colour (optional)
The colour to be used.

style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
None [Link](list relays)

A RGUMENTS
relays Relays to be added.

Clear
Removes all protection devices from the plot.
None [Link]()

DoAutoScaleX
Scales the x-axis of the plot automatically. The function works for local x-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DIgSILENT PowerFactory 2018, Python Function Reference 404


Chapter 5. Object Methods

Refresh
Refreshes the plot by attempting to automatically scale both axes.
None [Link]()

5.6.54 VisOcplot
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY
Refresh

AddRelay
Adds one or more relays to the plot. The version for one relay can also set the drawing style at
the same time.
None [Link](DataObject relay,
[float colour,]
[float style,]
[float width]
)

A RGUMENTS
relay Protection device (ElmRelay or RelFuse) to be added.
colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
None [Link](list relay)

A RGUMENTS
relays Protection devices (ElmRelay or RelFuse) to be added.

Clear
Removes all protection devices from the plot.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 405


Chapter 5. Object Methods

DoAutoScaleX
Scales the x-axis of the plot automatically. The function works for local x-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

Refresh
Refreshes the plot by attempting to automatically scale both axes.
None [Link]()

5.6.55 VisPath
Overview

Clear
DoAutoScaleX
DoAutoScaleY
SetAdaptX
SetAdaptY
SetScaleX
SetScaleY

Clear
Removes all curves by clearing table named 'Variables' on page 'Curves'.
None [Link]()

DoAutoScaleX
Scales x-axis automatically.
int [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 406


Chapter 5. Object Methods

R ETURNS
Always 0

DoAutoScaleY
Scales y-axis automatically.
int [Link]()

R ETURNS
Always 0

SetAdaptX
Sets the Adapt Scale option of the x-scale.
None [Link](int mode)

A RGUMENTS
mode Possible values:
0 off
1 on

SetAdaptY
Sets the Adapt Scale option of the x-scale.
None [Link](int mode)

A RGUMENTS
mode Possible values:

0 off
1 on

SetScaleX
Sets x-axis scale.
None [Link](float min,
float max,
)

A RGUMENTS
min Minimum of x-scale.

max Maximum of x-scale.

DIgSILENT PowerFactory 2018, Python Function Reference 407


Chapter 5. Object Methods

SetScaleY
Sets y-axis scale limits.
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min Minimum of y-scale.
max Maximum of y-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

5.6.56 VisPcompdiffplt
Overview

AddRelay
AddRelays
CentreOrigin
Clear
DoAutoScaleX
DoAutoScaleY

AddRelay
Adds a relay to the plot and sets optionally the drawing style.
None [Link](DataObject relay,
[float colour,]
[float style,]
[float width])

A RGUMENTS
relay The protection device (ElmRelay or RelFuse) to be added.

colour (optional)
The colour to be used.
style (optional)
The line style to be used.

width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.

DIgSILENT PowerFactory 2018, Python Function Reference 408


Chapter 5. Object Methods

None [Link](list relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

CentreOrigin
Centre the origin of the plot
None [Link]()

Clear
Removes all protection devices from the plot.
None [Link]()

DoAutoScaleX
Scales the x-axis of the plot automatically. The function works for local x-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DIgSILENT PowerFactory 2018, Python Function Reference 409


Chapter 5. Object Methods

5.6.57 VisPlot
Overview

AddResVars
AddVars
Clear
DoAutoScaleX
DoAutoScaleY
GetScaleObjX
GetScaleObjY
SetAdaptX
SetAdaptY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY
SetScaleX
SetScaleY
SetXVar

AddResVars
Appends variables to the plot. Variables which are already in the plot are not added.
None [Link](DataObject elmRes
DataObject element,
str varname
)

A RGUMENTS
elmRes Result object, classanme ElmRes

elememt Element to add


varname Variable name

AddVars
Appends variables to the plot. Variables which are already in the plot are not added.
None [Link](DataObject element,
str varname
)

A RGUMENTS
elememt Element to add

varname Variable name

DIgSILENT PowerFactory 2018, Python Function Reference 410


Chapter 5. Object Methods

Clear
Removes all curves from plot.
None [Link]()

DoAutoScaleX
Scales x-axis automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scale is not local

DoAutoScaleY
Scales y-axis automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

GetScaleObjX
Gets the object used for scaling the x-axis.
DataObject [Link]()

R ETURNS
this object In case that 'Use local Axis' is set to 'Local'.
the virtual instrument panel In case that 'Use local axis' is set to 'Current Page'.
the graphics board In case that 'Use local axis' is set to 'Graphics Board'.

GetScaleObjY
Gets the object used for scaling the y-axis.
DataObject [Link]()

R ETURNS
this object In case that 'Use local Axis' is enabled.
the plot type In case that 'Use local axis' is disabled.

DIgSILENT PowerFactory 2018, Python Function Reference 411


Chapter 5. Object Methods

SetAdaptX
Sets the Adapt Scale option of the local x-scale.
None [Link](int mode,
[float trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on
trigger (optional)
Trigger value, unused if mode is off or empty

SetAdaptY
Sets the Adapt Scale option of the local y-scale.
None [Link](int mode,
[float offset]
)

A RGUMENTS
mode Possible values:
0 off
1 on
offset (optional)
Offset value, unused if mode is off or empty

SetAutoScaleX
Sets Auto Scale setting of the x-scale. The scale is automatic set to local, in case that the plot
is using the scale of the graphics board or the virtual instrument panel.
None [Link](int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

SetAutoScaleY
Sets Auto Scale setting of the y-scale. The scale is automatic set to local, in case that the plot
is using the scale of the plot type.
None [Link](int mode)

DIgSILENT PowerFactory 2018, Python Function Reference 412


Chapter 5. Object Methods

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

SetCrvDesc
Sets the user defined description of a curve.
None [Link](int curveIndex, str curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set

SetDefScaleX
Sets the x-scale to be used to the graphics board.
None [Link]()

SetDefScaleY
Sets the y-scale to be used to the plot type.
None [Link]()

SetScaleX
Sets the local x-axis scale. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
None [Link]()
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:

DIgSILENT PowerFactory 2018, Python Function Reference 413


Chapter 5. Object Methods

0 linear
1 logarithmic

SetScaleY
Sets the local y-axis scale. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
None [Link]()
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of y-scale.

max (optional)
Maximum of y-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

SetXVar
Sets the local x-axis variable. If The default x-axis variable (time) is set if no argument is
passed.
None [Link]()
None [Link](DataObject obj,]
str varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

DIgSILENT PowerFactory 2018, Python Function Reference 414


Chapter 5. Object Methods

5.6.58 VisPlot2
Overview

AddResVars
AddVars
Clear
DoAutoScaleX
DoAutoScaleY
DoAutoScaleY2
GetScaleObjX
GetScaleObjY
SetAdaptX
SetAdaptY
SetAutoScaleX
SetAutoScaleY
SetCrvDesc
SetDefScaleX
SetDefScaleY
SetScaleX
SetScaleY
SetXVar
ShowY2

AddResVars
Appends variables to the plot. Variables which are already in the plot are not added.
None [Link](DataObject elmRes
DataObject element,
str varname,
[int y2]
)

A RGUMENTS
elmRes Result object, classanme ElmRes
elememt Element to add
varname Variable name
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

AddVars
Appends variables to the plot. Variables which are already in the plot are not added.
None [Link](DataObject element,
str varname,
[int y2]
)

DIgSILENT PowerFactory 2018, Python Function Reference 415


Chapter 5. Object Methods

A RGUMENTS
elememt Element to add
varname Variable name
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

Clear
Removes variables from plot
None [Link]([int y2])

A RGUMENTS
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

DoAutoScaleX
Scales x-axis automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scale is not local

DoAutoScaleY
Scales y1-axis automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

DoAutoScaleY2
Scales y2-axis automatically.
int VisPlot2.DoAutoScaleY2()

DIgSILENT PowerFactory 2018, Python Function Reference 416


Chapter 5. Object Methods

R ETURNS
0 Ok, call to DoAutoScaleY() was successfull
1 Failed, because the y-scale is not local

GetScaleObjX
Gets the object used for scaling the x-axis.
DataObject [Link]()

R ETURNS
this object In case that 'Use local Axis' is set to 'Local'.
the virtual instrument panel In case that 'Use local axis' is set to 'Current Page'.
the graphics board In case that 'Use local axis' is set to 'Graphics Board'.

GetScaleObjY
Returns used object defining y-scale. The returned object is either the plot itself or the plot type
(IntPlot).
DataObject [Link] ([int y2])

R ETURNS
this object In case that 'Use local Axis' is enabled.
the plot type In case that 'Use local axis' is disabled.

SetAdaptX
Sets the Adapt Scale option of the local x-scale.
None [Link](int mode,
[float trigger]
)

A RGUMENTS
mode Possible values:
0 off
1 on
trigger (optional)
Trigger value, unused if mode is off or empty

SetAdaptY
Sets the Adapt Scale option of the local y-scale.
None [Link](int mode,
[float offset,]
[int y2]
)

DIgSILENT PowerFactory 2018, Python Function Reference 417


Chapter 5. Object Methods

A RGUMENTS
mode Possible values:
0 off
1 on

offset (optional)
Offset value, unused if mode is off or empty
y2 (optional)
Possible values:

1 y1-axis, default value


2 y2 axis

SetAutoScaleX
Sets Auto Scale setting of the x-scale. The scale is automatic set to local, in case that the plot
is using the scale of the graphics board or the virtual instrument panel.
None [Link](int mode)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation

SetAutoScaleY
Sets automatic scaling mode of the y-scale. The axis given in the second argument is automat-
ically set to local.
None [Link] (int mode,
[int y2]
)

A RGUMENTS
mode Possible values:
0 never
1 after simulation
2 during simulation
y2 (optional)
Possible values:

1 y1-axis, default value


2 y2 axis

DIgSILENT PowerFactory 2018, Python Function Reference 418


Chapter 5. Object Methods

SetCrvDesc
Sets the user defined description of a curve.
None [Link](int curveIndex, str curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.
curveDescription
Description to set

SetDefScaleX
Sets the x-scale to be used to the graphics board.
None [Link]()

SetDefScaleY
Sets the y-scale to be used to the plot type.
None [Link]([int y2])

A RGUMENTS
y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

SetScaleX
Sets the local x-axis scale. A function call without arguments sets the Auto Scale setting to On
without changing the scale itself.
None [Link]()
None [Link](float min,
float max,
[int log]
)

A RGUMENTS
min (optional)
Minimum of x-scale.
max (optional)
Maximum of x-scale.
log (optional)
Possible values:
0 linear
1 logarithmic

DIgSILENT PowerFactory 2018, Python Function Reference 419


Chapter 5. Object Methods

SetScaleY
Sets scale of y-axis. Calling the function without any argument sets the Auto Scale option for
the y axis (both share the same setting) to On.
None [Link]()
None [Link](float min,
float max,
[int log,]
[int Y2]
)

A RGUMENTS
min (optional)
Minimum of y-scale.
max (optional)
Maximum of y-scale.

log (optional)
Possible values:
0 linear
1 logarithmic

y2 (optional)
Possible values:
1 y1-axis, default value
2 y2 axis

SetXVar
Sets the local x-axis variable. If The default x-axis variable (time) is set if no argument is
passed.
None [Link]()
None [Link](DataObject obj,]
str varname
)

A RGUMENTS
obj (optional)
x-axis object
varname (optional)
variable of obj

ShowY2
Enables or disables the y2 axis.
None VisPlot2.ShowY2([int show])

DIgSILENT PowerFactory 2018, Python Function Reference 420


Chapter 5. Object Methods

A RGUMENTS
show (optional)
Possible values:
0 hide y2 axis
1 show y2 axis (default)

5.6.59 VisPlottz
Overview

AddRelay
AddRelays
Clear
DoAutoScaleX
DoAutoScaleY

AddRelay
Adds a relay to the plot and sets optionally the drawing style.
None [Link](DataObject relay,
[float colour,]
[float style,]
[float width])

A RGUMENTS
relay The protection device (ElmRelay or RelFuse) to be added.
colour (optional)
The colour to be used.
style (optional)
The line style to be used.
width (optional)
The line width to be used.

AddRelays
Adds relays to the plot.
None [Link](list relays)

A RGUMENTS
relays The protection devices (ElmRelay or RelFuse) to be added.

Clear
Removes all protection devices from the plot.
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 421


Chapter 5. Object Methods

DoAutoScaleX
Scales the x-axis of the plot automatically. The function works for local x-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

DoAutoScaleY
Scales the y-axis of the plot automatically. The function works for local y-scales only. If the
x-scale is not local a warning is shown in the output window and 1 is returned by the function.
int [Link]()

R ETURNS
0 Automatic scaling was executed.
1 An Error occurred.

5.6.60 VisVec
Overview

CentreOrigin

CentreOrigin
Centre the origin of the plot
None [Link]()

5.6.61 VisVecres
Overview

CentreOrigin

CentreOrigin
Centre the origin of the plot
None [Link]()

DIgSILENT PowerFactory 2018, Python Function Reference 422


Chapter 5. Object Methods

5.6.62 VisXyplot
Overview

Clear
DoAutoScaleX
DoAutoScaleY
SetCrvDescX
SetCrvDescY

Clear
Removes all curves from plot.
None [Link]()

DoAutoScaleX
Scales all used x-axes automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scales are not local

DoAutoScaleY
Scales all used y-axes automatically.
int [Link]()

R ETURNS
0 Ok, call to DoAutoScaleX() was successfull
1 Failed, because the x-scales are not local

SetCrvDescX
Sets the user defined description of a curve for the x-variable.
None [Link](int curveIndex, str curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.

curveDescription
Description to set

DIgSILENT PowerFactory 2018, Python Function Reference 423


Chapter 5. Object Methods

SetCrvDescY
Sets the user defined description of a curve for the y-variable.
None [Link](int curveIndex, str curveDescription)

A RGUMENTS
curveIndex
Curve index; first curve in table is index 1.

curveDescription
Description to set

DIgSILENT PowerFactory 2018, Python Function Reference 424


Index

Activate VisPcompdiffplt, 408


ElmNet, 100 VisPlottz, 421
IntCase, 331 AddResObjs
IntPrj, 357 VisBdia, 398
IntScenario, 367 AddResVars
IntScensched, 370 VisPlot, 410
IntScheme, 372 VisPlot2, 415
IntSscheduler, 374 AddTrigger
IntSstage, 374 IntGate, 343
ActivateProject IntRas, 365
Application Methods, 5 AddVar
AdaptWidth IntMon, 352
SetLevelvis, 308 AddVariable
AddCntcy ElmRes, 109
ComSimoutage, 285 AddVars
AddContingencies ElmRes, 109
ComSimoutage, 285 VisPlot, 410
AddCopy VisPlot2, 415
General Object Methods, 45 Align
AddCubicle SetLevelvis, 308
ElmBoundary, 79 All
AddEvent IntDataset, 341
IntRas, 365 SetSelect, 312
AddObjs AllAsm
VisBdia, 398 SetSelect, 312
AddPage AllBars
SetDesktop, 304 SetSelect, 312
AddProjectToCombined AllBreakers
IntPrj, 357 SetSelect, 312
AddProjectToRemoteDatabase AllClosedBreakers
IntPrj, 357 SetSelect, 312
AddRef AllElm
ComNmink, 266 SetSelect, 312
IntDataset, 341 AllLines
SetSelect, 311 SetSelect, 313
AddRelay AllLoads
VisDraw, 400 SetSelect, 313
VisMagndiffplt, 403 AllOpenBreakers
VisOcplot, 405 SetSelect, 313
VisPcompdiffplt, 408 AllSym
VisPlottz, 421 SetSelect, 313
AddRelays AllTypLne
VisDraw, 400 SetSelect, 313
VisMagndiffplt, 404 AnalyseElmRes
VisOcplot, 405 ComRel3, 274

425
Index

AppendCommand ResetCalculation, 20
ComTasks, 289 ResGetData, 20
AppendStudyCase ResGetDescription, 21
ComTasks, 290 ResGetFirstValidObject, 21
Application Methods, 4 ResGetFirstValidObjectVariable, 21
ActivateProject, 5 ResGetFirstValidVariable, 21
CommitTransaction, 6 ResGetIndex, 21
CreateFaultCase, 6 ResGetMax, 22
CreateProject, 6 ResGetMin, 22
ExecuteCmd, 7 ResGetNextValidObject, 22
GetActiveCalculationStr, 7 ResGetNextValidObjectVariable, 22
GetActiveNetworkVariations, 8 ResGetNextValidVariable, 22
GetActiveProject, 8 ResGetObject, 23
GetActiveScenario, 8 ResGetUnit, 23
GetActiveScenarioScheduler, 8 ResGetValueCount, 23
GetActiveStages, 9 ResGetVariable, 23
GetActiveStudyCase, 9 ResGetVariableCount, 23
GetAllUsers, 9 ResLoadData, 23
GetBorderCubicles, 9 ResReleaseData, 23
GetBrowserSelection, 10 ResSortToVariable, 24
GetCalcRelevantObjects, 10 SaveAsScenario, 24
GetClassDescription, 11 SearchObjectByForeignKey, 24
GetClassId, 11 SelectToolbox, 24
GetCurrentDiagram, 11 SetAttributeModeInternal, 25
GetCurrentScript, 11 SetInterfaceVersion, 25
GetCurrentSelection, 12 SetShowAllUsers, 25
GetCurrentUser, 12 SetWriteCacheEnabled, 26
GetCurrentZoomScaleLevel, 12 Show, 26
GetDataFolder, 12 SplitLine, 26
GetDiagramSelection, 13 StatFileGetXrange, 27
GetFlowOrientation, 13 StatFileResetXrange, 27
GetFromStudyCase, 14 StatFileSetXrange, 27
GetGlobalLibrary, 14 WriteChangesToDb, 27
GetGraphicsBoard, 14 Apply
GetInterfaceVersion, 14 ElmBmu, 78
GetLanguage, 15 IntOutage, 353
GetLocalLibrary, 15 IntScenario, 367
GetProjectFolder, 15 IntSubset, 377
GetRecordingStage, 16 ApplyAll
GetSettings, 16 IntOutage, 353
GetSummaryGrid, 16 ApplyAndResetRA
GetUserManager, 16 ElmSubstat, 123
Hide, 17 ApplyNetworkState
IsAttributeModeInternal, 17 IntCase, 331
IsLdfValid, 17 ApplySelective
IsRmsValid, 17 IntScenario, 367
IsScenarioAttribute, 17 IntSubset, 377
IsShcValid, 18 ApplyStudyTime
IsSimValid, 18 IntCase, 331
IsWriteCacheEnabled, 18 Archive
LoadProfile, 18 IntPrj, 357
MarkInGraphics, 19 AreDistParamsPossible
OutputFlexibleData, 19 ElmLne, 93
PostCommand, 20 AssumeCompensationFactor
Rebuild, 20 RelZpol, 385
ReloadProfile, 20 AssumeReRl

DIgSILENT PowerFactory 2018, Python Function Reference 426


Index

RelZpol, 385 SetLevelvis, 309


AssumeXeXl ChangeRefPoints
RelZpol, 386 SetLevelvis, 309
ChangeWidthVisibilityAndColour
BlkDef, 320 SetLevelvis, 309
CalculateCheckSum, 321 ChaVecfile, 322
Compile, 320 Update, 322
Encrypt, 320 Check
GetCheckSum, 321 IntOutage, 354
Pack, 321 SetTboxconfig, 314
PackAsMacro, 321 CheckAll
BlkSig, 321 IntOutage, 354
GetFromSigName, 322 CheckAssignments
GetToSigName, 322 ComMerge, 260
BlockSwitch CheckBbPath
ComShctrace, 279 ElmBbone, 76
BuildNodeNames CheckControllers
ComUcteexp, 293 ComLdf, 255
CheckRanges
CalcAggrVarsInRadFeed ElmRelay, 104
ElmFeeder, 85 CheckSyntax
CalcCluster ComDpl, 246
SetCluster, 296 CheckUrl
SetDistrstate, 307 IntExtaccess, 342
CalcContributions CimModel, 322
ComRelpost, 276 DeleteParameterAtIndex, 323
CalcElParams GetAttributeEnumerationType, 323
TypAsmo, 396 GetParameterCount, 323
CalcLdf GetParameterNamespace, 323
ComLdf, 255 GetParameterValue, 324
CalcParams HasParameter, 324
ComLdf, 255 RemoveParameter, 324
CalcShiftedReversedBoundary SetAssociationValue, 324, 325
ElmBoundary, 79 SetAttributeEnumeration, 325
CalculateCheckSum SetAttributeValue, 326
BlkDef, 321 CimObject, 327
CalculateInterchangeTo DeleteParameterAtIndex, 327
ElmArea, 69 GetAttributeEnumerationType, 327
ElmNet, 100 GetParameterCount, 327
ElmZone, 153 GetParameterNamespace, 328
CanAddProjectToRemoteDatabase GetParameterValue, 328
IntPrj, 358 HasParameter, 328
CanSubscribeProjectReadOnly RemoveParameter, 328
IntPrj, 358 SetAssociationValue, 329
CanSubscribeProjectReadWrite SetAttributeEnumeration, 329, 330
IntPrj, 358 SetAttributeValue, 330
CentreOrigin Clear
VisDraw, 400 ComNmink, 266
VisPcompdiffplt, 409 ElmBoundary, 79
VisVec, 422 ElmRes, 110
VisVecres, 422 IntDataset, 341
ChangeFont IntSubset, 378
SetLevelvis, 308 Output Window Methods, 42
ChangeFrameAndWidth SetSelect, 314
SetLevelvis, 308 VisBdia, 398
ChangeLayer VisDraw, 400

DIgSILENT PowerFactory 2018, Python Function Reference 427


Index

VisHrm, 401 Execute, 239


VisMagndiffplt, 404 ComContingency, 239
VisOcplot, 405 ContinueTrace, 240
VisPath, 406 CreateRecoveryInformation, 240
VisPcompdiffplt, 409 GetGeneratorEvent, 240
VisPlot, 411 GetInterruptedPowerAndCustomersForStage,
VisPlot2, 416 241
VisPlottz, 421 GetInterruptedPowerAndCustomersForTimeStep,
VisXyplot, 423 241
ClearCont GetLoadEvent, 242
ComSimoutage, 285 GetNumberOfGeneratorEventsForTimeStep,
ClearData 242
IntGrfgroup, 343 GetNumberOfLoadEventsForTimeStep, 242
IntGrflayer, 344 GetNumberOfSwitchEventsForTimeStep, 243
ClearOutputWindow GetNumberOfTimeSteps, 243
Output Window Functions, 40 GetObj, 243
ClearVars GetSwitchEvent, 243
IntMon, 352 GetTimeOfStepInSeconds, 244
Close GetTotalInterruptedPower, 244
ElmCoup, 82 JumpToLastStep, 244
ElmGndswt, 91 RemoveEvents, 244
ElmRes, 112 StartTrace, 245
StaSwitch, 224 StopTrace, 245
CloseTableReports ComDiff, 245
Dialogue Boxes Functions, 29 Start, 245
ColLbl Stop, 246
IntMat, 346 ComDllmanager, 246
ComAddlabel, 225 Report, 246
Execute, 225 ComDpl, 246
ComAddon, 226 CheckSyntax, 246
CreateModule, 226 Encrypt, 247
DefineDouble, 226 Execute, 247
DefineDoubleMatrix, 227 GetExternalObject, 247
DefineDoublePerConnection, 228 GetInputParameterDouble, 248
DefineDoubleVector, 228 GetInputParameterInt, 248
DefineDoubleVectorPerConnection, 229 GetInputParameterString, 249
DefineInteger, 229 IsEncrypted, 249
DefineIntegerPerConnection, 230 SetExternalObject, 249
DefineIntegerVector, 231 SetInputParameterDouble, 250
DefineIntegerVectorPerConnection, 231 SetInputParameterInt, 250
DefineObject, 232 SetInputParameterString, 251
DefineObjectPerConnection, 233 ComFlickermeter, 251
DefineObjectVector, 233 Execute, 251
DefineObjectVectorPerConnection, 234 ComGenrelinc, 251
DefineString, 234 GetCurrentIteration, 251
DefineStringPerConnection, 235 GetMaxNumIterations, 252
DeleteModule, 236 ComGridtocim, 252
FinaliseModule, 236 ConvertAndExport, 252
GetActiveModule, 236 SetAuthorityUri, 253
ModuleExists, 236 SetBoundaries, 253
SetActiveModule, 237 SetGridsToExport, 253
ComCapo, 237 ComImport, 253
ConnectShuntToBus, 237 GetCreatedObjects, 253
LossCostAtBusTech, 238 GetModifiedObjects, 253
TotalLossCost, 238 ComInc, 254
ComConreq, 239 ZeroDerivative, 254

DIgSILENT PowerFactory 2018, Python Function Reference 428


Index

ComLdf, 254 SendData, 268


CalcLdf, 255 ComOutage, 268
CalcParams, 255 ContinueTrace, 268
CheckControllers, 255 ExecuteTime, 268
DoNotResetCalc, 255 GetObject, 269
EstimateLoading, 255 RemoveEvents, 269
EstimateOutage, 256 SetObjs, 269
Execute, 256 StartTrace, 270
IsAC, 257 StopTrace, 270
IsBalanced, 257 Compare
IsDC, 257 ComMerge, 260
PrintCheckResults, 257 CompareActive
SetOldDistributeLoadMode, 257 ComMerge, 260
ComLink, 258 Compile
LoadMicroSCADAFile, 258 BlkDef, 320
ReceiveData, 258 ComPython, 270
SendData, 258 GetExternalObject, 270
SentDataStatus, 259 GetInputParameterDouble, 271
SetOPCReceiveQuality, 259 GetInputParameterInt, 271
SetSwitchShcEventMode, 259 GetInputParameterString, 272
Commands Methods, 225 SetExternalObject, 272
Execute, 225 SetInputParameterDouble, 272
ComMerge, 260 SetInputParameterInt, 273
CheckAssignments, 260 SetInputParameterString, 273
Compare, 260 ComRel3, 274
CompareActive, 260 AnalyseElmRes, 274
ExecuteRecording, 261 ExeEvt, 274
ExecuteWithActiveProject, 261 OvlAlleviate, 274
GetCorrespondingObject, 261 RemoveEvents, 275
GetModification, 261 RemoveOutages, 275
GetModificationResult, 262 ValidateConstraints, 275
GetModifiedObjects, 262 ComRelpost, 276
Merge, 263 CalcContributions, 276
PrintComparisonReport, 263 GetContributionOfComponent, 276
PrintModifications, 263 ComRelreport, 276
Reset, 263 GetContingencies, 277
SetAutoAssignmentForAll, 263 GetContributionOfComponent, 277
SetObjectsToCompare, 264 ComRes, 277
ShowBrowser, 264 ExportFullRange, 277
WereModificationsFound, 264 FileNmResNm, 277
CommitTransaction ComShc, 277
Application Methods, 6 ExecuteRXSweep, 277
ComMot, 265 GetFaultType, 278
GetMotorConnections, 265 GetOverLoadedBranches, 278
GetMotorSwitch, 265 GetOverLoadedBuses, 279
GetMotorTerminal, 265 ComShctrace, 279
ComNmink, 265 BlockSwitch, 279
AddRef, 266 ExecuteAllSteps, 280
Clear, 266 ExecuteInitialStep, 280
GetAll, 266 ExecuteNextStep, 280
ComOmr, 266 GetBlockedSwitches, 280
GetFeeders, 266 GetCurrentTimeStep, 281
GetOMR, 267 GetDeviceSwitches, 281
GetRegionCount, 267 GetDeviceTime, 281
ComOpc, 267 GetNonStartedDevices, 281
ReceiveData, 267 GetStartedDevices, 281

DIgSILENT PowerFactory 2018, Python Function Reference 429


Index

GetSwitchTime, 282 ResetQuickAccess, 295


GetTrippedDevices, 282 SetGridSelection, 295
NextStepAvailable, 282 ConnectShuntToBus
ComSim, 282 ComCapo, 237
GetSimulationTime, 283 Consolidate
GetTotalWarnA, 283 IntCase, 332
GetTotalWarnB, 283 IntScheme, 372
GetTotalWarnC, 283 ContainsNonAsciiCharacters
GetViolatedScanModules, 283 General Object Methods, 46
LoadSimulationState, 283 ContinueTrace
LoadSnapshot, 283 ComContingency, 240
SaveSimulationState, 284 ComOutage, 268
SaveSnapshot, 284 ConvertAndExport
ComSimoutage, 284 ComGridtocim, 252
AddCntcy, 285 ConvertToASCIIFormat
AddContingencies, 285 IntComtrade, 333
ClearCont, 285 ConvertToBinaryFormat
CreateFaultCase, 285 IntComtrade, 333
Execute, 286 CopyData
ExecuteCntcy, 286 General Object Methods, 46
GetNTopLoadedElms, 286 CopyExtMeaStatusToStatusTmp
MarkRegions, 287 StaExtbrkmea, 159
RemoveContingencies, 287 StaExtcmdmea, 164
Reset, 287 StaExtdatmea, 169
SetLimits, 287 StaExtfmea, 174
Update, 288 StaExtfuelmea, 179
ComSvgexport, 288 StaExtimea, 184
SetFileName, 288 StaExtpfmea, 189
SetObject, 288 StaExtpmea, 194
SetObjects, 288 StaExtqmea, 199
ComSvgimport, 289 StaExtsmea, 204
SetFileName, 289 StaExttapmea, 209
SetObject, 289 StaExtv3mea, 214
ComTasks, 289 StaExtvmea, 219
AppendCommand, 289 CreateCBEvents
AppendStudyCase, 290 IntEvt, 341
RemoveCmdsForStudyCaseRow, 290 CreateDerivedProject
RemoveStudyCases, 290 IntVersion, 384
SetResultsFolder, 290 CreateEvent
ComTececo, 291 ElmTr2, 136
UpdateTablesByCalcPeriod, 291 ElmTr3, 140
ComTransfer, 291 ElmTr4, 144
GetTransferCalcData, 292 ElmVoltreg, 151
IsLastIterationFeasible, 292 StaExtdatmea, 169
ComUcte, 292 CreateFaultCase
SetBatchMode, 292 Application Methods, 6
ComUcteexp, 292 ComSimoutage, 285
BuildNodeNames, 293 CreateFeederWithRoutes
DeleteCompleteQuickAccess, 293 ElmLne, 94
ExportAndInitQuickAccess, 293 CreateFilter
GetConnectedBranches, 293 SetColscheme, 297
GetFromToNodeNames, 294 CreateGroup
GetOrderCode, 294 IntUserman, 380
GetUcteNodeName, 294 CreateModule
InitQuickAccess, 295 ComAddon, 226
QuickAccessAvailable, 295 CreateObject

DIgSILENT PowerFactory 2018, Python Function Reference 430


Index

General Object Methods, 46 DefineString


CreateProject ComAddon, 234
Application Methods, 6 DefineStringPerConnection
CreateRecoveryInformation ComAddon, 235
ComContingency, 240 Delete
CreateStageObject General Object Methods, 47
IntSstage, 375 DeleteCompleteQuickAccess
CreateUser ComUcteexp, 293
IntUserman, 380 DeleteModule
CreateVersion ComAddon, 236
IntPrj, 358 DeleteParameterAtIndex
CreateVI CimModel, 323
SetVipage, 318 CimObject, 327
DeleteRow
Date/Time Functions, 29 IntScensched, 371
GetStudyTimeObject, 29 Derate
Date ElmGenstat, 89
SetTime, 315 ElmPvsys, 101
Deactivate ElmSym, 128
ElmNet, 100 Dialogue Boxes Functions, 29
IntCase, 332 CloseTableReports, 29
IntPrj, 359 ShowModalBrowser, 29
IntScenario, 368 ShowModalSelectBrowser, 30
IntScensched, 370 ShowModelessBrowser, 30
IntScheme, 373 UpdateTableReports, 31
IntSscheduler, 374 DiscardChanges
DefineBoundary IntScenario, 368
ElmArea, 70 Disconnect
ElmNet, 101 ElmGenstat, 89
ElmZone, 154 ElmPvsys, 101
DefineDouble ElmSym, 128
ComAddon, 226 DoAutoScaleX
DefineDoubleMatrix SetDesktop, 304
ComAddon, 227 SetVipage, 317
DefineDoublePerConnection VisDraw, 401
ComAddon, 228 VisHrm, 401
DefineDoubleVector VisMagndiffplt, 404
ComAddon, 228 VisOcplot, 406
DefineDoubleVectorPerConnection VisPath, 406
ComAddon, 229 VisPcompdiffplt, 409
DefineInteger VisPlot, 411
ComAddon, 229 VisPlot2, 416
DefineIntegerPerConnection VisPlottz, 422
ComAddon, 230 VisXyplot, 423
DefineIntegerVector DoAutoScaleY2
ComAddon, 231 VisPlot2, 416
DefineIntegerVectorPerConnection DoAutoScaleY
ComAddon, 231 SetVipage, 317
DefineObject VisDraw, 401
ComAddon, 232 VisHrm, 402
DefineObjectPerConnection VisMagndiffplt, 404
ComAddon, 233 VisOcplot, 406
DefineObjectVector VisPath, 407
ComAddon, 233 VisPcompdiffplt, 409
DefineObjectVectorPerConnection VisPlot, 411
ComAddon, 234 VisPlot2, 416

DIgSILENT PowerFactory 2018, Python Function Reference 431


Index

VisPlottz, 422 slotupd, 82


VisXyplot, 423 SlotUpdate, 82
DoNotResetCalc ElmCoup, 82
ComLdf, 255 Close, 82
GetRemoteBreakers, 82
EchoOff IsBreaker, 83
Environment Functions, 31 IsClosed, 83
EchoOn IsOpen, 84
Environment Functions, 31 Open, 84
ElmArea, 69 ElmDsl, 84
CalculateInterchangeTo, 69 ExportToClipboard, 84
DefineBoundary, 70 ExportToFile, 85
GetAll, 70 ElmFeeder, 85
GetBranches, 70 CalcAggrVarsInRadFeed, 85
GetBuses, 70 GetAll, 86
GetObjs, 71 GetBranches, 86
ElmAsm, 71 GetBuses, 86
GetAvailableGenPower, 71 GetNodesBranches, 87
GetElecTorque, 72 GetObjs, 87
GetGroundingImpedance, 72 ElmFile, 87
GetMechTorque, 73 LoadFile, 87
GetMotorStartingFlag, 73 SaveFile, 88
GetStepupTransformer, 73 ElmFilter, 88
IsPQ, 74 GetGroundingImpedance, 88
ElmAsmsc, 74 ElmGenstat, 89
GetAvailableGenPower, 74 Derate, 89
GetGroundingImpedance, 74 Disconnect, 89
GetStepupTransformer, 75 GetAvailableGenPower, 89
ElmBbone, 75 GetGroundingImpedance, 90
CheckBbPath, 76 GetStepupTransformer, 90
GetBbOrder, 76 IsConnected, 91
GetCompleteBbPath, 76 Reconnect, 91
GetFOR, 77 ResetDerating, 91
GetMeanCs, 77 ElmGndswt, 91
GetMinCs, 77 Close, 91
GetTieOpenPoint, 77 GetGroundingImpedance, 92
GetTotLength, 78 IsClosed, 92
HasGnrlMod, 78 IsOpen, 92
ElmBmu, 78 Open, 93
Apply, 78 ElmLne, 93
Update, 78 AreDistParamsPossible, 93
ElmBoundary, 79 CreateFeederWithRoutes, 94
AddCubicle, 79 FitParams, 94
CalcShiftedReversedBoundary, 79 GetIthr, 95
Clear, 79 GetType, 95
GetInterior, 80 GetY0m, 95
IsSplitting, 80 GetY1m, 95
Resize, 80 GetZ0m, 96
Update, 80 GetZ1m, 96
ElmBranch, 81 GetZmatDist, 97
Update, 81 HasRoutes, 97
ElmCabsys, 81 HasRoutesOrSec, 97
FitParams, 81 IsCable, 98
GetLineCable, 81 IsNetCoupling, 98
Update, 81 MeasureLength, 98
ElmComp, 82 SetDetailed, 99

DIgSILENT PowerFactory 2018, Python Function Reference 432


Index

ElmLnesec, 99 GetRelCase, 117


IsCable, 99 GetSubElmRes, 117
ElmNec, 99 GetUnit, 118
GetGroundingImpedance, 99 GetValue, 118
ElmNet, 100 GetVariable, 119
Activate, 100 Init, 119
CalculateInterchangeTo, 100 InitialiseWriting, 119
Deactivate, 100 Load, 119
DefineBoundary, 101 NCol, 116
ElmPvsys, 101 NRow, 116
Derate, 101 Release, 120
Disconnect, 101 SetAsDefault, 120
GetAvailableGenPower, 102 SetObj, 120
GetGroundingImpedance, 102 SetSubElmResKey, 120
IsConnected, 103 SizeX, 116
Reconnect, 103 SizeY, 116
ResetDerating, 103 SortAccordingToColumn, 120
ElmRelay, 103 Write, 121
CheckRanges, 104 WriteDraw, 121
GetCalcRX, 104 ElmShnt, 121
GetMaxFdetectCalcI, 104 GetGroundingImpedance, 121
GetSlot, 105 ElmStactrl, 122
GetUnom, 105 GetControlledHVNode, 122
IsStarted, 105 GetControlledLVNode, 122
SetImpedance, 106 GetStepupTransformer, 122
SetMaxI, 107 Info, 123
SetMaxIearth, 107 ElmSubstat, 123
SetMinI, 107 ApplyAndResetRA, 123
SetMinIearth, 107 GetSplit, 123
SetOutOfService, 107 GetSplitCal, 124
SetTime, 108 GetSplitIndex, 125
slotupd, 108 GetSuppliedElements, 125
SlotUpdate, 108 OverwriteRA, 126
ElmRes, 109 ResetRA, 126
AddVariable, 109 SaveAsRA, 126
AddVars, 109 SetRA, 126
Clear, 110 ElmSvs, 127
Close, 112 GetStepupTransformer, 127
FindColumn, 110 ElmSym, 127
FindMaxInColumn, 110 Derate, 128
FindMaxOfVariableInRow, 111 Disconnect, 128
FindMinInColumn, 111 GetAvailableGenPower, 128
FindMinOfVariableInRow, 111 GetGroundingImpedance, 129
FinishWriting, 112 GetMotorStartingFlag, 129
Flush, 112 GetStepupTransformer, 129
GetDescription, 112 IsConnected, 130
GetFirstValidObject, 113 Reconnect, 130
GetFirstValidObjectVariable, 114 ResetDerating, 130
GetFirstValidVariable, 114 ElmTerm, 130
GetNextValidObject, 114 GetBusType, 131
GetNextValidObjectVariable, 116 GetCalcRelevantCubicles, 131
GetNextValidVariable, 116 GetConnectedBrkCubicles, 131
GetNumberOfColumns, 116 GetConnectedCubicles, 131
GetNumberOfRows, 116 GetConnectedMainBuses, 132
GetObj, 117 GetConnectionInfo, 132
GetObject, 117 GetEquivalentTerminals, 132

DIgSILENT PowerFactory 2018, Python Function Reference 433


Index

GetMinDistance, 133 DefineBoundary, 154


GetNextHVBus, 133 GetAll, 154
GetNodeName, 134 GetBranches, 154
GetSepStationAreas, 134 GetBuses, 154
HasCreatedCalBus, 134 GetObjs, 154
IsElectrEquivalent, 134 SetLoadScaleAbsolute, 155
IsEquivalent, 135 EnableDiffMode
IsInternalNodeInStation, 136 IntSstage, 375
UpdateSubstationTerminals, 136 Encrypt
ElmTr2, 136 BlkDef, 320
CreateEvent, 136 ComDpl, 247
GetGroundingImpedance, 137 Energize
GetSuppliedElements, 137 General Object Methods, 47
GetTapPhi, 138 Environment Functions, 31
GetTapRatio, 138 EchoOff, 31
GetZ0pu, 139 EchoOn, 31
GetZpu, 139 IsAutomaticCalculationResetEnabled, 32
IsQuadBooster, 139 IsFinalEchoOnEnabled, 32
NTap, 140 SetAutomaticCalculationResetEnabled, 32
ElmTr3, 140 SetEnableUserBreak, 34
CreateEvent, 140 SetFinalEchoOnEnabled, 32
GetGroundingImpedance, 140 SetGraphicUpdate, 33
GetSuppliedElements, 141 SetGuiUpdateEnabled, 33
GetTapPhi, 141 SetRescheduleFlag, 33
GetTapRatio, 142 SetUserBreakEnabled, 34
GetTapZDependentSide, 142 EstimateLoading
GetZ0pu, 142 ComLdf, 255
GetZpu, 143 EstimateOutage
IsQuadBooster, 143 ComLdf, 256
NTap, 144 Execute
ElmTr4, 144 ComAddlabel, 225
CreateEvent, 144 ComConreq, 239
GetGroundingImpedance, 145 ComDpl, 247
GetSuppliedElements, 145 ComFlickermeter, 251
GetTapPhi, 146 ComLdf, 256
GetTapRatio, 146 Commands Methods, 225
GetTapZDependentSide, 146 ComSimoutage, 286
GetZ0pu, 147 ExecuteAllSteps
GetZpu, 147 ComShctrace, 280
IsQuadBooster, 148 ExecuteCmd
NTap, 148 Application Methods, 7
ElmTrfstat, 148 ExecuteCntcy
GetSplit, 148 ComSimoutage, 286
GetSplitCal, 149 ExecuteInitialStep
GetSplitIndex, 150 ComShctrace, 280
GetSuppliedElements, 150 ExecuteNextStep
ElmVoltreg, 151 ComShctrace, 280
CreateEvent, 151 ExecuteRecording
GetGroundingImpedance, 151 ComMerge, 261
GetZpu, 152 ExecuteRXSweep
NTap, 152 ComShc, 277
ElmXnet, 152 ExecuteTime
GetGroundingImpedance, 152 ComOutage, 268
GetStepupTransformer, 153 ExecuteWithActiveProject
ElmZone, 153 ComMerge, 261
CalculateInterchangeTo, 153 ExeEvt

DIgSILENT PowerFactory 2018, Python Function Reference 434


Index

ComRel3, 274 GetAttributeDescription, 48


Export GetAttributeLength, 48
IntGrfgroup, 343 GetAttributeShape, 48
IntGrflayer, 344 GetAttributeType, 49
ExportAndInitQuickAccess GetAttributeUnit, 49
ComUcteexp, 293 GetChildren, 50
ExportFullRange GetClassName, 50
ComRes, 277 GetCombinedProjectSource, 50
ExportToClipboard GetConnectedElements, 51
ElmDsl, 84 GetConnectionCount, 51
ExportToFile GetContents, 51
ElmDsl, 85 GetControlledNode, 52
GetCubicle, 52
File System Functions, 28 GetFullName, 52
GetInstallationDirectory, 28 GetImpedance, 53
GetInstallDir, 28 GetInom, 53
GetTempDir, 28 GetNode, 54
GetTemporaryDirectory, 28 GetOperator, 54
GetWorkingDir, 28 GetOwner, 54
GetWorkspaceDirectory, 28 GetParent, 55
FileNmResNm GetReferences, 55
ComRes, 277 GetRegion, 55
FinaliseModule GetSupplyingSubstations, 56
ComAddon, 236 GetSupplyingTransformers, 56
FindColumn GetSupplyingTrfstations, 56
ElmRes, 110 GetSystemGrounding, 56
IntComtrade, 333 GetUnom, 57
IntComtradeset, 337 GetUserAttribute, 57
FindMaxInColumn GetZeroImpedance, 58
ElmRes, 110 HasAttribute, 58
IntComtrade, 334 HasResults, 59
IntComtradeset, 337 IsCalcRelevant, 59
FindMaxOfVariableInRow IsDeleted, 59
ElmRes, 111 IsEarthed, 59
FindMinInColumn IsEnergized, 60
ElmRes, 111 IsHidden, 60
IntComtrade, 334 IsInFeeder, 60
IntComtradeset, 338 IsNetworkDataFolder, 61
FindMinOfVariableInRow IsNode, 61
ElmRes, 111 IsObjectActive, 61
FinishWriting IsObjectModifiedByVariation, 62
ElmRes, 112 Isolate, 62
FitParams IsOutOfService, 63
ElmCabsys, 81 IsReducible, 63
ElmLne, 94 IsShortCircuited, 63
Flush MarkInGraphics, 64
ElmRes, 112 Move, 64
PasteCopy, 64
General Object Methods, 44 PurgeUnusedObjects, 65
AddCopy, 45 ReplaceNonAsciiCharacters, 65
ContainsNonAsciiCharacters, 46 ReportNonAsciiCharacters, 65
CopyData, 46 ReportUnusedObjects, 66
CreateObject, 46 SearchObject, 66
Delete, 47 SetAttribute, 66
Energize, 47 SetAttributeLength, 66
GetAttribute, 47 SetAttributeShape, 67

DIgSILENT PowerFactory 2018, Python Function Reference 435


Index

ShowEditDialog, 67 GetAttributeType
ShowModalSelectTree, 67 General Object Methods, 49
SwitchOff, 68 GetAttributeUnit
SwitchOn, 68 General Object Methods, 49
WriteChangesToDb, 69 GetAvailableButtons
Get SetTboxconfig, 314
IntMat, 346 GetAvailableGenPower
IntVec, 381 ElmAsm, 71
SetFilt, 307 ElmAsmsc, 74
GetActiveCalculationStr ElmGenstat, 89
Application Methods, 7 ElmPvsys, 102
GetActiveModule ElmSym, 128
ComAddon, 236 GetBbOrder
GetActiveNetworkVariations ElmBbone, 76
Application Methods, 8 GetBlockedSwitches
GetActiveProject ComShctrace, 280
Application Methods, 8 GetBorderCubicles
GetActiveScenario Application Methods, 9
Application Methods, 8 GetBranch
GetActiveScenarioScheduler StaCubic, 156
Application Methods, 8 GetBranches
GetActiveScheduler ElmArea, 70
IntScheme, 373 ElmFeeder, 86
GetActiveStages ElmZone, 154
Application Methods, 9 GetBrowserSelection
GetActiveStudyCase Application Methods, 10
Application Methods, 9 GetBuses
GetAll ElmArea, 70
ComNmink, 266 ElmFeeder, 86
ElmArea, 70 ElmZone, 154
ElmFeeder, 86 GetBusType
ElmZone, 154 ElmTerm, 131
IntDataset, 341 GetCalcRelevantCubicles
SetSelect, 314 ElmTerm, 131
StaCubic, 156 GetCalcRelevantObjects
GetAllUsers Application Methods, 10
Application Methods, 9 GetCalcRX
GetApplication ElmRelay, 104
Module Functions, 2 GetCheckSum
GetApplicationExt BlkDef, 321
Module Functions, 2 GetChildren
GetApplicationSecured General Object Methods, 50
Module Functions, 3 GetClassDescription
GetApplicationSecuredExt Application Methods, 11
Module Functions, 3 GetClassId
GetAttribute Application Methods, 11
General Object Methods, 47 GetClassName
GetAttributeDescription General Object Methods, 50
General Object Methods, 48 GetColumnLabel
GetAttributeEnumerationType IntMat, 346
CimModel, 323 GetCombinedProjectSource
CimObject, 327 General Object Methods, 50
GetAttributeLength GetCompleteBbPath
General Object Methods, 48 ElmBbone, 76
GetAttributeShape GetConnectedBranches
General Object Methods, 48 ComUcteexp, 293

DIgSILENT PowerFactory 2018, Python Function Reference 436


Index

GetConnectedBrkCubicles IntPrj, 359


ElmTerm, 131 IntVersion, 384
GetConnectedCubicles GetDescription
ElmTerm, 131 ElmRes, 112
GetConnectedElements IntComtrade, 334
General Object Methods, 51 IntComtradeset, 338
GetConnectedMainBuses GetDeviceSwitches
ElmTerm, 132 ComShctrace, 281
GetConnectedMajorNodes GetDeviceTime
StaCubic, 156 ComShctrace, 281
GetConnectionCount GetDiagramSelection
General Object Methods, 51 Application Methods, 13
GetConnectionInfo GetDisplayedButtons
ElmTerm, 132 SetTboxconfig, 314
GetConnections GetElecTorque
StaCubic, 157 ElmAsm, 72
GetContent GetEquivalentTerminals
Output Window Methods, 42 ElmTerm, 132
GetContents GetExternalObject
General Object Methods, 51 ComDpl, 247
GetContingencies ComPython, 270
ComRelreport, 277 GetFaultType
GetContributionOfComponent ComShc, 278
ComRelpost, 276 GetFeeders
ComRelreport, 277 ComOmr, 266
GetControlledHVNode GetFirstValidObject
ElmStactrl, 122 ElmRes, 113
GetControlledLVNode GetFirstValidObjectVariable
ElmStactrl, 122 ElmRes, 114
GetControlledNode GetFirstValidVariable
General Object Methods, 52 ElmRes, 114
GetCorrespondingObject GetFlowOrientation
ComMerge, 261 Application Methods, 13
GetCreatedObjects GetFOR
ComImport, 253 ElmBbone, 77
GetCriticalTimePhase GetFromSigName
IntThrating, 378 BlkSig, 322
GetCubicle GetFromStudyCase
General Object Methods, 52 Application Methods, 14
GetCurrentDiagram GetFromToNodeNames
Application Methods, 11 ComUcteexp, 294
GetCurrentIteration GetFullName
ComGenrelinc, 251 General Object Methods, 52
GetCurrentScript GetGeneratorEvent
Application Methods, 11 ComContingency, 240
GetCurrentSelection GetGeoCoordinateSystem
Application Methods, 12 IntPrj, 359
GetCurrentTimeStep GetGlobalLibrary
ComShctrace, 281 Application Methods, 14
GetCurrentUser GetGraphicsBoard
Application Methods, 12 Application Methods, 14
GetCurrentZoomScaleLevel GetGroundingImpedance
Application Methods, 12 ElmAsm, 72
GetDataFolder ElmAsmsc, 74
Application Methods, 12 ElmFilter, 88
GetDerivedProjects ElmGenstat, 90

DIgSILENT PowerFactory 2018, Python Function Reference 437


Index

ElmGndswt, 92 GetLocalLibrary
ElmNec, 99 Application Methods, 15
ElmPvsys, 102 GetMaxFdetectCalcI
ElmShnt, 121 ElmRelay, 104
ElmSym, 129 GetMaxNumIterations
ElmTr2, 137 ComGenrelinc, 252
ElmTr3, 140 GetMeanCs
ElmTr4, 145 ElmBbone, 77
ElmVoltreg, 151 GetMeaValue
ElmXnet, 152 StaExtbrkmea, 159
GetGroups StaExtcmdmea, 164
IntUserman, 381 StaExtdatmea, 169
GetHistoricalProject StaExtfmea, 174
IntVersion, 384 StaExtfuelmea, 179
GetImpedance StaExtimea, 184
General Object Methods, 53 StaExtpfmea, 189
GetInom StaExtpmea, 194
General Object Methods, 53 StaExtqmea, 199
GetInputParameterDouble StaExttapmea, 209
ComDpl, 248 StaExtv3mea, 214
ComPython, 271 StaExtvmea, 219
GetInputParameterInt GetMechTorque
ComDpl, 248 ElmAsm, 73
ComPython, 271 GetMinCs
GetInputParameterString ElmBbone, 77
ComDpl, 249 GetMinDistance
ComPython, 272 ElmTerm, 133
GetInstallationDirectory GetModification
File System Functions, 28 ComMerge, 261
GetInstallDir GetModificationResult
File System Functions, 28 ComMerge, 262
GetInterfaceVersion GetModifiedObjects
Application Methods, 14 ComImport, 253
GetInterior ComMerge, 262
ElmBoundary, 80 GetMotorConnections
GetInterruptedPowerAndCustomersForStage ComMot, 265
ComContingency, 241 GetMotorStartingFlag
GetInterruptedPowerAndCustomersForTimeStep ElmAsm, 73
ComContingency, 241 ElmSym, 129
GetIthr GetMotorSwitch
ElmLne, 95 ComMot, 265
GetLanguage GetMotorTerminal
Application Methods, 15 ComMot, 265
GetLatestVersion GetNearestBusbars
IntPrj, 359 StaCubic, 157
GetLimit GetNextHVBus
ScnFreq, 386 ElmTerm, 133
ScnFrt, 388 GetNextValidObject
ScnSpeed, 389 ElmRes, 114
ScnSync, 391 GetNextValidObjectVariable
ScnVar, 393 ElmRes, 116
ScnVolt, 394 GetNextValidVariable
GetLineCable ElmRes, 116
ElmCabsys, 81 GetNode
GetLoadEvent General Object Methods, 54
ComContingency, 242 GetNodeName

DIgSILENT PowerFactory 2018, Python Function Reference 438


Index

ElmTerm, 134 GetOrInsertPlot


GetNodesBranches SetVipage, 317
ElmFeeder, 87 GetOutputWindow
GetNonStartedDevices Output Window Functions, 40
ComShctrace, 281 GetOverLoadedBranches
GetNTopLoadedElms ComShc, 278
ComSimoutage, 286 GetOverLoadedBuses
GetNumberOfClusters ComShc, 279
SetCluster, 296 GetOwner
GetNumberOfColumns General Object Methods, 54
ElmRes, 116 GetPage
IntComtrade, 335 SetDesktop, 304
IntComtradeset, 338 GetParameterCount
IntMat, 347 CimModel, 323
GetNumberOfGeneratorEventsForTimeStep CimObject, 327
ComContingency, 242 GetParameterNamespace
GetNumberOfLoadEventsForTimeStep CimModel, 323
ComContingency, 242 CimObject, 328
GetNumberOfRows GetParameterValue
ElmRes, 116 CimModel, 324
IntComtrade, 335 CimObject, 328
IntComtradeset, 339 GetParent
IntMat, 347 General Object Methods, 55
GetNumberOfSwitchEventsForTimeStep GetPathToNearestBusbar
ComContingency, 243 StaCubic, 157
GetNumberOfTimeSteps GetProjectFolder
ComContingency, 243 Application Methods, 15
GetNumberOfViolations GetProjectFolderType
ScnFreq, 386 IntPrjfolder, 363
ScnFrt, 388 GetQlim
ScnSpeed, 390 IntQlim, 364
ScnSync, 391 GetRandomNumber
ScnVar, 393 Mathematical Functions, 34
ScnVolt, 395 GetRandomNumberEx
GetNumSlave Mathematical Functions, 35
SetParalman, 310 GetRating
GetObj IntThrating, 378
ComContingency, 243 GetRecordingStage
ElmRes, 117 Application Methods, 16
GetObject GetReferences
ComOutage, 269 General Object Methods, 55
ElmRes, 117 GetRegion
GetObjects General Object Methods, 55
IntScenario, 368 GetRegionCount
GetObjs ComOmr, 267
ElmArea, 71 GetRelCase
ElmFeeder, 87 ElmRes, 117
ElmZone, 154 GetRemoteBreakers
GetOMR ElmCoup, 82
ComOmr, 267 GetRowLabel
GetOperationValue IntMat, 347
IntScenario, 368 GetScaleObjX
GetOperator VisHrm, 402
General Object Methods, 54 VisPlot, 411
GetOrderCode VisPlot2, 417
ComUcteexp, 294 GetScaleObjY

DIgSILENT PowerFactory 2018, Python Function Reference 439


Index

VisHrm, 402 GetStepupTransformer


VisPlot, 411 ElmAsm, 73
VisPlot2, 417 ElmAsmsc, 75
GetScenario ElmGenstat, 90
IntScensched, 371 ElmStactrl, 122
GetScheme ElmSvs, 127
IntSstage, 375 ElmSym, 129
GetSepStationAreas ElmXnet, 153
ElmTerm, 134 GetStudyTimeObject
GetSettings Date/Time Functions, 29
Application Methods, 16 GetSubElmRes
GetSimulationTime ElmRes, 117
ComSim, 283 GetSummaryGrid
GetSlot Application Methods, 16
ElmRelay, 105 GetSuppliedElements
GetSplit ElmSubstat, 125
ElmSubstat, 123 ElmTr2, 137
ElmTrfstat, 148 ElmTr3, 141
GetSplitCal ElmTr4, 145
ElmSubstat, 124 ElmTrfstat, 150
ElmTrfstat, 149 GetSupplyingSubstations
GetSplitIndex General Object Methods, 56
ElmSubstat, 125 GetSupplyingTransformers
ElmTrfstat, 150 General Object Methods, 56
GetStartedDevices GetSupplyingTrfstations
ComShctrace, 281 General Object Methods, 56
GetStartEndTime GetSwitchEvent
IntScensched, 371 ComContingency, 243
GetStatus GetSwitchStatus
StaExtbrkmea, 159 IntRunarrange, 366
StaExtcmdmea, 164 GetSwitchTime
StaExtdatmea, 170 ComShctrace, 282
StaExtfmea, 174 GetSystemGrounding
StaExtfuelmea, 179 General Object Methods, 56
StaExtimea, 184 GetTapPhi
StaExtpfmea, 189 ElmTr2, 138
StaExtpmea, 194 ElmTr3, 141
StaExtqmea, 199 ElmTr4, 146
StaExtsmea, 204 GetTapRatio
StaExttapmea, 209 ElmTr2, 138
StaExtv3mea, 214 ElmTr3, 142
StaExtvmea, 219 ElmTr4, 146
GetStatusTmp GetTapZDependentSide
StaExtbrkmea, 159 ElmTr3, 142
StaExtcmdmea, 165 ElmTr4, 146
StaExtdatmea, 170 GetTempDir
StaExtfmea, 175 File System Functions, 28
StaExtfuelmea, 180 GetTemporaryDirectory
StaExtimea, 185 File System Functions, 28
StaExtpfmea, 190 GetTieOpenPoint
StaExtpmea, 195 ElmBbone, 77
StaExtqmea, 200 GetTimeOfStepInSeconds
StaExtsmea, 204 ComContingency, 244
StaExttapmea, 210 GetToSigName
StaExtv3mea, 215 BlkSig, 322
StaExtvmea, 220 GetTotalInterruptedPower

DIgSILENT PowerFactory 2018, Python Function Reference 440


Index

ComContingency, 244 GetVI


GetTotalWarnA SetVipage, 317
ComSim, 283 GetViolatedElement
GetTotalWarnB ScnFreq, 387
ComSim, 283 ScnFrt, 389
GetTotalWarnC ScnSpeed, 390
ComSim, 283 ScnSync, 392
GetTotLength ScnVar, 394
ElmBbone, 78 ScnVolt, 395
GetTransferCalcData GetViolatedScanModules
ComTransfer, 292 ComSim, 283
GetTrippedDevices GetViolationTime
ComShctrace, 282 ScnFreq, 387
GetType ScnFrt, 389
ElmLne, 95 ScnSpeed, 391
GetUcteNodeName ScnSync, 392
ComUcteexp, 294 ScnVar, 394
GetUnit ScnVolt, 396
ElmRes, 118 GetWorkingDir
IntComtrade, 335 File System Functions, 28
IntComtradeset, 339 GetWorkspaceDirectory
GetUnom File System Functions, 28
ElmRelay, 105 GetY0m
General Object Methods, 57 ElmLne, 95
GetUserAttribute GetY1m
General Object Methods, 57 ElmLne, 95
GetUserManager GetZ0m
Application Methods, 16 ElmLne, 96
GetUsers GetZ0pu
IntUserman, 381 ElmTr2, 139
GetValue ElmTr3, 142
ElmRes, 118 ElmTr4, 147
IntComtrade, 335 GetZ1m
IntComtradeset, 339 ElmLne, 96
ScnFreq, 386 GetZeroImpedance
ScnFrt, 388 General Object Methods, 58
ScnSpeed, 390 GetZeroSequenceHVLVT
ScnSync, 392 TypTr2, 397
ScnVar, 393 GetZmatDist
ScnVolt, 395 ElmLne, 97
GetVar GetZpu
IntMon, 352 ElmTr2, 139
GetVariable ElmTr3, 143
ElmRes, 119 ElmTr4, 147
IntComtrade, 336 ElmVoltreg, 152
IntComtradeset, 340
ScnFreq, 387 HasAttribute
ScnFrt, 388 General Object Methods, 58
ScnSpeed, 390 HasCreatedCalBus
ScnSync, 392 ElmTerm, 134
ScnVar, 393 HasExternalReferences
ScnVolt, 395 IntPrj, 360
GetVariation HasGnrlMod
IntSstage, 375 ElmBbone, 78
GetVersions HasParameter
IntPrj, 360 CimModel, 324

DIgSILENT PowerFactory 2018, Python Function Reference 441


Index

CimObject, 328 GetValue, 335


HasResults GetVariable, 336
General Object Methods, 59 Load, 336
HasRoutes NCol, 335
ElmLne, 97 NRow, 335
HasRoutesOrSec Release, 336
ElmLne, 97 SizeX, 335
Hide SizeY, 335
Application Methods, 17 SortAccordingToColumn, 336
IntComtradeset, 337
Import FindColumn, 337
IntGrfgroup, 344 FindMaxInColumn, 337
IntGrflayer, 345 FindMinInColumn, 338
Info GetDescription, 338
ElmStactrl, 123 GetNumberOfColumns, 338
Init GetNumberOfRows, 339
ElmRes, 119 GetUnit, 339
IntMat, 348 GetValue, 339
IntVec, 382 GetVariable, 340
InitialiseWriting Load, 340
ElmRes, 119 NCol, 338
InitQuickAccess NRow, 339
ComUcteexp, 295 Release, 340
InitTmp SizeX, 339
StaExtbrkmea, 160 SizeY, 338
StaExtcmdmea, 165 SortAccordingToColumn, 340
StaExtdatmea, 170 IntDataset, 340
StaExtfmea, 175 AddRef, 341
StaExtfuelmea, 180 All, 341
StaExtimea, 185 Clear, 341
StaExtpfmea, 190 GetAll, 341
StaExtpmea, 195 IntEvt, 341
StaExtqmea, 200 CreateCBEvents, 341
StaExtsmea, 204 RemoveSwitchEvents, 342
StaExttapmea, 210 IntExtaccess, 342
StaExtv3mea, 215 CheckUrl, 342
StaExtvmea, 220 IntGate, 343
InsertPlot AddTrigger, 343
SetVipage, 318 IntGrf, 343
IntCase, 331 MoveToLayer, 343
Activate, 331 IntGrfgroup, 343
ApplyNetworkState, 331 ClearData, 343
ApplyStudyTime, 331 Export, 343
Consolidate, 332 Import, 344
Deactivate, 332 IntGrflayer, 344
SetStudyTime, 332 ClearData, 344
IntComtrade, 333 Export, 344
ConvertToASCIIFormat, 333 Import, 345
ConvertToBinaryFormat, 333 IntGrfnet, 345
FindColumn, 333 SetLayerVisibility, 345
FindMaxInColumn, 334 Show, 345
FindMinInColumn, 334 IntMat, 345
GetDescription, 334 ColLbl, 346
GetNumberOfColumns, 335 Get, 346
GetNumberOfRows, 335 GetColumnLabel, 346
GetUnit, 335 GetNumberOfColumns, 347

DIgSILENT PowerFactory 2018, Python Function Reference 442


Index

GetNumberOfRows, 347 Restore, 361


GetRowLabel, 347 SetGeoCoordinateSystem, 361
Init, 348 SubscribeProjectReadOnly, 362
Invert, 348 SubscribeProjectReadWrite, 362
Multiply, 348 TransformGeoCoordinates, 362
NCol, 347 UnsubscribeProject, 362
NRow, 347 UpdateStatistics, 363
Resize, 349 IntPrjfolder, 363
RowLbl, 347, 349 GetProjectFolderType, 363
Save, 349 IsProjectFolderType, 364
Set, 350 IntQlim, 364
SetColumnLabel, 350 GetQlim, 364
SetRowLabel, 350 IntRas, 365
SizeX, 347 AddEvent, 365
SizeY, 347 AddTrigger, 365
SortToColum, 351 IsValid, 365
SortToColumn, 351 IntRunarrange, 366
IntMon, 351 GetSwitchStatus, 366
AddVar, 352 IntScenario, 366
ClearVars, 352 Activate, 367
GetVar, 352 Apply, 367
NVars, 352 ApplySelective, 367
PrintAllVal, 352 Deactivate, 368
PrintVal, 352 DiscardChanges, 368
RemoveVar, 353 GetObjects, 368
IntOutage, 353 GetOperationValue, 368
Apply, 353 ReleaseMemory, 369
ApplyAll, 353 Save, 369
Check, 354 SetOperationValue, 369
CheckAll, 354 IntScensched, 370
IsInStudyTime, 354 Activate, 370
IsInStudytime, 354 Deactivate, 370
ResetAll, 355 DeleteRow, 371
IntPlot, 355 GetScenario, 371
SetAdaptY, 355 GetStartEndTime, 371
SetAutoScaleY, 355 SearchScenario, 372
SetScaleY, 356 IntScheme, 372
IntPrj, 356 Activate, 372
Activate, 357 Consolidate, 372
AddProjectToCombined, 357 Deactivate, 373
AddProjectToRemoteDatabase, 357 GetActiveScheduler, 373
Archive, 357 NewStage, 373
CanAddProjectToRemoteDatabase, 358 IntSscheduler, 373
CanSubscribeProjectReadOnly, 358 Activate, 374
CanSubscribeProjectReadWrite, 358 Deactivate, 374
CreateVersion, 358 Update, 374
Deactivate, 359 IntSstage, 374
GetDerivedProjects, 359 Activate, 374
GetGeoCoordinateSystem, 359 CreateStageObject, 375
GetLatestVersion, 359 EnableDiffMode, 375
GetVersions, 360 GetScheme, 375
HasExternalReferences, 360 GetVariation, 375
LoadData, 360 IsExcluded, 376
Migrate, 360 PrintModifications, 376
Purge, 361 ReadValue, 376
RemoveProjectFromCombined, 361 WriteValue, 377

DIgSILENT PowerFactory 2018, Python Function Reference 443


Index

IntSubset, 377 IsCalcRelevant


Apply, 377 General Object Methods, 59
ApplySelective, 377 IsClosed
Clear, 378 ElmCoup, 83
IntThrating, 378 ElmGndswt, 92
GetCriticalTimePhase, 378 StaCubic, 158
GetRating, 378 StaSwitch, 224
IntUrl, 379 IsConnected
View, 379 ElmGenstat, 91
IntUser, 379 ElmPvsys, 103
Purge, 379 ElmSym, 130
SetPassword, 379 StaCubic, 158
TerminateSession, 380 IsDC
IntUserman, 380 ComLdf, 257
CreateGroup, 380 IsDeleted
CreateUser, 380 General Object Methods, 59
GetGroups, 381 IsEarthed
GetUsers, 381 General Object Methods, 59
UpdateGroups, 381 IsElectrEquivalent
IntVec, 381 ElmTerm, 134
Get, 381 IsEncrypted
Init, 382 ComDpl, 249
Max, 382 IsEnergized
Mean, 382 General Object Methods, 60
Min, 382 IsEquivalent
Resize, 382 ElmTerm, 135
Save, 383 IsExcluded
Set, 383 IntSstage, 376
Size, 383 IsFinalEchoOnEnabled
Sort, 383 Environment Functions, 32
IntVersion, 384 IsHidden
CreateDerivedProject, 384 General Object Methods, 60
GetDerivedProjects, 384 IsInFeeder
GetHistoricalProject, 384 General Object Methods, 60
Rollback, 384 IsInStudyTime
IntViewbookmark, 385 IntOutage, 354
JumpTo, 385 IsInStudytime
UpdateFromCurrentView, 385 IntOutage, 354
Invert IsInternalNodeInStation
IntMat, 348 ElmTerm, 136
InvertMatrix IsLastIterationFeasible
Mathematical Functions, 35 ComTransfer, 292
IsAC IsLdfValid
ComLdf, 257 Application Methods, 17
IsAttributeModeInternal IsNetCoupling
Application Methods, 17 ElmLne, 98
IsAutomaticCalculationResetEnabled IsNetworkDataFolder
Environment Functions, 32 General Object Methods, 61
IsBalanced IsNode
ComLdf, 257 General Object Methods, 61
IsBreaker IsObjectActive
ElmCoup, 83 General Object Methods, 61
IsCable IsObjectModifiedByVariation
ElmLne, 98 General Object Methods, 62
ElmLnesec, 99 Isolate
TypLne, 397 General Object Methods, 62

DIgSILENT PowerFactory 2018, Python Function Reference 444


Index

IsOpen StaExtv3mea, 215


ElmCoup, 84 StaExtvmea, 220
ElmGndswt, 92 IsValid
StaSwitch, 224 IntRas, 365
IsOutOfService IsWriteCacheEnabled
General Object Methods, 63 Application Methods, 18
IsPQ
ElmAsm, 74 JumpTo
IsProjectFolderType IntViewbookmark, 385
IntPrjfolder, 364 JumpToLastStep
IsQuadBooster ComContingency, 244
ElmTr2, 139
Load
ElmTr3, 143
ElmRes, 119
ElmTr4, 148
IntComtrade, 336
IsReducible
IntComtradeset, 340
General Object Methods, 63
LoadData
IsRmsValid
IntPrj, 360
Application Methods, 17
LoadFile
IsScenarioAttribute
ElmFile, 87
Application Methods, 17
LoadMicroSCADAFile
IsShcValid
ComLink, 258
Application Methods, 18
LoadProfile
IsShortCircuited
Application Methods, 18
General Object Methods, 63
LoadSimulationState
IsSimValid
ComSim, 283
Application Methods, 18
LoadSnapshot
IsSplitting
ComSim, 283
ElmBoundary, 80
LossCostAtBusTech
IsStarted
ComCapo, 238
ElmRelay, 105
IsStatusBitSet Mark
StaExtbrkmea, 160 SetLevelvis, 310
StaExtcmdmea, 165 MarkInGraphics
StaExtdatmea, 170 Application Methods, 19
StaExtfmea, 175 General Object Methods, 64
StaExtfuelmea, 180 MarkRegions
StaExtimea, 185 ComSimoutage, 287
StaExtpfmea, 190 Mathematical Functions, 34
StaExtpmea, 195 GetRandomNumber, 34
StaExtqmea, 200 GetRandomNumberEx, 35
StaExtsmea, 205 InvertMatrix, 35
StaExttapmea, 210 RndExp, 36
StaExtv3mea, 215 RndGetMethod, 36
StaExtvmea, 220 RndGetSeed, 37
IsStatusBitSetTmp RndNormal, 37
StaExtbrkmea, 160 RndSetup, 37
StaExtcmdmea, 165 RndUnifInt, 38
StaExtdatmea, 170 RndUnifReal, 39
StaExtfmea, 175 RndWeibull, 39
StaExtfuelmea, 180 SetRandomSeed, 39
StaExtimea, 185 Max
StaExtpfmea, 190 IntVec, 382
StaExtpmea, 195 Mean
StaExtqmea, 200 IntVec, 382
StaExtsmea, 205 MeasureLength
StaExttapmea, 210 ElmLne, 98

DIgSILENT PowerFactory 2018, Python Function Reference 445


Index

Merge SetOutputWindowState, 41
ComMerge, 263 Output Window Methods, 42
Migrate Clear, 42
IntPrj, 360 GetContent, 42
Min Print, 42
IntVec, 382 Save, 43
Module Functions, 2 SetState, 43
GetApplication, 2 OutputFlexibleData
GetApplicationExt, 2 Application Methods, 19
GetApplicationSecured, 3 OverwriteRA
GetApplicationSecuredExt, 3 ElmSubstat, 126
ModuleExists OvlAlleviate
ComAddon, 236 ComRel3, 274
Move
General Object Methods, 64 Pack
MoveToLayer BlkDef, 321
IntGrf, 343 PackAsMacro
Multiply BlkDef, 321
IntMat, 348 PasteCopy
General Object Methods, 64
NCol PostCommand
ElmRes, 116 Application Methods, 20
IntComtrade, 335 Print
IntComtradeset, 338 Output Window Methods, 42
IntMat, 347 PrintAllVal
Network Elements Methods, 69 IntMon, 352
NewStage PrintCheckResults
IntScheme, 373 ComLdf, 257
NextStepAvailable PrintComparisonReport
ComShctrace, 282 ComMerge, 263
NRow PrintError
ElmRes, 116 Output Window Functions, 40
IntComtrade, 335 PrintInfo
IntComtradeset, 339 Output Window Functions, 40
IntMat, 347 PrintModifications
NTap ComMerge, 263
ElmTr2, 140 IntSstage, 376
ElmTr3, 144 PrintPlain
ElmTr4, 148 Output Window Functions, 41
ElmVoltreg, 152 PrintVal
NVars IntMon, 352
IntMon, 352 PrintWarn
Output Window Functions, 41
Object Methods, 44 Purge
Open IntPrj, 361
ElmCoup, 84 IntUser, 379
ElmGndswt, 93 SetTboxconfig, 315
StaSwitch, 225 PurgeUnusedObjects
Other Objects Methods, 320 General Object Methods, 65
Output Window Functions, 40
ClearOutputWindow, 40 QuickAccessAvailable
GetOutputWindow, 40 ComUcteexp, 295
PrintError, 40
PrintInfo, 40 ReadValue
PrintPlain, 41 IntSstage, 376
PrintWarn, 41 Rebuild
Application Methods, 20

DIgSILENT PowerFactory 2018, Python Function Reference 446


Index

ReceiveData IntOutage, 355


ComLink, 258 ResetCalculation
ComOpc, 267 Application Methods, 20
Reconnect ResetDerating
ElmGenstat, 91 ElmGenstat, 91
ElmPvsys, 103 ElmPvsys, 103
ElmSym, 130 ElmSym, 130
Refresh ResetQuickAccess
VisMagndiffplt, 405 ComUcteexp, 295
VisOcplot, 406 ResetRA
Release ElmSubstat, 126
ElmRes, 120 ResetStatusBit
IntComtrade, 336 StaExtbrkmea, 160
IntComtradeset, 340 StaExtcmdmea, 165
ReleaseMemory StaExtdatmea, 171
IntScenario, 369 StaExtfmea, 176
ReloadProfile StaExtfuelmea, 181
Application Methods, 20 StaExtimea, 186
RelZpol, 385 StaExtpfmea, 191
AssumeCompensationFactor, 385 StaExtpmea, 196
AssumeReRl, 385 StaExtqmea, 201
AssumeXeXl, 386 StaExtsmea, 205
RemoveCmdsForStudyCaseRow StaExttapmea, 210
ComTasks, 290 StaExtv3mea, 216
RemoveContingencies StaExtvmea, 221
ComSimoutage, 287 ResetStatusBitTmp
RemoveEvents StaExtbrkmea, 161
ComContingency, 244 StaExtcmdmea, 166
ComOutage, 269 StaExtdatmea, 171
ComRel3, 275 StaExtfmea, 176
RemoveOutages StaExtfuelmea, 181
ComRel3, 275 StaExtimea, 186
RemoveParameter StaExtpfmea, 191
CimModel, 324 StaExtpmea, 196
CimObject, 328 StaExtqmea, 201
RemoveProjectFromCombined StaExtsmea, 205
IntPrj, 361 StaExttapmea, 211
RemoveStudyCases StaExtv3mea, 216
ComTasks, 290 StaExtvmea, 221
RemoveSwitchEvents ResGetData
IntEvt, 342 Application Methods, 20
RemoveVar ResGetDescription
IntMon, 353 Application Methods, 21
ReplaceNonAsciiCharacters ResGetFirstValidObject
General Object Methods, 65 Application Methods, 21
Report ResGetFirstValidObjectVariable
ComDllmanager, 246 Application Methods, 21
ReportNonAsciiCharacters ResGetFirstValidVariable
General Object Methods, 65 Application Methods, 21
ReportUnusedObjects ResGetIndex
General Object Methods, 66 Application Methods, 21
Reset ResGetMax
ComMerge, 263 Application Methods, 22
ComSimoutage, 287 ResGetMin
SetLevelvis, 310 Application Methods, 22
ResetAll ResGetNextValidObject

DIgSILENT PowerFactory 2018, Python Function Reference 447


Index

Application Methods, 22 Application Methods, 24


ResGetNextValidObjectVariable SaveFile
Application Methods, 22 ElmFile, 88
ResGetNextValidVariable SaveSimulationState
Application Methods, 22 ComSim, 284
ResGetObject SaveSnapshot
Application Methods, 23 ComSim, 284
ResGetUnit ScnFreq, 386
Application Methods, 23 GetLimit, 386
ResGetValueCount GetNumberOfViolations, 386
Application Methods, 23 GetValue, 386
ResGetVariable GetVariable, 387
Application Methods, 23 GetViolatedElement, 387
ResGetVariableCount GetViolationTime, 387
Application Methods, 23 ScnFrt, 388
Resize GetLimit, 388
ElmBoundary, 80 GetNumberOfViolations, 388
IntMat, 349 GetValue, 388
IntVec, 382 GetVariable, 388
ResLoadData GetViolatedElement, 389
Application Methods, 23 GetViolationTime, 389
ResReleaseData ScnSpeed, 389
Application Methods, 23 GetLimit, 389
ResSortToVariable GetNumberOfViolations, 390
Application Methods, 24 GetValue, 390
Restore GetVariable, 390
IntPrj, 361 GetViolatedElement, 390
RndExp GetViolationTime, 391
Mathematical Functions, 36 ScnSync, 391
RndGetMethod GetLimit, 391
Mathematical Functions, 36 GetNumberOfViolations, 391
RndGetSeed GetValue, 392
Mathematical Functions, 37 GetVariable, 392
RndNormal GetViolatedElement, 392
Mathematical Functions, 37 GetViolationTime, 392
RndSetup ScnVar, 393
Mathematical Functions, 37 GetLimit, 393
RndUnifInt GetNumberOfViolations, 393
Mathematical Functions, 38 GetValue, 393
RndUnifReal GetVariable, 393
Mathematical Functions, 39 GetViolatedElement, 394
RndWeibull GetViolationTime, 394
Mathematical Functions, 39 ScnVolt, 394
Rollback GetLimit, 394
IntVersion, 384 GetNumberOfViolations, 395
RowLbl GetValue, 395
IntMat, 347, 349 GetVariable, 395
GetViolatedElement, 395
Save GetViolationTime, 396
IntMat, 349 SearchObject
IntScenario, 369 General Object Methods, 66
IntVec, 383 SearchObjectByForeignKey
Output Window Methods, 43 Application Methods, 24
SaveAsRA SearchScenario
ElmSubstat, 126 IntScensched, 372
SaveAsScenario SelectToolbox

DIgSILENT PowerFactory 2018, Python Function Reference 448


Index

Application Methods, 24 VisPlot, 412


SendData VisPlot2, 418
ComLink, 258 SetBatchMode
ComOpc, 268 ComUcte, 292
SentDataStatus SetBoundaries
ComLink, 259 ComGridtocim, 253
Set SetCluster, 296
IntMat, 350 CalcCluster, 296
IntVec, 383 GetNumberOfClusters, 296
SetActiveModule SetColouring
ComAddon, 237 SetColscheme, 298
SetAdaptX SetColscheme, 297
SetDesktop, 305 CreateFilter, 297
SetVipage, 318 SetColouring, 298
VisPath, 407 SetFilter, 303
VisPlot, 412 SetColumnLabel
VisPlot2, 417 IntMat, 350
SetAdaptY SetCrvDesc
IntPlot, 355 VisHrm, 403
VisPath, 407 VisPlot, 413
VisPlot, 412 VisPlot2, 419
VisPlot2, 417 SetCrvDescX
SetAsDefault VisXyplot, 423
ElmRes, 120 SetCrvDescY
SetAssociationValue VisXyplot, 424
CimModel, 324, 325 SetDefScaleX
CimObject, 329 VisHrm, 403
SetAttribute VisPlot, 413
General Object Methods, 66 VisPlot2, 419
SetAttributeEnumeration SetDefScaleY
CimModel, 325 VisHrm, 403
CimObject, 329, 330 VisPlot, 413
SetAttributeLength VisPlot2, 419
General Object Methods, 66 SetDesktop, 303
SetAttributeModeInternal AddPage, 304
Application Methods, 25 DoAutoScaleX, 304
SetAttributeShape GetPage, 304
General Object Methods, 67 SetAdaptX, 305
SetAttributeValue SetAutoScaleX, 305
CimModel, 326 SetResults, 305
CimObject, 330 SetScaleX, 305
SetAuthorityUri SetXVar, 306
ComGridtocim, 253 Show, 306
SetAutoAssignmentForAll WriteWMF, 307
ComMerge, 263 SetDetailed
SetAutomaticCalculationResetEnabled ElmLne, 99
Environment Functions, 32 SetDisplayedButtons
SetAutoScaleX SetTboxconfig, 315
SetDesktop, 305 SetDistrstate, 307
SetVipage, 318 CalcCluster, 307
VisHrm, 402 SetElms
VisPlot, 412 StoMaint, 396
VisPlot2, 418 SetEnableUserBreak
SetAutoScaleY Environment Functions, 34
IntPlot, 355 SetExternalObject
VisHrm, 402 ComDpl, 249

DIgSILENT PowerFactory 2018, Python Function Reference 449


Index

ComPython, 272 StaExtdatmea, 171


SetFileName StaExtfmea, 176
ComSvgexport, 288 StaExtfuelmea, 181
ComSvgimport, 289 StaExtimea, 186
SetFilt, 307 StaExtpfmea, 191
Get, 307 StaExtpmea, 196
SetFilter StaExtqmea, 201
SetColscheme, 303 StaExtsmea, 206
SetFinalEchoOnEnabled StaExttapmea, 211
Environment Functions, 32 StaExtv3mea, 216
SetGeoCoordinateSystem StaExtvmea, 221
IntPrj, 361 SetMinI
SetGraphicUpdate ElmRelay, 107
Environment Functions, 33 SetMinIearth
SetGridSelection ElmRelay, 107
ComUcteexp, 295 SetNumSlave
SetGridsToExport SetParalman, 310
ComGridtocim, 253 SetObj
SetGuiUpdateEnabled ElmRes, 120
Environment Functions, 33 SetObject
SetImpedance ComSvgexport, 288
ElmRelay, 106 ComSvgimport, 289
SetInputParameterDouble SetObjects
ComDpl, 250 ComSvgexport, 288
ComPython, 272 SetObjectsToCompare
SetInputParameterInt ComMerge, 264
ComDpl, 250 SetObjs
ComPython, 273 ComOutage, 269
SetInputParameterString SetOldDistributeLoadMode
ComDpl, 251 ComLdf, 257
ComPython, 273 SetOPCReceiveQuality
SetInterfaceVersion ComLink, 259
Application Methods, 25 SetOperationValue
SetLayerVisibility IntScenario, 369
IntGrfnet, 345 SetOutOfService
SetLevelvis, 308 ElmRelay, 107
AdaptWidth, 308 SetOutputWindowState
Align, 308 Output Window Functions, 41
ChangeFont, 308 SetParalman, 310
ChangeFrameAndWidth, 308 GetNumSlave, 310
ChangeLayer, 309 SetNumSlave, 310
ChangeRefPoints, 309 SetTransfType, 311
ChangeWidthVisibilityAndColour, 309 SetPassword
Mark, 310 IntUser, 379
Reset, 310 SetPrimaryTap
SetLimits StaCt, 155
ComSimoutage, 287 SetRA
SetLoadScaleAbsolute ElmSubstat, 126
ElmZone, 155 SetRandomSeed
SetMaxI Mathematical Functions, 39
ElmRelay, 107 SetRescheduleFlag
SetMaxIearth Environment Functions, 33
ElmRelay, 107 SetResults
SetMeaValue SetDesktop, 305
StaExtbrkmea, 161 SetVipage, 318
StaExtcmdmea, 166 SetResultsFolder

DIgSILENT PowerFactory 2018, Python Function Reference 450


Index

ComTasks, 290 StaExtpmea, 197


SetRowLabel StaExtqmea, 202
IntMat, 350 StaExtsmea, 207
SetScaleX StaExttapmea, 212
SetDesktop, 305 StaExtv3mea, 217
SetVipage, 319 StaExtvmea, 222
VisPath, 407 SetStatusBitTmp
VisPlot, 413 StaExtbrkmea, 162
VisPlot2, 419 StaExtcmdmea, 167
SetScaleY StaExtdatmea, 172
IntPlot, 356 StaExtfmea, 177
VisBdia, 399 StaExtfuelmea, 182
VisPath, 408 StaExtimea, 187
VisPlot, 414 StaExtpfmea, 192
VisPlot2, 420 StaExtpmea, 197
SetSelect, 311 StaExtqmea, 202
AddRef, 311 StaExtsmea, 207
All, 312 StaExttapmea, 212
AllAsm, 312 StaExtv3mea, 217
AllBars, 312 StaExtvmea, 222
AllBreakers, 312 SetStatusTmp
AllClosedBreakers, 312 StaExtbrkmea, 163
AllElm, 312 StaExtcmdmea, 167
AllLines, 313 StaExtdatmea, 173
AllLoads, 313 StaExtfmea, 178
AllOpenBreakers, 313 StaExtfuelmea, 183
AllSym, 313 StaExtimea, 188
AllTypLne, 313 StaExtpfmea, 193
Clear, 314 StaExtpmea, 198
GetAll, 314 StaExtqmea, 203
SetShowAllUsers StaExtsmea, 207
Application Methods, 25 StaExttapmea, 212
SetState StaExtv3mea, 218
Output Window Methods, 43 StaExtvmea, 223
SetStatus SetStudyTime
StaExtbrkmea, 161 IntCase, 332
StaExtcmdmea, 166 SetStyle
StaExtdatmea, 171 SetVipage, 319
StaExtfmea, 176 SetSubElmResKey
StaExtfuelmea, 181 ElmRes, 120
StaExtimea, 186 SetSwitchShcEventMode
StaExtpfmea, 191 ComLink, 259
StaExtpmea, 196 SetTboxconfig, 314
StaExtqmea, 201 Check, 314
StaExtsmea, 206 GetAvailableButtons, 314
StaExttapmea, 211 GetDisplayedButtons, 314
StaExtv3mea, 216 Purge, 315
StaExtvmea, 221 SetDisplayedButtons, 315
SetStatusBit SetTile
StaExtbrkmea, 162 SetVipage, 319
StaExtcmdmea, 167 SetTime, 315
StaExtdatmea, 172 Date, 315
StaExtfmea, 177 ElmRelay, 108
StaExtfuelmea, 182 SetTime, 316
StaExtimea, 187 SetTimeUTC, 316
StaExtpfmea, 192 Time, 316

DIgSILENT PowerFactory 2018, Python Function Reference 451


Index

SetTimeUTC IntMat, 347


SetTime, 316 SizeY
Settings Methods, 296 ElmRes, 116
SetTransfType IntComtrade, 335
SetParalman, 311 IntComtradeset, 338
SetUserBreakEnabled IntMat, 347
Environment Functions, 34 slotupd
SetVipage, 317 ElmComp, 82
CreateVI, 318 ElmRelay, 108
DoAutoScaleX, 317 SlotUpdate
DoAutoScaleY, 317 ElmComp, 82
GetOrInsertPlot, 317 ElmRelay, 108
GetVI, 317 Sort
InsertPlot, 318 IntVec, 383
SetAdaptX, 318 SortAccordingToColumn
SetAutoScaleX, 318 ElmRes, 120
SetResults, 318 IntComtrade, 336
SetScaleX, 319 IntComtradeset, 340
SetStyle, 319 SortToColum
SetTile, 319 IntMat, 351
SetXVar, 320 SortToColumn
SetWriteCacheEnabled IntMat, 351
Application Methods, 26 SplitLine
SetXVar Application Methods, 26
SetDesktop, 306 StaCt, 155
SetVipage, 320 SetPrimaryTap, 155
VisPlot, 414 StaCubic, 155
VisPlot2, 420 GetAll, 156
SetXVariable GetBranch, 156
VisBdia, 399 GetConnectedMajorNodes, 156
SetYVariable GetConnections, 157
VisBdia, 399 GetNearestBusbars, 157
Show GetPathToNearestBusbar, 157
Application Methods, 26 IsClosed, 158
IntGrfnet, 345 IsConnected, 158
SetDesktop, 306 StaExtbrkmea, 158
ShowBrowser CopyExtMeaStatusToStatusTmp, 159
ComMerge, 264 GetMeaValue, 159
ShowEditDialog GetStatus, 159
General Object Methods, 67 GetStatusTmp, 159
ShowModalBrowser InitTmp, 160
Dialogue Boxes Functions, 29 IsStatusBitSet, 160
ShowModalSelectBrowser IsStatusBitSetTmp, 160
Dialogue Boxes Functions, 30 ResetStatusBit, 160
ShowModalSelectTree ResetStatusBitTmp, 161
General Object Methods, 67 SetMeaValue, 161
ShowModelessBrowser SetStatus, 161
Dialogue Boxes Functions, 30 SetStatusBit, 162
ShowY2 SetStatusBitTmp, 162
VisPlot2, 420 SetStatusTmp, 163
Size UpdateControl, 163
IntVec, 383 UpdateCtrl, 163
SizeX StaExtcmdmea, 164
ElmRes, 116 CopyExtMeaStatusToStatusTmp, 164
IntComtrade, 335 GetMeaValue, 164
IntComtradeset, 339 GetStatus, 164

DIgSILENT PowerFactory 2018, Python Function Reference 452


Index

GetStatusTmp, 165 ResetStatusBit, 181


InitTmp, 165 ResetStatusBitTmp, 181
IsStatusBitSet, 165 SetMeaValue, 181
IsStatusBitSetTmp, 165 SetStatus, 181
ResetStatusBit, 165 SetStatusBit, 182
ResetStatusBitTmp, 166 SetStatusBitTmp, 182
SetMeaValue, 166 SetStatusTmp, 183
SetStatus, 166 UpdateControl, 183
SetStatusBit, 167 UpdateCtrl, 183
SetStatusBitTmp, 167 StaExtimea, 184
SetStatusTmp, 167 CopyExtMeaStatusToStatusTmp, 184
UpdateControl, 168 GetMeaValue, 184
UpdateCtrl, 168 GetStatus, 184
StaExtdatmea, 169 GetStatusTmp, 185
CopyExtMeaStatusToStatusTmp, 169 InitTmp, 185
CreateEvent, 169 IsStatusBitSet, 185
GetMeaValue, 169 IsStatusBitSetTmp, 185
GetStatus, 170 ResetStatusBit, 186
GetStatusTmp, 170 ResetStatusBitTmp, 186
InitTmp, 170 SetMeaValue, 186
IsStatusBitSet, 170 SetStatus, 186
IsStatusBitSetTmp, 170 SetStatusBit, 187
ResetStatusBit, 171 SetStatusBitTmp, 187
ResetStatusBitTmp, 171 SetStatusTmp, 188
SetMeaValue, 171 UpdateControl, 188
SetStatus, 171 UpdateCtrl, 188
SetStatusBit, 172 StaExtpfmea, 189
SetStatusBitTmp, 172 CopyExtMeaStatusToStatusTmp, 189
SetStatusTmp, 173 GetMeaValue, 189
UpdateControl, 173 GetStatus, 189
UpdateCtrl, 173 GetStatusTmp, 190
StaExtfmea, 174 InitTmp, 190
CopyExtMeaStatusToStatusTmp, 174 IsStatusBitSet, 190
GetMeaValue, 174 IsStatusBitSetTmp, 190
GetStatus, 174 ResetStatusBit, 191
GetStatusTmp, 175 ResetStatusBitTmp, 191
InitTmp, 175 SetMeaValue, 191
IsStatusBitSet, 175 SetStatus, 191
IsStatusBitSetTmp, 175 SetStatusBit, 192
ResetStatusBit, 176 SetStatusBitTmp, 192
ResetStatusBitTmp, 176 SetStatusTmp, 193
SetMeaValue, 176 UpdateControl, 193
SetStatus, 176 UpdateCtrl, 193
SetStatusBit, 177 StaExtpmea, 194
SetStatusBitTmp, 177 CopyExtMeaStatusToStatusTmp, 194
SetStatusTmp, 178 GetMeaValue, 194
UpdateControl, 178 GetStatus, 194
UpdateCtrl, 178 GetStatusTmp, 195
StaExtfuelmea, 179 InitTmp, 195
CopyExtMeaStatusToStatusTmp, 179 IsStatusBitSet, 195
GetMeaValue, 179 IsStatusBitSetTmp, 195
GetStatus, 179 ResetStatusBit, 196
GetStatusTmp, 180 ResetStatusBitTmp, 196
InitTmp, 180 SetMeaValue, 196
IsStatusBitSet, 180 SetStatus, 196
IsStatusBitSetTmp, 180 SetStatusBit, 197

DIgSILENT PowerFactory 2018, Python Function Reference 453


Index

SetStatusBitTmp, 197 GetMeaValue, 214


SetStatusTmp, 198 GetStatus, 214
UpdateControl, 198 GetStatusTmp, 215
UpdateCtrl, 198 InitTmp, 215
StaExtqmea, 199 IsStatusBitSet, 215
CopyExtMeaStatusToStatusTmp, 199 IsStatusBitSetTmp, 215
GetMeaValue, 199 ResetStatusBit, 216
GetStatus, 199 ResetStatusBitTmp, 216
GetStatusTmp, 200 SetMeaValue, 216
InitTmp, 200 SetStatus, 216
IsStatusBitSet, 200 SetStatusBit, 217
IsStatusBitSetTmp, 200 SetStatusBitTmp, 217
ResetStatusBit, 201 SetStatusTmp, 218
ResetStatusBitTmp, 201 UpdateControl, 218
SetMeaValue, 201 UpdateCtrl, 218
SetStatus, 201 StaExtvmea, 219
SetStatusBit, 202 CopyExtMeaStatusToStatusTmp, 219
SetStatusBitTmp, 202 GetMeaValue, 219
SetStatusTmp, 203 GetStatus, 219
UpdateControl, 203 GetStatusTmp, 220
UpdateCtrl, 203 InitTmp, 220
StaExtsmea, 204 IsStatusBitSet, 220
CopyExtMeaStatusToStatusTmp, 204 IsStatusBitSetTmp, 220
GetStatus, 204 ResetStatusBit, 221
GetStatusTmp, 204 ResetStatusBitTmp, 221
InitTmp, 204 SetMeaValue, 221
IsStatusBitSet, 205 SetStatus, 221
IsStatusBitSetTmp, 205 SetStatusBit, 222
ResetStatusBit, 205 SetStatusBitTmp, 222
ResetStatusBitTmp, 205 SetStatusTmp, 223
SetMeaValue, 206 UpdateControl, 223
SetStatus, 206 UpdateCtrl, 223
SetStatusBit, 207 Start
SetStatusBitTmp, 207 ComDiff, 245
SetStatusTmp, 207 StartTrace
UpdateControl, 208 ComContingency, 245
UpdateCtrl, 208 ComOutage, 270
StaExttapmea, 208 StaSwitch, 224
CopyExtMeaStatusToStatusTmp, 209 Close, 224
GetMeaValue, 209 IsClosed, 224
GetStatus, 209 IsOpen, 224
GetStatusTmp, 210 Open, 225
InitTmp, 210 StatFileGetXrange
IsStatusBitSet, 210 Application Methods, 27
IsStatusBitSetTmp, 210 StatFileResetXrange
ResetStatusBit, 210 Application Methods, 27
ResetStatusBitTmp, 211 StatFileSetXrange
SetMeaValue, 211 Application Methods, 27
SetStatus, 211 Station Elements Methods, 155
SetStatusBit, 212 StoMaint, 396
SetStatusBitTmp, 212 SetElms, 396
SetStatusTmp, 212 Stop
UpdateControl, 213 ComDiff, 246
UpdateCtrl, 213 StopTrace
StaExtv3mea, 214 ComContingency, 245
CopyExtMeaStatusToStatusTmp, 214 ComOutage, 270

DIgSILENT PowerFactory 2018, Python Function Reference 454


Index

SubscribeProjectReadOnly StaExtpmea, 198


IntPrj, 362 StaExtqmea, 203
SubscribeProjectReadWrite StaExtsmea, 208
IntPrj, 362 StaExttapmea, 213
SwitchOff StaExtv3mea, 218
General Object Methods, 68 StaExtvmea, 223
SwitchOn UpdateFromCurrentView
General Object Methods, 68 IntViewbookmark, 385
UpdateGroups
TerminateSession IntUserman, 381
IntUser, 380 UpdateStatistics
Time IntPrj, 363
SetTime, 316 UpdateSubstationTerminals
TotalLossCost ElmTerm, 136
ComCapo, 238 UpdateTableReports
TransformGeoCoordinates Dialogue Boxes Functions, 31
IntPrj, 362 UpdateTablesByCalcPeriod
TypAsmo, 396 ComTececo, 291
CalcElParams, 396
TypLne, 397 ValidateConstraints
IsCable, 397 ComRel3, 275
TypTr2, 397 View
GetZeroSequenceHVLVT, 397 IntUrl, 379
VisBdia, 398
UnsubscribeProject AddObjs, 398
IntPrj, 362 AddResObjs, 398
Update Clear, 398
ChaVecfile, 322 SetScaleY, 399
ComSimoutage, 288 SetXVariable, 399
ElmBmu, 78 SetYVariable, 399
ElmBoundary, 80 VisDraw, 400
ElmBranch, 81 AddRelay, 400
ElmCabsys, 81 AddRelays, 400
IntSscheduler, 374 CentreOrigin, 400
UpdateControl Clear, 400
StaExtbrkmea, 163 DoAutoScaleX, 401
StaExtcmdmea, 168 DoAutoScaleY, 401
StaExtdatmea, 173 VisHrm, 401
StaExtfmea, 178 Clear, 401
StaExtfuelmea, 183 DoAutoScaleX, 401
StaExtimea, 188 DoAutoScaleY, 402
StaExtpfmea, 193 GetScaleObjX, 402
StaExtpmea, 198 GetScaleObjY, 402
StaExtqmea, 203 SetAutoScaleX, 402
StaExtsmea, 208 SetAutoScaleY, 402
StaExttapmea, 213 SetCrvDesc, 403
StaExtv3mea, 218 SetDefScaleX, 403
StaExtvmea, 223 SetDefScaleY, 403
UpdateCtrl VisMagndiffplt, 403
StaExtbrkmea, 163 AddRelay, 403
StaExtcmdmea, 168 AddRelays, 404
StaExtdatmea, 173 Clear, 404
StaExtfmea, 178 DoAutoScaleX, 404
StaExtfuelmea, 183 DoAutoScaleY, 404
StaExtimea, 188 Refresh, 405
StaExtpfmea, 193 VisOcplot, 405

DIgSILENT PowerFactory 2018, Python Function Reference 455


Index

AddRelay, 405 SetScaleX, 413


AddRelays, 405 SetScaleY, 414
Clear, 405 SetXVar, 414
DoAutoScaleX, 406 VisPlottz, 421
DoAutoScaleY, 406 AddRelay, 421
Refresh, 406 AddRelays, 421
VisPath, 406 Clear, 421
Clear, 406 DoAutoScaleX, 422
DoAutoScaleX, 406 DoAutoScaleY, 422
DoAutoScaleY, 407 VisVec, 422
SetAdaptX, 407 CentreOrigin, 422
SetAdaptY, 407 VisVecres, 422
SetScaleX, 407 CentreOrigin, 422
SetScaleY, 408 VisXyplot, 423
VisPcompdiffplt, 408 Clear, 423
AddRelay, 408 DoAutoScaleX, 423
AddRelays, 408 DoAutoScaleY, 423
CentreOrigin, 409 SetCrvDescX, 423
Clear, 409 SetCrvDescY, 424
DoAutoScaleX, 409
DoAutoScaleY, 409 WereModificationsFound
VisPlot2, 415 ComMerge, 264
AddResVars, 415 Write
AddVars, 415 ElmRes, 121
Clear, 416 WriteChangesToDb
DoAutoScaleX, 416 Application Methods, 27
DoAutoScaleY, 416 General Object Methods, 69
DoAutoScaleY2, 416 WriteDraw
GetScaleObjX, 417 ElmRes, 121
GetScaleObjY, 417 WriteValue
SetAdaptX, 417 IntSstage, 377
SetAdaptY, 417 WriteWMF
SetAutoScaleX, 418 SetDesktop, 307
SetAutoScaleY, 418
SetCrvDesc, 419 ZeroDerivative
SetDefScaleX, 419 ComInc, 254
SetDefScaleY, 419
SetScaleX, 419
SetScaleY, 420
SetXVar, 420
ShowY2, 420
VisPlot, 410
AddResVars, 410
AddVars, 410
Clear, 411
DoAutoScaleX, 411
DoAutoScaleY, 411
GetScaleObjX, 411
GetScaleObjY, 411
SetAdaptX, 412
SetAdaptY, 412
SetAutoScaleX, 412
SetAutoScaleY, 412
SetCrvDesc, 413
SetDefScaleX, 413
SetDefScaleY, 413

DIgSILENT PowerFactory 2018, Python Function Reference 456

You might also like