Get titleblock data and fill sheet parameter without one-by-one processing

I made a script that takes some data from the title block and inserts it into the parameter of the corresponding sheet.
The problem is that Revit processes every sheet (semi-background without opening it) and it takes a lot of time.
Is there any way to speed up this process?

GetTitleblock-SetSheetsParam-d203.dyn (14.3 KB)

I for one would need a sample data set and your dyn to understand the issue better. Typical sheet parameters should update in a fraction of a second.

@JacobSmall Indeed. The script takes data from the title block and inserts it into the sheet parameter. I will change the topic.

I agree with Jacob’s comment, I run similar scripts to this and they don’t take long to process 50-100 sheets or so at least. How many sheets are you processing and how large is the model size of the file you are working in?

I think this is the same problems, as taking data from Viewports on sheets. Revit needs to “open” sheets in background and check which viewports are placed on sheet.
This problem might be a result of Revit not having Titleblock instance/type values in sheet data.

@GavC @Jan_Secnik Thanks for the hints, I found that the problem is in extracting data from each title block.

Then my question can be asked like this:
Is it possible to get data from the title blocks without the background opening of each sheet?

@NurlanAdsk then why not get the TitleBlocks directly?

Although I do agree with @GavC … this shouldn’t take long …

According to my logic:

  1. I need to get a list of sheets;
  2. get a list of the title blocks on these sheets;
  3. extract a list of data from the list of title blocks;
  4. Insert this data into sheets.

Why not

  1. Get all titleblocks directly with an all elements of type method, an all instances of method, or an all elements of category method.
  2. Get what sheet they are on by pulling the name or number value from the TB’s parameters.
  3. Get other data from each TB and build a dictionary where the ordered list of values is the data, and the Key is the sheer number or name.
  4. Pull all sheets using a all elements of category node.
  5. Get all sheets numbers or names.
  6. Get the values from the dictionary for each sheet and set the parameter values accordingly.

A sample graph and data set would help here.

1 Like

Thank you @JacobSmall, I came to the same solution.

TitleBlockData-to-Sheet-d203.dyn (26.2 KB)