Empty Container via Script

Forum Forums Visual Components 4.0 Python Programming in VC Empty Container via Script

This topic contains 2 replies, has 2 voices, and was last updated by Avatar Dubs3pp 1 year ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5667
    Avatar
    Dubs3pp
    Participant

    Hey everyone!

    Is there a possibility to empty a container? I have some sort of index table that rotates and I want the objects to be deleted at a certain point. Just like they disappear after a conveyor.

    I can’t find anything regarding this in the F1-Help.

    Best regards
    Dubsepp

    #5684
    Avatar
    Ralle
    Participant

    Hi,

    a container behaviour has a proptery Components that is a list of all components stored in the container. You can run a loop overall components in the container and remove them with the deleteComponent() method of the vcApplication instance.

    app = getApplication()

    for component in conatiner.Components:
    app.deleteComponent( component )

    #5705
    Avatar
    Dubs3pp
    Participant

    Hi Ralle!

    Thanks for your answer, that solved it!

    BR
    Dubsepp

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.