TitleBlocksTools

Short description

Title Blocks Tools – Unified Menu System Comprehensive dialog-based interface for exporting and updating titleblock attributes via CSV with integrated help, file management, and reload utilities.
titleblockstools 000

Command:

Commands: TitleBlocksTools, EXPTBCSV_EXPORT, UTB2

Description:

This integrated toolset combines CSV export and import functionality for titleblock attribute management:
  • Main Menu Dialog provides radio button selection between Export and Load CSV operations
  • EXPTBCSV_EXPORT – Exports titleblock attributes to CSV format from paper space inserts:
    • User picks titleblock inserts interactively until pressing ENTER
    • Collects all instances across all paper space layouts
    • Displays available attribute tags with numbered list
    • Allows tag selection via “All”, “None”, or range syntax (1,3,5-7)
    • Outputs CSV with columns: DWG, Layout, Block, plus selected tags
    • Handles Excel-problematic values (dates, formulas) with single-quote prefix
    • Escapes commas, quotes, and newlines using proper CSV quoting
    • Auto-opens in Excel via hard-coded path with registry and fallback detection
  • UTB2 – Updates titleblock attributes from CSV (Lee Mac’s Update Titleblock V1.9):
    • Matches current drawing name against first column of CSV
    • Optional Layout column filter for layout-specific updates
    • Optional Block column filter for block-specific updates
    • Updates only attributes whose tags match CSV column headers
    • Changes only when attribute values differ from CSV
    • Supports dynamic blocks via effective name resolution
    • Handles duplicate attribute tags correctly
    • Single UNDO mark for entire operation
    • Configurable block name wildcard filter (UTB2:ftr)
    • Can run automatically on drawing open (commented by default)
  • Enhanced Help Dialog with comprehensive documentation:
    • Displays LISP file path and full usage instructions
    • Unicode/ASCII toggle for bullet points and arrows
    • Multi-select list with Copy Selected and Copy All to clipboard
    • Copy Path button for LISP file location
    • Integrated Explorer and Notepad++ launcher buttons
    • Explains CSV format, column requirements, and workflow
  • File Management Tools:
    • Explorer button opens folder containing LISP file with file pre-selected
    • Notepad++ button opens LISP in editor (detects installation paths)
    • Reload button reloads LISP file from disk without closing AutoCAD
    • Path resolution via %USERPROFILE% environment variable
  • Persistent Settings – Remembers last selected option and Unicode preference across sessions
Designed for production titleblock workflows with round-trip capability: Export β†’ Edit in Excel β†’ Update.

Helper function: (if any)​

Helper Functions:
  • tbt:set-path – Resolves LISP file path from USERPROFILE environment variable
  • tbt:quote – Wraps strings in double quotes for shell commands
  • tbt:isStr / tbt:slen – String type checking and safe length calculation
  • tbt:clipboard-put – Copies text to clipboard via MSHTML object
  • tbt:join – Joins string list with separator
  • tbt:get-selected-lines – Retrieves selected items from DCL list box
  • tbt:open-lsp-folder – Opens Explorer with LISP file selected
  • tbt:open-with-npp – Launches Notepad++ or fallback editor
  • tbt:open-this-in-npp – Opens current LISP file in Notepad++
  • tbt:reload-self – Reloads LISP file from disk
  • tbt:copy-path – Copies LISP file path to clipboard
  • tbt:help-make – Builds help text with Unicode or ASCII formatting
  • tbt:help-build-display – Constructs help list with path header
  • tbt:help-refresh-list – Updates DCL list box with help content
  • writetbtDCL – Generates temporary DCL file with both dialogs
  • tbt-help-local – Displays help dialog with action handlers
  • radiotbtDCL – Main dialog runner with option selection
  • csvEscape – Escapes commas, quotes, newlines for CSV format
  • needsQuote / maybeExcelSafe – Detects and prefixes Excel formula values
  • dwgBaseName – Extracts drawing filename without extension
  • push-uniq – Adds item to list if not already present
  • collectAttribs – Extracts attributes from INSERT entity
  • rowsForBlockAllLayouts – Collects block data from all paper space layouts
  • unionTags – Aggregates all unique attribute tags from rows
  • valForTag – Retrieves attribute value for specific tag
  • writeCSV-withTags – Writes CSV file with selected columns
  • guess-excel-paths – Detects Excel installation locations
  • try-open-excel – Attempts to open CSV in Excel via multiple methods
  • pickBlockNames – Interactive block selection loop
  • collectRowsForBlockNames – Aggregates rows for multiple block names
  • parse-range – Parses range syntax (1,3,5-7) into index list
  • LM:al-effectivename – Resolves dynamic block effective name
  • LM:readcsv – Parses CSV file into matrix list
  • LM:csv->lst – Parses CSV line handling quotes and separators
  • LM:csv-replacequotes – Converts double quotes to single
  • LM:massoc – Returns all associations of key in list
  • LM:remove1st – Removes first occurrence from list
  • LM:startundo / LM:endundo – Undo group management

Functionalities:

Functionalities:
  • Displays unified menu dialog with radio buttons for Export CSV or Load CSV operations
  • Resolves LISP file path dynamically from USERPROFILE environment variable
  • Main dialog includes Explorer, Notepad++, and Reload buttons for file management
  • Help button launches comprehensive documentation dialog
  • Export workflow (EXPTBCSV_EXPORT):
    • Prompts user to pick titleblock inserts until ENTER pressed
    • Collects unique block names from selections
    • Scans all paper space layouts for matching inserts with attributes
    • Displays numbered list of all unique attribute tags found
    • Accepts “All”, “None”, or range input (1,3,5-7) for tag selection
    • Prompts for CSV save location with drawing name as default
    • Writes CSV with DWG, Layout, Block columns plus selected tags
    • Applies Excel-safe formatting (single-quote prefix for dates/formulas)
    • Escapes special characters (commas, quotes, newlines) per CSV standard
    • Attempts to auto-open CSV in Excel via multiple detection methods
  • Update workflow (UTB2):
    • Prompts for CSV file if UTB2:csv not preset
    • Validates CSV format and searches for current drawing name in first column
    • Applies optional layout filter if UTB2:lay is true (CSV has Layout column)
    • Applies optional block filter if UTB2:blk is true (CSV has Block column)
    • Uses wildcard filter UTB2:ftr to limit scope to specific block names
    • Resolves effective names for dynamic/anonymous blocks
    • Iterates through all attributed inserts matching filters
    • Updates only attributes with tags matching CSV headers
    • Changes only when current value differs from CSV value
    • Supports duplicate attribute tags by removing processed items from value list
    • Creates single undo mark for entire batch operation
    • Reports count of attributes and blocks updated
  • Help dialog functionality:
    • Displays LISP file path at top of help content
    • Shows comprehensive documentation with bullet points and arrows
    • Unicode toggle switches between Unicode symbols and ASCII alternatives
    • Rebuilds and refreshes display when Unicode preference changes
    • Copy Selected copies highlighted lines to clipboard
    • Copy All copies entire help text to clipboard
    • Copy Path copies LISP file location to clipboard
    • Explorer button navigates to LISP folder with file selected
    • Notepad++ button opens LISP in editor with fallback to Notepad
  • File management features:
    • Reload button executes (load) on current LISP file without closing AutoCAD
    • Explorer integration uses /select argument for file highlighting
    • Notepad++ detection tries configured path, cmd shell, and Notepad fallback
    • Path copying via MSHTML clipboard object for reliability
  • Persistent state management:
    • *tbt-last-option* remembers last radio button selection
    • *tbt-unicode* remembers Unicode/ASCII preference
    • *NPP:Path* stores custom Notepad++ installation path
  • CSV parsing handles alternative delimiters (semicolon) from regional settings
  • Removes case sensitivity for drawing name matching
  • Supports filenames with or without .dwg extension in CSV
  • Handles CSV cells containing embedded commas, quotes, and line breaks

Result:

Result:
  • Main menu dialog appears with Export CSV and Load CSV options
  • Selecting Export launches interactive titleblock picker and tag selector
  • CSV file is generated with proper escaping and Excel-safe formatting
  • CSV optionally opens in Excel automatically for editing
  • Selecting Load CSV updates titleblocks from edited CSV file
  • Only changed attribute values are updated (efficiency optimization)
  • Single undo operation reverts all updates if needed
  • Help dialog provides complete documentation with copy-to-clipboard features
  • Explorer and Notepad++ buttons enable quick LISP file access and editing
  • Reload button applies code changes without restarting AutoCAD
  • Round-trip workflow: Export β†’ Excel edit β†’ Update maintains data integrity
  • Status messages report counts of updated attributes and blocks
  • Unicode/ASCII toggle adapts help text for different display preferences

Images, animations etc.

titleblockstools 000
Pixel

XAML code:

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
    
<src:RibbonToolTip x:Key="TitleBlocksTools">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: TitleBlocksTools</Bold>
<LineBreak/>
<Bold>Version: 1 Date:21.07.2025</Bold>
<LineBreak/>
<LineBreak/>
<Hyperlink>AI+</Hyperlink>
<LineBreak/>
<Bold>Description</Bold><LineBreak/>
This program provides a set of Title Block Tools for AutoCAD, using <Bold Foreground="DarkRed">LISP</Bold> combined with <Bold Foreground="DarkRed">DCL dialogs</Bold>. <LineBreak/>
It is designed to streamline the management, editing, and insertion of <Bold Foreground="Blue">title blocks</Bold> inside drawings. <LineBreak/>

<Bold>General Workflow</Bold><LineBreak/>

The user is presented with a <Bold Foreground="DarkRed">dialog interface (DCL)</Bold>. <LineBreak/>

Options allow the user to select and configure <Bold Foreground="Blue">title blocks</Bold> according to project standards. <LineBreak/>

The program includes utilities to open, edit, and manage LISP support files. <LineBreak/>

Additional helpers support text formatting, clipboard handling, and automation. <LineBreak/>

<Bold>Key Functionalities</Bold><LineBreak/>
β€’ <Bold Foreground="DarkRed">Path Setup</Bold>: Automatically resolves the path of the LISP/DCL support files. <LineBreak/>
β€’ <Bold Foreground="DarkRed">Clipboard Tools</Bold>: Copies selected values or attributes into the clipboard. <LineBreak/>
β€’ <Bold Foreground="DarkRed">Dialog Interaction</Bold>: Presents lists, radio buttons, and selection tiles in DCL for choosing <Bold Foreground="Blue">layouts and title blocks</Bold>. <LineBreak/>
β€’ <Bold Foreground="DarkRed">Block Selection</Bold>: Requires the user to select a <Bold Foreground="Blue">block reference</Bold> in the drawing to apply modifications. <LineBreak/>
β€’ <Bold Foreground="DarkRed">Open File Location</Bold>: Allows direct opening of the LISP support folder in Windows Explorer. <LineBreak/>
β€’ <Bold Foreground="DarkRed">External Editor Integration</Bold>: Can open files directly in <Bold Foreground="Blue">Notepad++</Bold>. <LineBreak/>
β€’ <Bold Foreground="DarkRed">Title Block Editing</Bold>: Enables editing of attributes and updating of <Bold Foreground="Blue">sheet data</Bold> directly via dialogs. <LineBreak/>
β€’ <Bold Foreground="DarkRed">Batch Operations</Bold>: Multiple layouts or title blocks can be processed in one step. <LineBreak/>

<Bold>Highlighted Commands</Bold><LineBreak/>

<Bold Foreground="Red">(tbt:set-path)</Bold> β†’ Sets up the environment path. <LineBreak/>

<Bold Foreground="Red">(tbt:clipboard-put)</Bold> β†’ Copies data to clipboard. <LineBreak/>

<Bold Foreground="Red">(tbt:get-selected-lines)</Bold> β†’ Reads user selections from dialog lists. <LineBreak/>

<Bold Foreground="Red">(tbt:open-lsp-folder)</Bold> β†’ Opens the LISP folder in Explorer. <LineBreak/>

<Bold Foreground="Red">(tbt:open-with-npp)</Bold> β†’ Opens a file in Notepad++. <LineBreak/>

<Bold Foreground="Red">DCL Tiles</Bold>: Radio buttons, list boxes, and buttons for title block selection and editing. <LineBreak/>

</TextBlock>
            
<Grid>
<Image Source="TitleBlocksTools_000.jpg" Stretch="Uniform"/>
</Grid>

<Grid>
<Image Source="TitleBlocksTools_001.jpg" Stretch="Uniform"/>
</Grid>

</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>



Additional info:

Share this page:

Leave a Reply

Page Tag: 🏷️ Autocad Lisps

  • TitleBlocksTools

    β€”

    by

    Short description Title Blocks Tools – Unified Menu System Comprehensive dialog-based interface for exporting and updating titleblock attributes via CSV with integrated help, file management, and reload utilities. Command: Commands: TitleBlocksTools, EXPTBCSV_EXPORT, UTB2 Description: This integrated toolset combines CSV export and import functionality for titleblock attribute management: Main Menu Dialog provides radio button selection between…

  • Zoom2Layer

    β€”

    by

    Short description Displays a filterable layer selection dialog and then zooms the view to the extents of all objects on the chosen layer. Supports picking a layer directly from a selected object in the drawing and remembers the last filter used. Command: Command: Zoom2Layer Description: Builds a list of layers that are visible and unfrozen,…

  • RenameLayer

    β€”

    by

    Short description LRN β€” DCL-driven batch layer renamer with search filter, add prefix/suffix, remove substring, replace text, optional ALL CAPS, and optional auto-merge after remove Builds a matching layer list (excluding layer 0), then renames each layer via command-line -RENAME and optionally merges via -LAYMRG Wraps operation in an Undo mark and shows an Express…

  • PurgeUnusedLayers

    β€”

    by

    Short description Purges unused layers using a dialog that scans the drawing and deletes layers with no entities on them. Protects critical layers and the current layer and optionally skips Xref layers. Command: Command: PURGEUNUSEDLAYERS Description: Creates a single file workflow by embedding a DCL definition inside the LISP and writing it to the temp…

  • LayersNameToClipboard

    β€”

    by

    Short description LayersName2Clipboard β€” collect unique layer names from a user selection and copy them to the Windows clipboard as a newline-separated list Uses an HTMLFile COM object to access clipboardData and write text directly to the clipboard Command: β€’ LayersName2Clipboard Description: Prompts the user to select entities, then scans the selection set and extracts…

  • LayerList

    β€”

    by

    Short description Command: Description: Helper function: (if any)​ Functionalities: Result: Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="LayerList"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: LLFP</Bold> <LineBreak/> <Bold>Version: 1.1 Date: 20.06.2026 6:38:54PM</Bold> <LineBreak/> <Hyperlink>https://jtbworld.com/autocad-layer-list-lsp</Hyperlink> <LineBreak/> short_description: |<LineBreak/> <Bold><Run Foreground="DodgerBlue">SEO Description</Run></Bold><LineBreak/> <Run Foreground="White">πŸš€ LayerList is an…

  • FreezeLayersInMS

    β€”

    by

    Short description FLMS3 β€” Model Space layer control dialog: filter + multi-select + batch actions (Freeze/Off/Lock/Plot, etc.) with optional Xref scoping Fixes: filters never show stray “T”; Xref layer names are displayed without the xref| prefix while operations still use full names internally Persists filter/toggle/xref selections between runs via environment variables Command: β€’ FLMS3 Description:…

  • DuplicateToSelectedLayer

    β€”

    by

    Short description DuplicateToSelectedLayer β€” duplicate selected entities onto a chosen target layer via a simple DCL layer picker, then bring the copies to front and preselect them Remembers the last chosen layer and defaults the dialog selection accordingly Uses COPY with zero displacement to create duplicates in place, then CHPROP + DRAWORDER on the new…

  • DuplicateToNewLayer

    β€”

    by

    Short description DUPLICATELAYER / DUPLICATELAYERCURRENT β€” duplicate a layer’s properties into a new layer name via DCL, then set it current (optionally move the selected object). Copies common layer properties (Color, Linetype, Lineweight, Description) and PlotStyleName when available (STB-aware). DCL dialog asks for the new layer name and includes an β€œassign selected object” checkbox (used…

  • DeleteLayerByFilter

    β€”

    by

    Short description DeleteLayerByFilter β€” embedded DCL layer deleter with filter + multi-select, using -LAYDEL scripted sequence with VLA fallback v10 change: fixes the -LAYDEL command sequence to mirror manual steps: ._-LAYDEL β†’ _N β†’ <name> β†’ "" β†’ _Y (plus localized fallback) Excludes Xref layers and reserved layers (0, DEFPOINTS) and reports deleted vs failed…