Issue with UI in wpf and custom toolbar

Hi to everybody!
I’m trying to create a GUI for my pyrevit tool. I ve no problem to do that through data-shape dynamo node, but I need to do something of more customizable. I create my custom GUI in xaml with Visual Studio, thanks to the video in pyRevit youtube channel.
The problem is to made work it once it is lunched in revit, the GUI appears but I’m stil not able to connect it with the actions that I desire.

basically, from what I found googling, is that the .xaml file is related to the .cs file and you can manage them in Visual Studio, but then need I to create a .py to run it in revit?

Basically I wanted the folder list family (named by categories) in the first listbox, and the families in the second listbox, select the families that I want in the project and import them through the last button

Hope to be clear, any suggestion and advice are welcome

Have a look at this example from @ErikFrits

1 Like

Hi @Jean-Marc , thanks to shared the great work of @ErikFrits. It was usefull, but i retrieve more effort from this other one settings,because I did not figure out hot to work togheter .xaml e .py file

things are happening here

To make it simpler, maybe try to do it in a 2 steps process with the pyrevit.forms module:

first to pick your folder:

https://ein.sh/pyRevit/reference/pyrevit/forms/#pyrevit.forms.pick_folder

then to pick the families retrieved from that selected folder

https://ein.sh/pyRevit/reference/pyrevit/forms/#pyrevit.forms.SelectFromList

from pyrevit import forms

selected_folder = pick_folder(title="pick me")
# list the rfa files
selected_families = forms.SelectFromList.show(families, multiselect=True, name_attr='Name', button_name='Select families')
# load the families in Revit


thank you for the suggestions. I’ ll let you know here