Function Syntax: MXR / MXR_DCL Version: 1.1 Date: 20.06.2026 6:39:04PM https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/re-arrange-xrefs-in-a-drawing/td-p/11385801 Function Syntax: XrefDrawingOrder Commands: MXR, MXR_DCL Description 🧩 XrefDrawingOrder is an AutoCAD AutoLISP utility for managing XREF draw order through a clean DCL dialog instead of repeated manual DRAWORDER operations. 📐 The tool scans the active drawing for XREF block definitions, lists them in a Top to Bottom order, and lets the user reorganize their visual stacking order before applying the change. ✅ It is useful for Civil 3D drawings, CAD production files, basemap workflows, utility plans, background surveys, corridor references, annotation references, and multi-xref coordination drawings. Primary User Workflow 🚀 Run MXR or MXR_DCL in the AutoCAD command line. 📋 The program opens a DCL dialog titled Arrange XREFs Top to Bottom. ⬆️ Use Up, Down, Top, and Bottom to arrange xrefs in the required visual order. 🔄 Use Reset to rebuild the list from the current drawing xrefs, or Last to restore the last applied order. 💾 Use the Saved Orders tools to Save, Load, Rename, Delete, or Clear All xref order presets. ✅ Click Apply to update the drawing order while keeping the dialog open, or OK to apply and close. SEO Optimized Functionalities 🧩 AutoCAD XREF draw order manager - controls xref stacking order from a visual list. 📋 Automatic XREF detection - collects external reference block names from the active drawing. ⬆️ Move xrefs up and down - adjusts ordering without manually reselecting all xrefs. 🔝 Top and bottom placement - quickly sends selected references to the top or bottom of the order list. 🔄 Apply-safe loop - applies the order and reopens the dialog for further testing. 🕘 Last order memory - stores the latest applied order in the drawing using a Named Object Dictionary and XRECORD data. 💾 Saved order presets - writes reusable named presets to MXR_XrefOrders.txt. ✏️ Rename saved order - renames a saved xref preset and can overwrite an existing preset with the renamed content. 🗑️ Delete and clear presets - removes obsolete xref ordering setups from the saved list. 🛡️ Duplicate and missing xref handling - deduplicates selected orders and fills missing current xrefs when loading saved presets. Important Commands and Helper Functions C:MXR - main command that collects xrefs and opens the order dialog. C:MXR_DCL - command alias that launches the same workflow. AT:GetXrefNames - scans the active drawing Blocks collection for xref definitions. MXR:MoveUnder - applies AutoCAD DRAWORDER with the Under option. MXR:ApplyOrder - processes the final xref order pair by pair. MXR:SaveLastOrder and MXR:LoadLastOrder - store and reload the latest xref order inside the drawing. AT:XrefOrderDialog - creates the temporary DCL interface and handles all button actions. Practical Result ✅ The final result is a faster and more reliable AutoCAD xref draw order workflow for production drawings with many external references. 📐 XrefDrawingOrder improves CAD productivity by centralizing reference ordering, reducing manual draw order clicks, and making saved xref stacking configurations reusable. Operational Notes ⚠️ The drawing must contain XREFs; otherwise the command reports that no XREFs were found. ⚠️ Saved orders are name-based, so renamed or missing xrefs may require Reset or a new saved order. ⚠️ The utility changes draw order for xref INSERT references in the active drawing. Tags 🏷️ AutoCAD XREF, Xref drawing order, AutoCAD DRAWORDER, Civil 3D xrefs, External references, CAD manager tool, AutoLISP DCL, MXR command, MXR_DCL command, Named Object Dictionary, XRECORD, AutoCAD productivity, CAD reference management, production drawing workflow.