Excel: Export (Parameters from Excel List); Import (Drop Headers)


#1

On the Script I’m working on it has 3 options for Input/Output to finally develop a process that’s efficient & effective.

Q: I’d like to get help Combing Opt 1 & 2 “Inputs” (aka: Export of Data), to basically get the Element Id’s (GUID’s) & combine the Excel Headers accordingly…Is there a Point A to B script (shortest path)?

So my Main Goal is to use predefined Excel files with Headers to define the Parameters I want to Export based on the Category chosen (with Element ID’s included). Then, modify & Import the Excel file & have it grab the Headers again to specify Parameters to update without having to adjust a Strings/Code Blocks to update each column of parameters…that drop the headers & apply all else data. My goal is to possibly have the user highlight columns & or rows updated & or delete columns not updated in Excel. Finally, use Dynamo Player to just specify the Excel files to Export/Import Data. The scripts here are from what I’ve learned from labs/tutorials/research I’ve done. I’ve been at it looking back on notes & trying to make sense of Language that looks like Vulcan to me at times. Trying to get the smell of noob washed off (my 3rd try for practical Dynamo use) & the smell of new journeyman put on if I can get over this hump ;p Been on this for 2 days now & have hit a mental wall. Attached is the script with all 3 Process Options on Frozen until it’s being used (better than open/closing each option at a time to test).
I used the OOTB Advanced Model Sample to play with the scripts. This topic has so many ins/out to compose, & haven’t been able to pin-point my desire approach from all the posts & blogs but from 1 at “BIM-Troublemaker”.
Export-Import Studies.dyn (78.9 KB)
Sample Headers w ID.xlsx (8.4 KB)


#2

hi @cftrevizo :slight_smile:
I’m still a bit confused about what you are trying to achieve. I think you want to export to excel with headers. If so, all you need to do is to create a list of strings as shown below:

Could you please confirm?


#3

Yes, I was forgetting bout the {} symbols, thanks. Also for a Workshared project wouldn’t I need to get the GUID “ElementSelector.ByUniqueId” instead of Element ID? I think I should just wait til mornings when I have a clearer mind sometimes, especially after a workout day, lol. I guess for the Import process this can be applied to Opt-1 & 2.1. All that’s left is to make Import Opt 2.2 work. That Option really has me stumped.

I’m introducing myself to “Dynamo Player”, but that should be a different post If I get stumped again, but I’m gonna try it now with the ID’s to see if that’s the silver bullet…


#4

GUIDs are always safer then the element ids as those can change when synchronizing with central.

You may already know this, but if you are in a workshare model, it would also be best not to have anyone else in the model. That way when Revit tries to assign values during the import portion of the script it can check out all of the elements that are needed.