andydandy74 / DynamoAutomation

Batch-processing of Revit models using the Dynamo visual programming environment
MIT License
62 stars 23 forks source link

Run multiple scripts per Revit session #53

Closed andydandy74 closed 6 years ago

andydandy74 commented 6 years ago

Since DynamoRevit records all necessary actions in the journal, it might be worth a shot to not let it run headless and just automate the UI commands. By looping the first two lines below we might be able to run multiple scripts per Revit session.

Jrn.AddInEvent "AddInJournaling" , "FileDialog(Win7Open,Open Dynamo Definition\.\.\.).SelectFile({FILENAME}\.dyn,Dynamo Definitions \(*\.dyn;*\.dyf\))"
Jrn.AddInEvent "AddInJournaling" , "WpfWindow(_this,Dynamo).WpfButton(0,RunButton).Click()"
Jrn.AddInEvent "AddInJournaling" , "WpfWindow(_this,Dynamo).Close()"

The file open line is obviously OS specific, but we could just check the Windows version and change the jounral line accordingly to remedy that.

andydandy74 commented 6 years ago

This may actually be much easier to do with a view extension, although that may only work on one model...

andydandy74 commented 6 years ago

definitely not possible with the current way that Dynamo does addin journaling