Jump to content

Search a list of items

Recommended Posts



I would like to utilize the CreatePullDownSearch function in VW 2021 in my Python script. The API documentation is currently very limited, and it is unclear to me how to use this function in a dialog layout. Could anyone out there provide me with a simple Python script example regarding how to use this function? I don't understand how to set up the data model for the pull down list. The following code only displays a text box, which I'm assuming is the search field, but I don't see how to define the list of items for the pull down. Essentially I am trying to achieve a search capability over a list of items such that the list is filtered as I type text in the search field. So if there is another way to achieve this, that would be fine too. Ideally I would rather use a list box rather than a pull down. By its name, it would seem that CreatePullDownSearch would only work with a pull down rather than a list of items.


def DialogHandler(item, data):
    return None
dialog = vs.CreateLayout("Search", False, "Ok", "Cancel")

vs.CreatePullDownSearch(dialog, 1, 50)



vs.SetFirstLayoutItem(dialog, 1)


if (vs.RunLayoutDialog(dialog, DialogHandler) == 1):




Share this post

Link to post

Hello @sstanelle,

welcome to the Vectorworks forum.


Right now, it's not possible to create a functioning searchable pulldown in VectorScript or Python, because the necessary function to add items to the list is currently not available as a VectorScript command: InsertItemInSearchablePulldown()

It's different to AddChoice() which is used for CreatePullDownMenu().


I just sent VW Inc a wish to implement it, so users that don't work with SDK can also create these searchable pulldowns.



  • Like 1

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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.

  • Create New...