MoveTitleBlock.py
# purpose and IO: IN[0]=run (bool, optional), IN[1]=sheet Ids (list/int/ElementId or None), OUT=report list of dicts # Moves all paper-space elements so the largest title block's bounding-box Min becomes (0,0) per sheet. # Skips CAD Import/Link instances named like "0,0,0" or "0,0-Origin". One transaction across all sheets. # Note: To avoid CPython generic-binding issues, we try batch MoveElements; on failure we fall back to per-element MoveElement. import clr clr . AddReference ( 'RevitAPI' ) clr . AddReference ( 'RevitServices' ) from Autodesk . Revit . DB import ( FilteredElementCollector , ViewSheet , FamilyInstance , BuiltInCategory , ImportInstance , ElementTransformUtils , XYZ , ElementId ) from RevitServices . Persistence import DocumentManager from RevitServices . Transactions import TransactionManager # Optional: if batch move works in your CPython, you can enable the List+XYZ path below. try : ...