Purge, units and window

Command: CAPCAD_PURGE, CAPCAD_UNITS_FIX, CAPCAD_VIEW_RECTANGLE, CAPCAD_WINDOW_EXPAND Updated 2026-09-03 Also in: Português
Ask about this page
Answers from this page only. General assistant
Commands CAPCAD_PURGE (deep purge) · CAPCAD_UNITS_FIX (normalise units) · CAPCAD_VIEW_RECTANGLE (view rectangle) · CAPCAD_WINDOW_EXPAND (expand the window)
Shortcuts none. PU is not a shortcut for CAPCAD_PURGE — in CapCad's acad.pgp, PU and -PU point at the CAD's own PURGE
Ribbon CapCad tab › CAD Utilities panel › Tools split button › PowerPurge (CAPCAD_PURGE); in the same panel, Layout split button › FixScale (CAPCAD_UNITS_FIX), Screen Rectangle (CAPCAD_VIEW_RECTANGLE) and CAD Window Expand (CAPCAD_WINDOW_EXPAND)
Category NEW
Forms none. All four run straight through, with no window and no selection
Hosts AutoCAD and Civil 3D only. On ARES Commander the four names are registered as coming soon and answer with a notice; on BricsCAD, GstarCAD and ZWCAD they do not exist

Four one-click commands for the work nobody wants to do by hand. These are the maintenance chores every signing drawing needs and that, in the bare CAD, take long sequences of typed options.

  • Several passes, not one. The CAD's PURGE leaves remains: whatever only becomes unreferenced after something else has been erased. CAPCAD_PURGE repeats the sweep, with an audit in the middle, until nothing is left.
  • Categories the CAD's dialog hides. Registered applications, orphaned data, empty text objects and zero-length geometry go into the same pass.
  • Units set once and never again. CAPCAD_UNITS_FIX marks the drawing after it runs, and the mark travels with the file — reopening, copying or sending it to someone else will not make the command run again.
  • The view becomes geometry. CAPCAD_VIEW_RECTANGLE draws exactly the window you are looking at — the quickest way to mark a crop for a sheet or an image.
  • Two screens become one drawing board. CAPCAD_WINDOW_EXPAND stretches the CAD window across every monitor, leaving the layout tabs visible.

What it does

Command What it does What it needs
CAPCAD_PURGE Chains several passes of the CAD's -PURGE with an AUDIT in the middle nothing
CAPCAD_UNITS_FIX Normalises the drawing's units through -DWGUNITS, once per file Express Tools installed
CAPCAD_VIEW_RECTANGLE Draws the current view's window as a closed polyline in model space nothing
CAPCAD_WINDOW_EXPAND Toggles between maximising the CAD window and stretching it across every monitor nothing

None of the four opens a form, asks for a selection or puts a question. They are meant to become ribbon buttons and be clicked without thinking.

CAPCAD_PURGE — the deep purge

The CAD's PURGE clears what is unused at that instant. If a block was the only user of a given text style, erasing the block does not free the style in the same pass: it only shows up as "unused" on the next one. That is why serious purging is always repeated.

CAPCAD_PURGE does that repetition for you, in this order:

  1. -PURGE of registered applications (R), accepting every name and confirming none individually.
  2. -PURGE of orphaned data (O).
  3. -PURGE of empty text objects (E).
  4. -PURGE of zero-length geometry (Z).
  5. -PURGE of everything (A), all names, no confirmation.
  6. AUDIT, answering yes to fixing the errors it finds.
  7. Two more passes of -PURGE of everything.

The seven steps are queued at once as keystrokes for the command line. You watch each -PURGE scroll past on the command line, one after another.

What the command does not do: it does not save the drawing, it does not report the file size before and after, and it does not purge Civil 3D styles.

CAPCAD_UNITS_FIX — normalising the units

Drawings that have passed through several hands arrive with the wrong INSUNITS, and every block inserted afterwards comes in at the wrong scale. CAPCAD_UNITS_FIX runs -DWGUNITS (from Express Tools) with fixed answers to settle it once.

The unit chosen comes from the drawing's current INSUNITS:

Drawing's INSUNITS Unit applied
inches inches
feet feet
anything else, undefined included metres

After the unit, the command answers -DWGUNITS with the fixed sequence 2, 3, n, y, n: the first two set the unit display precision and the area precision; the last three say no to scaling objects inserted from other drawings, yes to matching INSUNITS to the chosen unit, and no to scaling what is already in the drawing. In other words: the drawing's unit is declared, but nothing is rescaled.

Once per drawing

When it finishes, the command writes the fixscale mark into the drawing's own capcad dictionary. From the second run onwards the command exits silently, running nothing. Because the mark lives inside the file, it survives saving, reopening and sending the .dwg to someone else.

CAPCAD_VIEW_RECTANGLE — the view rectangle

Draws a closed four-vertex polyline coincident with the window you are looking at: centre of the current view, view width and view height. It is born in model space, on the current layer and with the current colour — there is no layer of its own and nothing is locked.

It is for marking a crop (the frame that will become a viewport, an image or a detail) without measuring anything. The rectangle is the screen window, not the drawing extents: change the zoom and run it again for a different size.

CAPCAD_WINDOW_EXPAND — expanding the CAD window

It is a toggle:

  • Window not maximised → maximise it.
  • Window already maximised → restore it and stretch it over the whole area of every monitor, with the height cut by 30 px so the layout tabs stay visible.

Running it twice in a row takes the window from maximised to stretched; the third time maximises it again.

What is kept between sessions

  • CAPCAD_UNITS_FIX keeps the fixscale mark inside the drawing, in the capcad dictionary.
  • The other three keep nothing, neither in the user preferences nor in the drawing.

Notes

  • PU is the CAD's own PURGE. CapCad's acad.pgp points PU and -PU at the native commands. For the deep purge, type the full name or use the PowerPurge button on the ribbon.
  • The message Purged. appears before the purging happens. The -PURGE keystrokes are queued for the command line while the message is written immediately, so it comes out first. Wait for the passes to finish on the command line before judging the result.
  • CAPCAD_PURGE really does delete unused definitions. Blocks kept "for later", empty layers and spare text styles disappear. In a library or template drawing, that is not what you want.
  • CAPCAD_UNITS_FIX rescales nothing. It declares the unit and matches INSUNITS; the geometry stays the size it was. If the drawing is at the wrong scale, this is not the command.
  • Without Express Tools, CAPCAD_UNITS_FIX has nothing to call — and cannot be retried. -DWGUNITS is an AutoCAD Express Tools command; on an installation without it the call fails on the command line, and the fixscale mark is written anyway. The second attempt then exits silently. In that case, fix INSUNITS through the CAD itself.
  • To run CAPCAD_UNITS_FIX again on the same drawing there is no button: the fixscale mark would have to be deleted from the file's capcad dictionary.
  • CAPCAD_VIEW_RECTANGLE always writes into model space. It reads the current view — the paper-space view included — and appends the rectangle to model space regardless of which space you are in. Run with a layout active, the rectangle lands in model space carrying the sheet's coordinates. Use it with model space active.
  • The rectangle comes out on the current layer. If you want the crop kept apart, change the current layer first — the command chooses no layer at all.
  • CAPCAD_WINDOW_EXPAND uses the virtual screen area. On sets of monitors with different display scales, the stretched window may not coincide exactly with the physical edges.
  • On the other CADs. On ARES Commander the four commands exist only as a "not available yet" notice. On BricsCAD, GstarCAD and ZWCAD they do not exist: typing the name returns unknown command.

See also