This was asked before by the way. Here's alternate code from an old thread:
https://groups.google.com/forum/?fromgroups=#!search/get$20all$20the$20expressions$20driven$20by$20a$20parameter/xsi_list/O2-MFKolqqw/UYg9uj1VkisJ


On Mon, Sep 24, 2012 at 5:21 PM, Nicolas Burtnyk <[email protected]>wrote:

> @Steve: GetSource works the other way - that is if I have the target
> of the expression I can easily find the source, but what I need is to
> find the target given the source.
>
> @César: That does indeed give me (among other things) the name of the
> expression object from which I can determine the target of the
> expression.
>
> Thanks guys!
>
>
> On Mon, Sep 24, 2012 at 1:41 PM, César Sáez <[email protected]> wrote:
> > Oops, I've a typo... should be
> >
> > from sipyutils import si, siut
> > from xml.dom.minidom import parseString
> > oParam =
> >
> si().Dictionary.GetObject("Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse.red")
> > sData = siut().DataRepository.GetConnectionStackInfo(oParam)
> > for sObj in parseString(sData).getElementsByTagName("object"):
> > print sObj.toxml()
> >
> >
> > On Mon, Sep 24, 2012 at 10:38 PM, César Sáez <[email protected]> wrote:
> >>
> >> Hi,
> >> I think you can get it using ConnectionStackInfo() and parsing the xml,
> >> something like this...
> >>
> >> from sipyutils import si, siut
> >> from xml.dom.minidom import parseString
> >> oParam =
> >>
> si().Dictionary.GetObject("Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse.red")
> >> sData = siut().DataRepository.GetConnectionStackInfo(oParam)
> >> for sObj in parseString(sData).getElementsByTagName("object"):
> >> print sData.toxml()
> >>
> >> Cheers!
> >>
> >
>
>

Reply via email to