Jump to content
Developer Wiki and Function Reference Links Read more... ×

Selected by String criteria

Recommended Posts



I just built this node to be able to "marionette" the "Crit" of Obj by Crit


You have to put the "criteria" text in the String Node. It will be passed to the new node and command his action.

By so you could act on the "criteria" string using marionette text and string nodes.


It seems to work.


Hope it will be useful.


I am pretty sure DomC has published something like that but cannot get my hand on it. Hi DomC. I am a fan of your work.






#COMMAND;REFFILE;[VWLibDef]/Input\Objs by Crit Mat.py;
#Modified August 2018
class Params(metaclass = Marionette.OrderedClass):
    this = Marionette.Node( 'Objs by Crit Mat' )
    this.SetDescription( 'Returns a list of objects meeting the input criteria' )
    #Input Ports
    stringIn = Marionette.PortIn('', 's')
    stringIn.SetDescription( "The input string" )
    #Output Ports
    obj = Marionette.PortOut('h')
    obj.SetDescription('The list of objects in the document that match the criteria')

def RunNode(self):
    stringIn = self.Params.stringIn.value
    out_list = []
    def Add_Handle(obj):
    wordTofind = "SEL=TRUE"
    searchInlist = stringIn
    searchInlist = searchInlist.replace(" ", "")
    if  wordTofind.lower() in searchInlist.lower():
        new_list = []
        parents_list = []
        for e in out_list:
            p = vs.GetParent(e)
            if  vs.GetType(p) == 11 and p in out_list:
        for g in parents_list:
            if g in new_list:
        self.Params.obj.value = new_list
        self.Params.obj.value = out_list

Edited by mattao

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.