sstanelle Posted December 7, 2020 Share Posted December 7, 2020 Hi, 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): pass Thanks, Scott Quote Link to comment
Antonio Landsberger Posted January 11, 2021 Share Posted January 11, 2021 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. Regards, Antonio 3 Quote Link to comment
Recommended Posts
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.