Ask Your Question
0

get id from selected branch

asked 2016-12-07 10:40:20 -0500

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.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2016-12-08 16:35:33 -0500

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.

edit flag offensive delete link more

Comments

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

nwilson gravatar imagenwilson ( 2016-12-09 14:10:38 -0500 )edit

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 ( 2017-03-17 14:02:31 -0500 )edit

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

nwilson gravatar imagenwilson ( 2017-04-28 17:09:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

2 followers

Stats

Asked: 2016-12-07 10:40:20 -0500

Seen: 1,351 times

Last updated: Dec 08 '16