I’d like to have the Select Sheets tool has a starting point from another tool.
I need to add few buttons and make some modifications.
What is the best way ? Do we have access to the code?
"""Select multiple sheets from a list"""
#pylint: disable=import-error,invalid-name
from pyrevit import revit
from pyrevit import forms
selection = revit.get_selection()
sel_sheets = forms.select_sheets(title='Select Sheets')
if sel_sheets:
selection.set_to(sel_sheets)
You can reuse the code, and run it after your code.
Hold the ALT key and LEFT CLICK the tool you want to see the code.
Warning: Editing that code will result in the editing of the tool.
Regarding my second question, I want to change the xaml file and add additional functionalities. The class SelectFromList is using the SelectFromList.xaml. is there a way to make it point to at a different file ?
The select_sheets function is calling SelectFromList.show and returning selected_sheets. I’m trying making it return a folder path selected by the user. I have added a method browse_click to the class SelectFromList but I’m not sure how I can get the selected folder.