1

Dynamo Script

Within Dynamo I was able to adjust the title block per sheet but I was requested to simplify it into a button click using python only.

I can find the sheets but I can not adjust the parameters per sheet. I believe this is because the parameter I am trying to toggle on and off is located within the Titleblock and not on the sheet it self. I thought maybe I would need to unwrap these but I could not get the function to work outside of Dynamo. Any help would be appreciated.

sheet_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Sheets) \
                                           .WhereElementIsNotElementType() \
                                           .ToElements()
for sheet in sheet_collector:
    print(sheet.Name)

The snippet above is how I am sourcing all the sheets and I have been able to find everyone but when searching for the custome parameter, it comes up nil.

1 Answers1

1

To get the FamilyInstance of the title block you can use this:

var titleBlockFamInst = new FilteredElementCollector(doc, viewSheetId).OfCategory(BuiltInCategory.OST_TitleBlocks).FirstElement() as FamilyInstance;
RevitArkitek
  • 161
  • 7
  • Thanks, FamilyInstance was what I needed to find. – Stephen Dini May 17 '21 at 11:44
  • Instead of trying to find the sheet and its corresponding title block, I just found every family instance I was looking for. Once I had all the correct instances I got the OwnerViewId. Then, using GetElement(id), I was able to get the matching sheet and access to all the correct information. – Stephen Dini May 17 '21 at 11:51