Posts

Microsoft VBA 7 - MSEdge find tab and bring to front

Attribute VB_Name = "MS_Edge" Option Explicit Option Compare Text #If VBA7 Then Private Declare PtrSafe Function EnumWindows Lib "user32" ( ByVal lpEnumFunc As LongPtr , ByVal lParam As LongPtr ) As Long Private Declare PtrSafe Function GetWindowText Lib "user32" Alias "GetWindowTextA" _ ( ByVal hwnd As LongPtr , ByVal lpString As String , ByVal cch As Long ) As Long Private Declare PtrSafe Function IsWindowVisible Lib "user32" ( ByVal hwnd As LongPtr ) As Long Private Declare PtrSafe Function ShowWindow Lib "user32" ( ByVal hwnd As LongPtr , ByVal nCmdShow As Long ) As Long Private Declare PtrSafe Function SetForegroundWindow Lib "user32" ( ByVal hwnd As LongPtr ) As Long Private Declare PtrSafe Function IsIconic Lib "user32" ( ByVal hwnd As LongPtr ) As Long #Else ...

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 : ...