First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

get id from selected branch

asked Dec 7 '16

nwilson gravatar image

Using slider.py, I've been reading the labels to identify selected bus numbers and branches. How do I get the branch id of a selected branch? This is especially pertinent when I have parallel branches.

1 answer

Sort by » oldest newest most voted
1

answered Dec 8 '16

mjinli gravatar image

Once you've identified the component from your SLD, you can use GetMapString(), which contains the from bus, to bus, and circuit ID.

string = comp.GetMapString()

which gives you an output like

LI      1    7 99

which indicates from bus 1, to bus 7, and circuit ID 99.

link

Comments

Thanks, works perfect. I added .split() to be able to cleanly reference each returned item.

nwilson gravatar imagenwilson (Dec 9 '16)

Folks, I'm trying just this and haven't been able to get it to work. My procedure: I import sliderPy I select a branch from the GUI I try both running the script [string = comp.GetMapString()] or typing in the command line. No luck. Get an exception. What am I missing? Thanks.

urbancat gravatar imageurbancat (Mar 17 '17)

mydoc = sliderPy.GetActiveDocument()
mydiagram = mydoc.GetDiagram()
mycomponents = mydiagram.GetComponents()
for comp in mycomponents:
  string = comp.GetMapString()

nwilson gravatar imagenwilson (Apr 28 '17)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

2 followers

Stats

Asked: Dec 7 '16

Seen: 1,384 times

Last updated: Dec 08 '16