Function Syntax: TPE_DIAG / ToolPaletteExporter Version: 1.0 Date: 20.06.2026 6:39:01PM WEB 🚀 ToolPaletteExporter AutoCAD Tool Palette export utility for packaging XTP palettes, referenced source files, palette image folders, and missing-file reports into one clean archive. Main Command 🧰 Run ToolPaletteExporter in the AutoCAD command line to open the Tool Palette Exporter dialog. 🧪 Run TPE_DIAG to diagnose AutoCAD ToolPalettePath settings, OneDrive detection, XTP discovery, and source path resolution. SEO Optimized Description 📘 ToolPaletteExporter is an AutoCAD AutoLISP tool palette backup and export tool for CAD managers, Civil 3D users, drafting teams, and support-file administrators. 🔍 The utility scans loaded AutoCAD tool palette locations, saved custom XTP folders, OneDrive folders, and Documents folders to locate available .xtp palette files. 📦 Selected palettes are exported as structured ZIP packages containing the XTP file, related source files, optional palette image folders, and a CSV report for missing references. 🧠 This improves AutoCAD tool palette migration, CUI support workflows, CAD standards deployment, palette backup, and production environment troubleshooting. Functionalities 📂 XTP discovery - searches AutoCAD ToolPalettePath, saved registry folders, OneDrive variants, and Documents folders. 🔍 Wildcard filtering - filters palette names with * and ? patterns inside the DCL interface. Multi-palette selection - supports selecting one, many, all, or no palettes before exporting. 📦 ZIP archive export - creates PaletteName_export.zip for each selected palette. 🧩 Source file parsing - reads <SourceFile> entries from XTP files and deduplicates file references. 🖼️ Palette image packaging - includes the matching PaletteName_2 image folder when it exists. 📊 Missing-file report - writes Files_not_found.csv and opens a results dialog when referenced files are missing. 📋 Clipboard reporting - copies palette lists, diagnostic reports, and missing-file reports to the Windows clipboard. 💾 Session history - remembers the last output folder, filter, custom XTP folders, and selected palettes through the registry. 🧪 Diagnostic mode - checks OneDrive folders, AutoCAD ToolPalettePath values, XTP files found, referenced source paths, and environment variables. Helper Modules 🧰 TPE:GetXtpPaths discovers palettes from multiple search locations. 🧰 TPE:ParseXtpFiles extracts source-file references from XTP XML text. 🧰 TPE:ResolvePath resolves USERPROFILE and OneDrive path variants. 🧰 TPE:CreateZip generates the PowerShell ZIP workflow and archive layout. 🧰 TPE:ShowResultsDcl displays missing-file details with Copy to Clipboard support. Practical Result ✅ The final result is a portable AutoCAD Tool Palette export package that can be used for backup, migration, troubleshooting, CAD standards deployment, and support-file auditing. This makes ToolPaletteExporter useful for maintaining reliable AutoCAD and Civil 3D production environments with consistent tool palettes and traceable source dependencies. Important Notes ⚠️ The uploaded source defines ToolPaletteExporter and TPE_DIAG as command functions. The header also mentions TPEXPORT, but that alias is not defined in this uploaded file. ⚠️ Export quality depends on valid XTP files, accessible source-file paths, readable palette image folders, and Windows PowerShell availability.