When I test the tool in pyRevit, for example, Sheets ā Select Sheets. Running in the pyRevit tab takes <1 second.
But if I create a custom extension, and copy the button Select Sheets, it takes 3-4 seconds to run.
More detail: Select sheets source code is using the pyrevit lib.
"""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)
Could you please explain why pyrevit lib works so fast in pyRevit tab but the others tab is slow?
Iām watching the Task Manager while running the pyRevit tool and the tool in the custom extension.
pyRevit tool only costs about 3 MB to run, but the tool in the custom extension costs about 30 MB.
And the memory is never released after finishing the tool.
As you can see I opened the same project, and the memory is bigger after running time (just click on the tool and hit Esc). the more click on the tools, the more memory cost.