sstanelle Posted December 4, 2020 Share Posted December 4, 2020 I would like to utilize the CreatePullDownSearch function in VW 2021. 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? Much appreciated. Thanks, Scott Quote Link to comment
JBenghiat Posted December 4, 2020 Share Posted December 4, 2020 Are you looking for python or SDK? In the SDK, it functions much like a regular pull-down and handles the search events automatically and has DDX for data access. Quote Link to comment
sstanelle Posted December 4, 2020 Author Share Posted December 4, 2020 JBenghiat, Thanks for your reply! I was looking for some Python code that I could include in a script. I initially tried the following but I think I somehow need to associate the item with a drop down list. I'm not sure how to do this. Hence, I was hoping someone could provide an example. 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 A related question is whether there is a way to bypass CreatePullDownSearch and to have a text box and a list box where as the user types in the text box, the list is filtered with each key stroke. Thanks for any help! Scott Quote Link to comment
JBenghiat Posted December 5, 2020 Share Posted December 5, 2020 Take a look at Dialog Builder: https://developer.vectorworks.net/index.php/SDK:Dialog_Builder The interface is a little rough (it's a pre-cursor to Marionette), but you can easily build and test dialog layouts without writing code. VW will then export the code file for you. Go to the python forum if you need help with the dialog event handler. The process is fairly different with the SDK. 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.