The use case here is in a doc-opened hook to call a loaded model audit script every time a model is opened. I didn’t want to copy / paste the code just because I couldn’t reference it!
@eirannejad thanks for the solution! @eprunty can you please share how you used sessionmgr.execute_command with the doc-opened hook? I copied the code to the hooks/doc-opened.py file but an error occurred:
Unfortunately I also ran into issues with this. It worked in the session I had open but then when I closed and opened a new Revit session it stopped working in doc-opened and I’ve had to remove the hook until such a time that I can look into it again. Perhaps @eirannejad can shed some light on sessionmgr’s availability in the doc-opened context?
@GertjanVDB it checks for elements of our office standard on model startup between elements and parameters applied