Export parameter values to specific row

Hello,

We have a standard Excel file that we would like to populate with parameter values for use by our service department. Currently, I can gather and export all the information to the Excel file, except for elements that are sub-elements connected to a main element. In this scenario, the main element is an AC outdoor unit with three indoor units connected to it. I need to export two parameter values (Model, Bestemming) to specific columns, but they need to be in the same row as the AC outdoor unit.

The challenge is that the standard export to Excel only allows us to select the start row, and this unit can be in different rows in various projects, making it impractical to report to a “standard” row. To address this, I’m considering sorting the elements based on the “codering” parameter. The main unit has the parameter value AC-02, while the indoor units are labeled AC-02a, AC-02b, and AC-02c.

I’ve attached the script to this thread. Could anyone help me figure out the last part of the script to achieve this?

Thank you!



Dynamo 2.16_Installatiedelen.dyn (129.7 KB)

  1. You’re exporting multiple times to the same excel sheet. I don’t think that’s wise.
  2. are you exporting from a schedule? Then have you tried the DiRootsOne Plugin?
  3. can you give an example of what you want your excel to look like?
  4. have you considered reading the excel file and seeing which column is the first empty one?
  1. How would you approach this in a better way? Do you have any suggestions to make this process better? At the moment its working as intended, without any errors (while the excel sheet is empty).
  2. No, it’s not possible to filter the information needed with a schedule, unfortunately.
  3. I hope it’s readable:
  4. I would need to fill in the empty fields to obtain a result; I don’t think that’s ideal.
  1. Yeah learn about lacing and sublists, below is an example
    Dynamo 2.16_Installatiedelen.dyn (76.4 KB)
  2. you can also just have it assemble a list and export parameters
  3. yeah this seems pretty clear, if the column structure is always the same then you can just set the right columns. Otherwise I would recommend having the script read the excel file and checking parameter names to see which info goes where
  4. it’s not empty, you have headers
  1. Thank you for the tip.
    The columns are always the same; the issue lies in exporting to the same row as the main component. In the screenshot, my information should be in row 12 and 14 instead of 1, 2 (the starting row).

That’s what happens when you export separately.

Follow the example of the .dyn I replied. It should help you keep things aligned

I don’t think this will solve my problem. I understand where you’re going, and it should be simpler this way, but what it really did was put me back at 0. And I still don’t see how I can define the starting row for different elements. Sure, I get to export it all at once, but the row I need to export to is different for each project.

I can determine the data lacing through trial and error, but I’m encountering issues with the columns. It appears that the columns aren’t functioning as expected, as the system only takes the first column provided and exports data from that column onward. This issue likely relates to lacing, a concept I don’t fully understand at the moment.

Maybe you need to sort your lists so the values of your Elements (you want to pair) end up at the same index.

Because as i understand the 25 should be in the row with buitengevel?

Put “data @L3” on L2

Right click on “auto” in the bottom right corner of the same node and press longest lacing

SAVE! a wrong kind of lacing and testing might have your revit calculate x^x (x being the amount of elements) instead of x^2

While it is test running, you can read up on lacing in the primer (link below). I personally flatten most lists and avoid lacing as much as I can. But in this case it is unavoidable, unless you revert back to splitting everything up into several nodes
https://primer.dynamobim.org/06_Designing-with-Lists/6-3_lists-of-lists.html

1 Like

Hello,

Unfortunately, it appears that when changing the data level to L2, it overwrites the same data with only 2 or 3 elements. Although the data input is sorted as desired, for some reason, it is not populating the correct columns.

Even though this is quite interesting, I still can’t figure out the initial question of getting the information from different elements into the same row as the elements they belong to (using the script that writes multiple times to excel).

Hi! You’re exporting AC outdoor and linked indoor unit parameters (Model, Bestemming) to Excel, managing diverse start rows in projects. Sorting by “codering” is smart. Finalize by identifying AC-02, exporting Model and Bestemming for it and its indoor units, ensuring the same row. Need more help? Share your script. Best of luck with Dynamo!

Hello, the script has been uploaded in the initial post. The discussion veered off course a bit as it would be more efficient to export to Excel with a single node instead of using 6 or 7 ExportToExcel nodes. Nonetheless, the script attached in the first post accomplishes the task; it just needs the final touch to align the data in the same rows.

you can use Brimohareb pak. to add value at cell

I could attempt this, but wouldn’t it result in multiple writes to the same Excel file?

Hello, I haven’t found a suitable solution yet. I reverted the script to its original state of writing to Excel multiple times because I encountered difficulties when attempting to make the script work with lacing. I’m hopeful that someone can assist me in finding a solution to accurately write the additional data to the correct columns and rows.