MASTER-JHK_LINE-INFO_V3.0.dyn (47.4 KB)
Attached is a Script I’ve built that writes a number (JHK_Line Number) to EXCEL, that performs a VLOOKUP off a table on a second page to populate fabrication info back to the parts in Revit.
Currently, the script needs to be run twice consecutively to work. What’s happening when Dynamo is “Processing” it doesn’t write the data to EXCEL until the script has finished, so the VLOOKUP data isn’t populated on the first execution. This method has a Thread.Pause before reading from EXCEL, but it doesn’t matter as Dynamo hasn’t finished, EXCEL isn’t populated.
Is there a way to control the read/write separately on the same script? I don’t want it to be a two part interaction. It seems I need to tell Dynamo to finish Excel.WriteToFile before attempting to read it, but I don’t have control of that.
Moving the pause to AFTER Excel.ReadfromFile you can literally see the lists are blank until Dynamo has fully completed once.
(The .DYN file will be useless for most as it relies on numerous parameters in place in Revit, and a custom .XLSX file with filled out Line data/NDE requirements. (Part of our fab process working strictly on piping systems.) but at least it’ll give visual reference to what’s going on, and the time of execution for the 2 processes. It also requires selected parts prompted from Dynamo and selected out of Revit.