aj003
May 15, 2020, 8:33am
1
Hi
I have been trying to get the sheet width and height from my titleblock into my schedule sheet list.
I can get one value in either Sheet Height or Sheet Width, but not both at the same time in the same column.
Here is what my dynamo script looks like atm
1 Like
Hello
a solution by obtaining the boundingBoxes of TitleBlock (s)
import clr
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
toList = lambda x : x if hasattr(x, '__iter__') else [x]
out= []
viewlst = toList(UnwrapElement(IN[0]))
for view in viewlst:
titleBkl = FilteredElementCollector(doc, view.Id).OfClass(FamilyInstance).OfCategory(BuiltInCategory.OST_TitleBlocks).FirstElement()
bbx = titleBkl.get_BoundingBox(view)
width = bbx.Max.ToPoint().X - bbx.Min.ToPoint().X
height = bbx.Max.ToPoint().Y - bbx.Min.ToPoint().Y
out.append("{} x {}".format(width, height))
OUT = out
3 Likes