Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Removing them all is actually a bit more complicated than you thought. I have done it before based on map strings, which since then Siemens has changed the API (the old method getting map string is now returning a byte encoded sequence that needs to be decoded, and Siemens has not told us how to do it), so my method only works in v33.4 (or lower).

The module you need is the 'sliderPy', and you must run the script in the PSSE GUI.

The idea is to firstly get all the map strings of the pink elements. Note that they must be in the SAV previously, newly added pink elements do not have map strings.

After getting all the wanted map strings, which you need use the 'checkdiafile' from 'psspy' with the output directed to a file and do some search and replace, use the 'sliderPy.GetActiveDocument()' to get the SLD file, then use the 'GetDiagram()' method of the file object to get the actual SLD.

Then, find the diagram objects using the map strings.

After that, use the 'DeleteComponent(obj.GetID())' in a loop to remove the pink elements.

I remember that the 'sliderPy' has no official documentation. You will need to get the docstring out of this module and read it very carefully. I believe this module is actually a C++ ported to Python, so it is very unfriendly to read.

I am not gonna post any code for this since it is a lot of work and actually not that interesting and it is hugely version dependent. Siemens surely can include this feature or just make PSSE proper and decent.