Posts

64-bit Unsigned Integers in VBA

There is no native 64-bit unsigned integer data type in VBA.  In practice, this is rarely an issue.  But "rarely" is not the same as "never."  To take advantage of certain Windows API calls, you'll need a workaround. 64-bit Unsigned Integers in VBA Option Compare Database Option Explicit 'Inspired by: https://stackoverflow.com/a/48626253/154439 (h/t Charles Williams) #If VBA7 Then Private Declare PtrSafe Sub CopyMemory Lib "Kernel32.dll" Alias "RtlMoveMemory" ( Destination As Any , Source As Any , ByVal Length As LongPtr ) #Else Private Declare Sub CopyMemory Lib "Kernel32.dll" Alias "RtlMoveMemory" ( Destination As Any , Source As Any , ByVal Length As Long ) #End If #If Win64 Then Declare PtrSafe Sub GlobalMemoryStatusEx Lib "kernel32" ( lpBuffer As MEMORYSTATUS ) Private Type LARGE_INTEGER LowPart As Long Hig...

Revit.Dynamo.Python.CPython3 Schedules on sheets

 Python for placed schedules on sheets - returns  Schedule Name Sheet Name Sheet Number Schedule name for schedules not placed on sheets #!python3 ##Code pre-directive untested! ##Apsis0215 R Allen 2022-09-28 CPy3 import clr clr . AddReference ( "RevitServices" ) from RevitServices . Persistence import DocumentManager doc = DocumentManager . Instance . CurrentDBDocument ##Current Document import Revit from Autodesk . Revit . DB import FilteredElementCollector , ScheduleSheetInstance , ViewSchedule PlacedSchedules = FilteredElementCollector ( doc ). OfClass ( ScheduleSheetInstance ). WhereElementIsNotElementType (). ToElements () PlacedSchedulesName = [ PSS . Name for PSS in PlacedSchedules ] PlacedSchedulesID =[ VID . ScheduleId for VID in PlacedSchedules ] AllSchedules = FilteredElementCollector ( doc ). OfClass ( ViewSchedule ). WhereElementIsNotElementType (). ToElements () AllSchedulesID =[ VID . Id for VI...