How to obtain all links under a component

How to obtain all links under a component

i once asked. :melting_face:

There are multiple links under the component, and each link has a signal below it. How to obtain the signal for each link level

The quickest way would be to use the Selection helper.

from vcScript import *
from vcHelpers.Selection import *


comp = getComponent()
all_links = getGivenComponentsNodes(comp)
print(all_links)
1 Like

1703769577239
How should I determine the type of behavior?

If you want to find behaviors from a component, you can do one of the following:

  • my_behavior = comp.findBehaviour(“behaviour_name”)
  • all_boolean_signals = comp.findBehavioursByType(VC_BOOLEANSIGNAL)

Thank you very much. Maybe I didn’t express my needs clearly
I want to search for specific types of behaviors in a list of behaviors

I should have found a way to implement it now
“FilterBehaviors”

I think it would be easier to just find all behaviors of certain type, as shown in my second example.

If you want to do it the hard way then you can check the behaviour.Type property like this

for b in Behaviours:
  if b.Type == VC_BOOLEANSIGNAL:
     print "Found boolean signal", b.Name

See the Python documentation for more details:
https://help.visualcomponents.com/4.8/Premium/en/Python_API/vcBehaviour.htm

1 Like