Dynamo Dictionaries to Block Attributes?

I am trying to automate our teams one-line drawing production and a big part of that is pulling in information from our teams electrical design excel file that holds the information that needs to be placed into block attributes. I am trying to make a game plan on how I am going to place these autocad block references into plan and then also make sure information stays where it needs to. My thinking is to make a dictionary for each circuit ID and then have values underneath it for each of the components that will make it into the block attributes eventually. Does anyone have any other advice on how to handle this and make sure the information doesn’t get mixed up? Screenshot below showing some guidelines I was provided to this process with references to screenshot of the mentioned excel file.

Also, I have already made some progress on a Dynamo script that will read the excel file and place the block references in the location I want based on the number of circuits identified in the excel file. Two other screenshots showing that progress.



What I did last time with complex excel data:

  • import from excel
  • get header (first row) and rest of the data
  • create dict using header as key, data as value. this creates list of dicts, every list is a row from excel.
  • get the values of the one parameter you need (Id), if there are multiple lines for one Id for some reason, you can use GroupByKey node to group them.
  • after that you can create dict of dicts for every Id
  • you can use whatever Id data you need you just have to take care of list levels (normalize and flatten can be helpful)

this method let me assign data regardless of order of the data and let me chose wichever lines I want to use

2 Likes

:backhand_index_pointing_up: great example of that here on the Primer:

4 Likes


Amigo @jbrunkhorst buenas. what you triyng to achive is dificult and complex, but it is posible, i let you some advices:

  1. Define if you want to use existing items or reproduce new instances in a new file
  2. Work with 1 block definition at the time, this way you can work with only 1 set of attribute names and values at the time
  3. take a look to the levels topics, will prevent you became crazy in the next days.
    I let you also some similar topics, that can help you, good luck!

this last one is a bit more complicated but it is the most similar what you triyng to achive!