Posts

Showing posts from October, 2023

Keynote types

Image
 Determine types of user keynotes - essential in model checking as 'User keynotes' should be zero to a few on any given project. Uses FEC (Filtered element collector) to gather all keynote tags and looks at the instance parameter to determine the type. GPT Tweak to export as list counts: # Load the required libraries import clr clr . AddReference ( "RevitServices" ) import RevitServices from RevitServices . Persistence import DocumentManager from RevitServices . Transactions import TransactionManager clr . AddReference ( "RevitAPI" ) from Autodesk . Revit . DB import * # Access the current Revit document doc = DocumentManager . Instance . CurrentDBDocument # Define the categories for User, Element, and Material keynotes keynoteCategories = { "User" : "User" , "Element" : "Element" , "Material" : "Material" } # Initialize counters for each category ...

Word VBA for modifying +Body and +Header (default fonts) and setting default styles

Attribute VB_Name = "Styles" Option Compare Text Const FontFixedWidth = "Courier New" ''set preferred fixed width font Const FontProportionalWidth = "Arial" ''Set preferred variable width font Sub STYLE_PURGE () Dim oStyle As Style For Each oStyle In ActiveDocument.Styles 'Only check out non-built-in styles If oStyle.BuiltIn = False Then With ActiveDocument.Content.Find . ClearFormatting . Style = oStyle.NameLocal . Execute Findtext := "" , Format := True If . Found = False Then oStyle.Delete End With End If Next oStyle End Sub Sub STYLE_Emphasize_references () ' Emphasize_See_references Macro ' Dim ShowFieldCodesStatus As Boolean ShowFieldCodesStatus = ActiveWindow.View.ShowFieldCodes Active...