andydandy74 / DynamoAutomation

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

Basic functionality test fails #5

Closed andydandy74 closed 8 years ago

andydandy74 commented 8 years ago

I am sad to report that a basic functionality test of the automation functionality that I created and ran today did not succeed. The graph that was to be run by the Dynamo Revit addin is supposed to add a line of text to a CSV file which, unfortunately, it doesn't.

The test I created is based on scenario A1 ("process all models within a given folder"). The graph that is supposed to be run on top of Revit counts all walls in the models and adds a new line with the file path and the wall count to an existing CSV file. Here's what happened:

Tests run in German Revit There definitely seems to be some culture-specific problem involved, since my first two tests were run in German Revit (2015 & 2016, respectively) and did not succeed in executing the Dynamo addin:

' 0:< Skipped data from file follows 
'  0.772626  0:<<Event timer 
'H 10-Sep-2015 12:21:37.760;   0:< 
Jrn.Data "APIStringStringMapJournalData"  _
        , 3, "dynAutomation", "true" _
        , "dynPath", "C:\Users\adieckmann\Documents\GitHub\DynamoAutomation\scenarios\Revit\2016\CountWalls.dyn", "dynShowUI" _
        , "false"
' 0:< Die Ausführung stimmt nicht mit der aufgezeichneten Protokollsequenz überein.
'
'At line number 6 of source journal
'JournalData "APIStringStringMapJournalData" from file was skipped 
'C 10-Sep-2015 12:21:37.762;   0:< stopped at line 6 journal file playback 

Die Ausführung stimmt nicht mit der aufgezeichneten Protokollsequenz überein means more or less "The execution did not match the recorded protocol sequence". After each launch of Revit, a dialogue with a button was displayed that would take me to "Interactive mode". After closing Revit manually, the sandbox script would launch Revit again for the next model in the list.

Tests run in English Revit On a hunch, I ran two more test in Revit 2016, this time set to English language. The first test was performed on my usual setup, for the second test I switched my OS culture to English (USA). In both cases the journal shows that the Dynamo addin was launched:

 '  0.761704  0:<<Event timer 
 'E 10-Sep-2015 14:25:03.278;   0:< 

 Jrn.RibbonEvent "Execute external command:CustomCtrl_%CustomCtrl_%Add-Ins%Visual Programming%Dynamo 0.8:Dynamo.Applications.DynamoRevit"
' 1:< ::8:: Delta VM: Avail -13 -> 8386680 MB, Used +2 -> 473 MB, Peak +3 -> 474 MB; RAM: Avail 3708 MB, Used +6 -> 585 MB, Peak +7 -> 587 MB 
' 1:< API_SUCCESS { Registering Idling event by application Dynamo For Revit (8d83c886-b739-4acd-a9db-1bc78f315b2b). } 
' 2:< ::8:: Delta VM: Avail -314 -> 8386367 MB, Used +295 -> 769 MB, Peak +296 -> 771 MB; RAM: Avail -287 -> 3422 MB, Used +308 -> 894 MB, Peak +308 -> 895 MB 
'  8.564821!!! 2:!!!BIG_GAP API External Command Time 
' 0:< ::8:: Delta VM: Avail 8386367 MB, Used -193 -> 576 MB, Peak +15 -> 787 MB; RAM: Avail +186 -> 3608 MB, Used -192 -> 702 MB, Peak +17 -> 913 MB 
' 10.021813   1:<<API External Command Time 
' 10.060222  0:<<Event timer 
'H 10-Sep-2015 14:25:13.338;   0:< 
Jrn.Data "APIStringStringMapJournalData"  _
        , 3, "dynAutomation", "true" _
        , "dynPath", "C:\Users\adieckmann\Documents\GitHub\DynamoAutomation\scenarios\Revit\2016\CountWalls.dyn", "dynShowUI" _
        , "false"
 'E 10-Sep-2015 14:25:13.408;   0:< 
 Jrn.Command "Internal" , "Flush undo and redo stacks , ID_FLUSH_UNDO"

However, the CSV file was not modified in either of the two test runs. Also, although it doesn't look like that in the journal files, Revit crashed after each run.

Relevant commits for this issue

Test setup

andydandy74 commented 8 years ago

Correction: I found some *.dmp files (which indicate a crash), but only in the Revit 2015 folder. So no crashes in Revit 2016. Must have misremembered that part...

andydandy74 commented 8 years ago

Update: Removing all other addins has proved to be complete irrelevant to this issue.

ikeough commented 8 years ago

@andydandy74 One thing which I forgot to mention. I believe your workflow needs to be set to "Automatic" mode. Otherwise, it will not evaluate. I'll try with your test files.

Also, you need to be using a daily build.

andydandy74 commented 8 years ago

Whatever you do - don't set that workflow to automatic. That will create an endless loop of reading and writing the CSV file. :-) I'll use a different method of aggregating the results tomorrow that will work with automatic mode and test again. And not to worry - I am on yesterday's second daily.

ikeough commented 8 years ago

Ha! I just came over to tell you that the endless loop was breaking your workflow. I've made a version of your scenario to test on my machine. It's working, less the missing custom nodes (part of Clockwork perhaps), and the endlessly looping workflow.

I'm not sure what the issue is with German Revit. There could be some dark magic inside reading journal files that doesn't work well with German Revit.

ikeough commented 8 years ago

The error that you are getting in German revit's journal file above is the same as in English Revit. It basically means that the journal file couldn't be played to completion. This could be because it can't start Dynamo.

If Dynamo works on German Revit, and the workflow runs in that Dynamo, then the problem is with trying to get the journal file to start Dynamo on Revit.

Remember that the Dynamo.addin file must be located in the same directory as your generated journal files. This way the journal process knows to register Dynamo.

ikeough commented 8 years ago

I got it working. I've submitted a PR, https://github.com/DynamoDS/DynamoRevit/pull/648

The PR allows your workflow to be in Manual mode, so we can avoid infinite loops. The workflow will still only run once though, so it has to do the right thing the first time :)

andydandy74 commented 8 years ago

Great! In that case I'll put my testing activities on hold until the PR has been reviewed and merged. I am very glad I don't have to code around Automatic mode now. Thanks a lot, Ian.

andydandy74 commented 8 years ago

Tried again with a fresh daily and an updated version of scenario A1 (6775d85bbf9eeb0ebfb2a824c89f27b7d5d0e474). Revit and the Dynamo addin are executed and the Dynamo graph is actually run and completes (i.e. it writes the computed information into the CSV file) - yay! However, Revit encounters an unhandled exception: unhandled exception Here's what I get in Visual Studio (unfortunately most of it is in German...) visualstudio visualstudio2 Anything I can do in Visual Studio that will help you understand what's happening here? New logs can be found here: 25733c1bdeda159b47d33c7f41f21687acb82c03

ikeough commented 8 years ago

@andydandy74 RevitAPIUI.dll<Unbekannte Function>. If my german serves me, this means "unknown function", which suggests that somehow Dynamo is trying to call a Revit API method that doesn't exist. This can happen, I believe, when there are two competing versions of the Revit API trying to load. Is there accidentally a copy of the Revit API in the Dynamo core directory (RevitAPIUI.dll)?

andydandy74 commented 8 years ago

@ikeough - no, the only Revit related DLL in C:\Program Files\Dynamo 0.8 is RevitAddinUtility.dll.

andydandy74 commented 8 years ago

Everything's running smoothly now with the latest daily build. Great stuff, @ikeough !