Visual Components' Community

New Thinking for Factory Simulation
Welcome to Visual Components' Community Sign in | Help
in Search

Connect and create components using Python

Last post pe, elo 15 2008 14:53 by RicardoVelez. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • pe, elo 15 2008 14:53

    Connect and create components using Python

    You need to have 2 component creators that are creating different components and a component container where to put these components. This container may also be a Path behaviour. Be sure that component creators don't create components automatically, so set creator's limit property to 0.

    To connect a Component Creator to a container and to create components using Python use the following code:

    comp= getComponent()
    Creator1= comp.findBehaviour("PartCreator1")
    Creator2= comp.findBehaviour("PartCreator2")
    Container= comp.findBehaviour("ComponentContainer")

    Container.Connectors[0].connect(Creator1.Connectors[0])
    Creator1.create()

    Container.Connectors[0].connect(Creator2.Connectors[0])
    Creator2.create()

    Ricardo Velez
    Research and Development Manager
Page 1 of 1 (1 items)