Hey all,
I’m trying to get the titleblock of a sheet using the python script node. The script I’m creating is actually much bigger, but for the sake of simplicity I’ve just included this one node. What I would like it to do: collect all sheets from the model. Get and output the titleblocks associated with the sheets.
I’ve been looking at the Rhythm (package) node “Sheet.Titleblock” which does what I want, however I’m trying to avoid custom packages. I’m writing this script to be used in Dynamo Player for people who do not know (and do not care to know) Dynamo - they just want a solution that works. I don’t have time to make sure the correct packages are installed for 100 or so computers.
So all that said I’m trying to translate the code below from the “Sheet.Titleblock” node (written in c#) to python script. Any help figuring this out would be much appreciated!
/// <summary>
/// This node will grab the titleblock from the given sheet.
/// </summary>
/// <param name="viewSheet">The sheet to get titleblock from.</param>
/// <returns name="titleblock">The sheet's titleblock.</returns>
/// <search>sheet, sheets, titleblock</search>
public static List<Element> Titleblock(Revit.Elements.Views.Sheet viewSheet)
{
return new List<Element>((IEnumerable<Element>) ((IEnumerable<Element>) new FilteredElementCollector(DocumentManager.Instance.get_CurrentDBDocument(), ((Element) viewSheet).get_InternalElement().get_Id()).OfCategory((BuiltInCategory) -2000280).ToElements()).Select<Element, Element>((Func<Element, Element>) (e => ElementWrapper.ToDSType(e, true))).ToArray<Element>());
}
Currently I’m stuck at .get_InternalElement(). I get the warning: AttributeError: ‘ViewSheet’ object has no attribute ‘InternalElement’
Thanks,
HoldenGet Sheet Titleblock.dyn (3.2 KB)