Menu System Architecture¶
The ConstructiVision menu system: how the 6-file family works together, how it evolved from v3.60 to v11, and the step-by-step procedure for making menu changes.
Note
This document is reverse-engineered from the src/TB11-01x32/ and src/x86/v3_60/ source trees, the v11 architecture documentation, and the csv.cui XML analysis. It consolidates scattered menu intel from 6+ documents into one actionable reference.
The 6-File Menu Family¶
ConstructiVision’s menu is represented by six interrelated files that all describe the same pulldown menu. Understanding which is “master” and which are derived is critical before making any changes.
File Inventory (v11 / TB11-01x32)¶
File |
Size |
Format |
Role |
Editable? |
|---|---|---|---|---|
|
7 KB |
Text |
Master source — human-authored menu definition |
Yes |
|
7 KB |
Text |
AutoCAD-generated working copy of .mnu |
No — regenerated |
|
8 KB |
Binary |
Compiled menu (faster loading) |
No — compiled |
|
1 KB |
Binary |
Menu resources (bitmap icons) |
No — compiled |
|
37 KB |
XML |
Modern CUI equivalent (AutoCAD 2006+) |
Conditional (see below) |
|
3 KB |
AutoLISP |
Menu loader script |
Yes |
Relationship Diagram¶
MASTER SOURCE
┌─────────────┐
│ csv.mnu │ ← Edit this (AutoCAD 2000)
└──────┬──────┘
│
┌─────────────┼─────────────┐
│ AutoCAD │ AutoCAD │ AutoCAD 2006+
│ _menuload │ compiles │ CUIIMPORT
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ csv.mns │ │ csv.mnc │ │ csv.cui │
│ (working │ │ (binary │ │ (XML │
│ copy) │ │ cache) │ │ format) │
└──────────┘ └──────────┘ └──────────┘
│ │
└──────┬──────┘
│
┌────────────┴────────────┐
│ csvmenu.lsp │ ← Loads csv.mnu into AutoCAD
│ (load "csv.mnu") │ Installs CSV.POP1 at position 16
└─────────────────────────┘
Which File Is “Master”?¶
For AutoCAD 2000 (current target): csv.mnu is master.
csv.mns— AutoCAD generates this fromcsv.mnuon first_menuload. It’s nearly identical but may gain a***TOOLBARSsection. Do not edit — AutoCAD overwrites it.csv.mnc— Binary compilation of the menu. AutoCAD generates this automatically. Delete to force recompile from .mns.csv.mnr— Resource file for bitmap icons. ConstructiVision has no custom icons (only 6 bytes), so this is essentially empty.csv.cui— Generated byCUIIMPORTin AutoCAD 2006+. It encodes the same menu tree in XML. AutoCAD 2000 does not read this file.
For future AutoCAD 2006+ targets: csv.cui becomes master, and the .mnu/.mns/.mnc/.mnr files become irrelevant.
Menu Evolution: v3.60 → v11¶
v3.60 Menu (7 items)¶
CSV (POP1)
├── Run Program → arxload csv.arx OR load csv.vlx → csv
├── Program Maintenance → startapp wincss.exe
├── Unload Program → arxunload csv, pcms, pcms2
├── Import Data → load csv → makepan
├── Help → csv.hlp
├── CSV Web Page → constructivision.com
└── About CSV → csv.hlp "About_CSV"
Key characteristics:
Menu title:
&CSV(abbreviated)ARX/VLX dual-load:
(if(< (distof(getvar "acadver")) 15)(arxload "csv.arx")(load "csv.vlx"))— R14 uses ARX, R15+ uses VLXExternal program launch:
wincss.exe(registration manager was a separate Windows executable)No submenus, no layer management, no printing, no viewpoints
v11 Menu (38 macros, 40 click paths)¶
ConstructiVision (POP1)
├── Program Options → progcont=1
├── ──────────────
├── Create New Project → progcont=262153
├── Create New Drawing → progcont=262161
├── Edit Existing Drawing → progcont=262145
├── ──────────────
├── Batch Utilities → progcont=262177
├── ──────────────
├── Change 3D Viewpoint → (10 view commands)
├── ──────────────
├── View Layers →
│ ├── Panel → (6 layer presets)
│ └── Site → (Select Layers dialog)
├── ──────────────
├── Shading → (Off / Hidden / Shaded)
├── ──────────────
├── Print →
│ ├── Panel → (6 print-layer presets + All)
│ └── Site → (Select Layouts dialog)
│ ├── Materials List → progcont=263169
│ └── Revision History → progcont=264193
├── ──────────────
├── Slope Calculator → progcont=8193
├── ──────────────
├── Registration Manager → csvreg (compiled in VLX)
├── ──────────────
├── Help → csv.hlp
├── ConstructiVision Web Page → constructivision.com
├── About ConstructiVision → csv.hlp
└── Tech Support → csvtech (compiled in VLX)
Key changes from v3.60:
Menu title changed:
&CSV→&ConstructiVisionARX loading dropped — VLX only:
(load "csv.vlx")progcontdispatch added — singlecsvcommand routes via integer flagswincss.exereplaced bycsvreg(compiled into VLX)Entire submenu hierarchy added: 3D views, layers, shading, printing
csvtechtech support command added (compiled-only, no source)Layer management via direct AutoCAD commands (
-layer s 0 off * on ...)
Macro Pattern Comparison¶
v3.60 pattern (ARX/VLX dual-load, direct command):
^C^C(setvar "menuecho" 1);(if(not(type c:csv))(if(<(distof(getvar "acadver"))15)(arxload "csv.arx")(load "csv.vlx")));^C^Ccsv;
v11 pattern (VLX-only, progcont dispatch):
^C^C(setvar "menuecho" 1);(setvar "cmdecho" 0);(if(not(type c:csv))(load "csv.vlx"));(setq progcont 262153);csv;
v11 additions:
(setvar "cmdecho" 0)— suppress command echo (cleaner UX)(setq progcont N)— set dispatch flag before callingcsvNo more
^C^Cbetween load and command — semicolons chain instead
The progcont Dispatch Table¶
Most v11 menu items set progcont before calling csv. This integer tells csv.lsp which dialog hub to open. The values are bitmask-based:
Menu Item |
UID |
progcont |
Hex |
Purpose |
|---|---|---|---|---|
Program Options |
|
1 |
|
Program options dialog |
Edit Existing Drawing |
|
262145 |
|
Edit existing + load modules |
Create New Project |
|
262153 |
|
New project dialog |
Create New Drawing |
|
262161 |
|
New drawing dialog |
Batch Utilities |
|
262177 |
|
Batch utilities dialog |
View All Layers |
|
262209 |
|
Turn on all layers |
Select Layers (View) |
|
262273 |
|
Layer selection dialog |
Print All Layers |
|
262465 |
|
Print all layers |
Print (after layer set) |
|
262401 |
|
Print current layer preset |
Select Layouts (Print) |
|
262657 |
|
Print layout selection |
Materials List |
|
263169 |
|
Print materials list |
Revision History |
|
264193 |
|
Print revision history |
Slope Calculator |
|
8193 |
|
Slope calculator dialog |
Warning
Redundancy observation (Feb 23, 2026): Many menu items with different progcont values ultimately route to the same sub-dialogs inside csv.lsp. For example, the 6 “Print → Panel” layer-preset items (ID_PFormLayers, ID_PGreenLayers, ID_PConnLayers, ID_PFeatureLayers, ID_PPointLayers) each set specific layers via -layer commands but then all use progcont=262401 and call csv — which opens the same print dialog. Similarly, the “View Layers → Panel” items manipulate layers directly via AutoCAD commands and never call csv at all (except “All Layers” which uses progcont=262209). This suggests the menu was designed to combine direct AutoCAD commands with CV dialog routing, but the resulting UX has many paths that converge to the same destination — a potential simplification target for modernization.
Bitmask structure (reverse-engineered):
Bit Range |
Mask |
Meaning |
|---|---|---|
Bit 0 |
|
Base “run CSV” flag |
Bits 3–5 |
|
Operation: 1=new project, 2=new drawing, 4=batch |
Bit 6 |
|
View layers |
Bit 7 |
|
Select layers (custom) |
Bit 8 |
|
Print all layers |
Bit 9 |
|
Print select layouts |
Bit 10 |
|
Materials list |
Bit 11 |
|
Revision history |
Bit 13 |
|
Slope calculator |
Bit 18 |
|
“Load modules” flag (present on most items) |
Non-progcont Commands¶
Three menu items bypass progcont and call dedicated commands directly:
Menu Item |
UID |
Command |
Source |
|---|---|---|---|
Registration Manager |
|
|
Compiled-only (inside CSV.VLX, no .lsp source) |
Tech Support |
|
|
Compiled-only (inside CSV.VLX, no .lsp source) |
Help |
|
|
AutoCAD built-in help command |
csvmenu.lsp — The Menu Loader¶
v3.60 Version (20 lines of code)¶
(defun csvmenu()
(if (not (menugroup "CSV"))
(if (or (findfile "csv.arx") (findfile "csv.vlx"))
(progn
(if (findfile "csv.mnu")
(progn
(command "_menuload" "csv.mnu")
(menucmd "P16=+CSV.POP1")
(prompt "\nThe ConstructiVision menu has been installed\n")
)
(prompt "\nThe CSV.MNU file was not found...")
)
)
(prompt "\nThe ConstructiVision program file was not found...")
)
)
)
(csvmenu)
Behavior: Load once only. If CSV menu group exists, skip silently.
v11 Version (key differences)¶
(defun csvmenu (/ msg)
(setvar "filedia" 0)
(if (menugroup "CSV")
(progn
(command "_menuunload" "csv")
(setq msg "The ConstructiVision menu has been reinstalled.")
)
(setq msg "The ConstructiVision menu has been installed.")
)
(if (findfile "csv.mnu")
(progn
(command "_menuload" "csv.mnu")
(menucmd "P16=+CSV.POP1")
(alert msg)
)
(alert "The ConstructiVision menu file was not found...")
)
(setvar "filedia" 1)
)
(csvmenu)
Key changes from v3.60:
Always reloads: If CSV menu group exists, it
_menuunloads first, then reloads. This makes it an “update” mechanism, not just a one-time installer.No ARX/VLX check: Doesn’t verify the program file exists before loading the menu.
Uses
alert(modal dialog box) instead ofprompt(command line message).Disables
filediaduring load to suppress file dialogs, re-enables after.
Tip
The v11 csvmenu.lsp can be used as a hot-reload mechanism during development. After editing csv.mnu, run (load "csvmenu") at the AutoCAD command line to immediately refresh the menu without restarting AutoCAD.
csv.cui — The XML Menu (AutoCAD 2006+)¶
Structure¶
The CUI file is standard XML with this hierarchy:
<CustSection>
<FileVersion MajorVersion="0" MinorVersion="1" IncrementalVersion="3" />
<Header>
<CommonConfiguration>
<Revision MajorVersion="16" MinorVersion="2" /> ← AutoCAD 2006 format
</CommonConfiguration>
</Header>
<MenuGroup Name="CSV">
<MacroGroup Name="CSVMacros"> ← 38 MenuMacro definitions
<MenuMacro UID="ID_CSVRUN">...</MenuMacro>
<MenuMacro UID="ID_CSV8">...</MenuMacro>
...
</MacroGroup>
<MenuRoot>
<PopMenuRoot> ← Pulldown menu tree
<PopMenu UID="ID_Title"> ← Main "ConstructiVision" menu
...nested PopMenuItems and PopMenuRefs...
</PopMenu>
<PopMenu UID="ID_CSV3d"> ← "Change 3D Viewpoint" submenu
<PopMenu UID="ID_CSVLAYER"> ← "View Layers" submenu
<PopMenu UID="PMU_0005"> ← "Panel" (under View Layers)
<PopMenu UID="PMU_0007"> ← "Site" (under View Layers)
<PopMenu UID="ID_CSV8192"> ← "Shading" submenu
<PopMenu UID="ID_CSVPRINT"> ← "Print" submenu
<PopMenu UID="PMU_0011"> ← "Panel" (under Print)
<PopMenu UID="PMU_0013"> ← "Site" (under Print)
</PopMenuRoot>
<ToolbarRoot /> ← Empty (no toolbars defined)
</MenuRoot>
</MenuGroup>
</CustSection>
CUI vs MNU UID Mapping¶
The CUI preserves the same ID_ identifiers from the MNU file, plus adds XML-specific UIDs:
MNU ID |
CUI MacroRef |
CUI PopMenuItem UID |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The CUI also encodes <HelpString> elements from the MNU ***HELPSTRINGS section, and adds <Name xlate="true"> elements with translation UIDs (XLS_####) for localization support.
CUI Generation History¶
The CUI file was generated from the v11 MNU, not authored independently. Evidence:
<Revision MajorVersion="16" MinorVersion="2">— AutoCAD 2006 migration format<Alias>ConstructVision</Alias>— preserves the typo fromcsv.mnu(**ConstructVisionsection header, missing ‘i’)All macro UIDs match the MNU
ID_tags exactlyMenu structure is a 1:1 translation of the MNU
[->/[<-submenu markers
Menu Update Procedure¶
Scenario A: Add/Remove/Edit a Menu Item (AutoCAD 2000 Target)¶
Master file: csv.mnu
Step 1 — Edit csv.mnu
Add a new item. Follow the existing pattern:
;; Adding a new "Concrete Calculator" item after Slope Calculator:
ID_CSVCONC [&Concrete Calculator]^C^C(setvar "menuecho" 1);(setvar "cmdecho" 0);(if(not(type c:csv))(load "csv.vlx"));(setq progcont 16385);csv;
Menu syntax rules:
ID_XXXXX— unique identifier (used in***HELPSTRINGSsection too)[&Label]—&marks the keyboard accelerator letter[->Label]— starts a submenu[<-Label]— last item in a submenu (closes it)[<-<-Label]— closes two nested submenus at once[--]— separator line^C^C— cancel any active command (equivalent to pressing Escape twice)
Step 2 — Add help string (optional)
In the ***HELPSTRINGS section at the bottom of csv.mnu:
ID_CSVCONC [Displays the Concrete Calculator]
Step 3 — Delete derived files
Force AutoCAD to regenerate from the new master:
# On the test VM, delete cached/compiled menu files:
Remove-Item "C:\Program Files\ConstructiVision\csv.mns" -ErrorAction SilentlyContinue
Remove-Item "C:\Program Files\ConstructiVision\csv.mnc" -ErrorAction SilentlyContinue
Remove-Item "C:\Program Files\ConstructiVision\csv.mnr" -ErrorAction SilentlyContinue
Step 4 — Reload menu in AutoCAD
Option A (from command line):
Command: (load "csvmenu")
Option B (manual):
Command: _menuunload csv
Command: _menuload csv.mnu
AutoCAD will regenerate csv.mns, csv.mnc, and csv.mnr automatically from csv.mnu.
Step 5 — If adding a progcont-routed item, update csv.lsp
The new progcont value (e.g., 16385) must be handled in the routing logic inside csv.lsp. Add a new condition branch to the cond statement that dispatches based on progcont.
Step 6 — Update csv.cui (if maintaining forward compatibility)
See Scenario B below. If you’re only targeting AutoCAD 2000, this is optional.
Step 7 — Commit all changed files
git add src/TB11-01x32/csv.mnu src/TB11-01x32/csv.lsp
# Do NOT commit csv.mns/mnc/mnr — they're regenerated on each VM
git commit -m "feat: add Concrete Calculator to CV menu"
Scenario B: Update csv.cui (Modern AutoCAD Target)¶
The CUI file should be regenerated from the MNU whenever the menu changes, to keep the two in sync. There are three approaches:
Approach 1: CUIIMPORT (Recommended)
On an AutoCAD 2006+ installation:
Command: CUIIMPORT
Select csv.mnu. AutoCAD converts it to CUI XML format. Save the resulting csv.cui back to the repo.
Approach 2: Manual XML editing
Add a <MenuMacro> in the <MacroGroup> section and a <PopMenuItem> in the appropriate <PopMenu>. Follow the existing patterns (see CUI structure above). This is tedious but doesn’t require AutoCAD 2006+.
Approach 3: CUI Editor (Interactive)
In AutoCAD 2006+:
Command: CUI
Use the graphical Customize User Interface dialog. The warning at the top of csv.cui (“Do not edit… use the Customize User Interface dialog box”) refers to this tool.
Warning
Never edit csv.cui as master and assume the MNU will follow. The MNU is the source of truth for AutoCAD 2000. If you edit the CUI directly, you must back-port changes to csv.mnu manually, or the AutoCAD 2000 deployment will be out of sync.
Scenario C: Rename a Menu Item¶
Edit the
[&Label]text incsv.mnuEdit the matching
***HELPSTRINGSentryIf maintaining CUI: update the
<Name>and<NameRef>elements incsv.cuiDelete
csv.mns/csv.mnc/csv.mnr, reload
Scenario D: Restructure Submenus¶
This is the most complex change. In csv.mnu:
[->Label]opens a new submenu level[<-Label]closes the current level (must be the last item in that submenu)Submenu markers must balance: every
[->needs a matching[<-
In csv.cui:
Submenus are
<PopMenu>elements referenced via<PopMenuRef>Nesting is structural (XML parent-child), not marker-based
Any submenu restructuring requires changes in both csv.mnu and csv.cui, and the two formats represent nesting very differently. Test thoroughly.
Development Workflow: Menu Changes on Alpha VMs¶
For the current alpha testing cycle (raw .lsp source on VMs):
DEV MACHINE ALPHA VM (108, 201, 202)
┌──────────────────┐ ┌─────────────────────────┐
│ │ │ │
│ 1. Edit csv.mnu │ │ 4. git pull (nightly) │
│ in VS Code │ │ or manual pull │
│ │ │ │
│ 2. Edit csv.lsp │ │ 5. Delete csv.mns/mnc/ │
│ if new │──── git push ────→│ mnr (if cached) │
│ progcont │ │ │
│ │ │ 6. In AutoCAD: │
│ 3. Commit │ │ (load "csvmenu") │
│ │ │ Menu refreshes! │
└──────────────────┘ └─────────────────────────┘
Tip
Quick test: After editing csv.mnu on the dev machine, you can SSH into a VM and manually trigger a git pull + menu reload without waiting for the nightly schedule.
Sync Status: MNU vs CUI¶
The v11 csv.mnu and csv.cui are currently in sync — the CUI was generated from the MNU and no independent edits have been made to either. Evidence:
All 38 macro UIDs match between files
Menu hierarchy is identical (verified against v11 architecture doc’s 40-path tree)
The
**ConstructVisiontypo (missing ‘i’) is preserved in both files as<Alias>ConstructVision</Alias>
Note
The typo ConstructVision (vs ConstructiVision) exists in the MNU section header **ConstructVision and was carried into the CUI <Alias>. The menu title is correct in both: [&ConstructiVision] / <Name>&ConstructiVision</Name>. The alias typo is cosmetic — it only affects AutoLISP (menucmd) addressing and could be fixed in both files simultaneously.
Related Documentation¶
Compilation Architecture — .lsp → .fas → .vlx pipeline
File Types Dictionary — Individual .CUI, .MNC, .MNR, .MNS, .MNU entries
v3.60 Menu File Family — v3.60 MNU vs MNS diff analysis
v3.60 csvmenu.lsp Analysis — v3.60 menu loader code walkthrough
v3.60 Menu Macros — v3.60 MNU macro inventory
v11 Architecture — Menu Structure — Complete 40-path menu tree with dialog routing