LockAllVp

Short description

Tags: Layouts, Paper Space, Viewports, DCL, Dialog_UI, Lisp, CAD, Clipboard Suggested tags not in list: ObjectARX, COM_Automation, Stability, Undo_Stack
lockallvp 000

Command:

  • LOCKALLVP Open the dialog to lock or unlock viewports in selected layouts.
  • LockAllVp Alias command to run the same dialog workflow.
  • _LOCKALLVP Underscore alias for macro use.

Description:

  • This tool provides a DCL dialog to manage viewport locking by layout, with multi-select layout targeting and per-layout status display.
  • It is designed to avoid ARX/DCL callback crashes by not running fragile command sequences from dialog callbacks and by applying changes using safer mechanisms where possible.
  • The list shows each layout name and a computed status: Locked, Unlocked, Mixed, or NoVP.
  • After clicking Lock or Unlock, the dialog should refresh the list so the status reflects the new state immediately.

Helper function: (if any)​

  • Unique DCL name Generates a different dialog name each run to avoid conflicts with cached dialogs.
  • DCL writer Writes the DCL definition to a temporary file and loads it at runtime, then deletes it on exit.
  • Layout collector Builds the layout list (optionally including Model) and applies wildcard filtering using * and ?.
  • Viewport scanner Detects Paper Space viewports per layout and determines whether they are locked, unlocked, mixed, or missing.
  • Undo stack Stores changes per operation so Undo can revert the last Lock or Unlock action without calling AutoCAD UNDO from DCL callbacks.
  • Clipboard copy Copies selected layout names (and their status text) to the Windows clipboard, one line per layout.

Functionalities:

  • Filter layouts using wildcard patterns (*, ?) and click Apply to rebuild the displayed list.
  • Multi-select layouts from the list for batch processing.
  • Select All and Select None for fast selection control.
  • Lock all detected Paper Space viewports in the selected layouts.
  • Unlock all detected Paper Space viewports in the selected layouts.
  • • Show per-layout current status (Locked / Unlocked / Mixed / NoVP) so the user can validate before and after changes.
  • Undo the last operation (and potentially multiple operations) using an internal restore stack, avoiding unstable undo calls inside the dialog.
  • Copy to Clipboard selected layout names and status for documentation or reporting.
  • • Preserve user environment by restoring CTAB and minimizing command echo during processing.

Result:

  • The selected layouts will have their Paper Space viewports set to Locked or Unlocked according to the chosen action.
  • The dialog list updates to reflect the new per-layout status immediately after Lock or Unlock.
  • Users can export the selected layout list (with status) via Copy to Clipboard for external use.

Images, animations etc.

lockallvp 000
lockallvp 001
lockallvp 002
lockallvp 003
lockallvp 004
Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Tags: CAD, Clipboard, DCL, Dialog_UI, Layouts, Lisp, Paper Space, Viewports
0
Would love your thoughts, please comment.x
()
x