Baking List Structure Info into List of Strings

Hey,

I’ve got a list of strings sorted as such:

  • 0 List - RVT Linked Doc 0
    0 List - Sheet 0
    “Param Name 1”
    “Param Name 2”
    “Param Name 3”
    1 List - Sheet 1
    “Param Name 1”
    “Param Name 2”
    “Param Name 3”
  • 1 List - RVT Linked Doc 1
    0 List - Sheet 0
    “Param Name 1”
    “Param Name 2”
    “Param Name 3”
    1 List - Sheet 1
    “Param Name 1”
    “Param Name 2”
    “Param Name 3”

Is there any simple way to bake information about the list structure into the strings themselves? I’d like to concatenate the name of the RVT Link and Sheet before each of the parameter names. For reference, I’m trying to flatten the list and use it as keys for a dictionary, but I still want the information about what where each parameter was located to remain in the key (i.e. what RVT link and sheet the parameter comes from).

The list structure doesn’t actually contain any of the “header” information, just the items in the list. We’d need more information, but I’d assume you have lists representing those headers elsewhere in your graph. You can just join each of those list values together to get what you’re after.

ie. [RVT Linked Doc] + [Sheet] + [Param Name]

1 Like

Nested dictionaries could work
{"Revit_doc_1":{"Sheet 1":[Param1, Param2,...], "Sheet 2":[Param1, Param2,...]}, "Revit_doc_2":{"Sheet 1":[Param1, Param2,...], "Sheet 2":[Param1, Param2,...]}}

Then use keys to get the info
params = info_dict["Revit_doc_1"]["Sheet 2"]