NamedViewList

Short description

Purpose: Provide a portable, dialog-based manager for AutoCAD named views with filtering, zoom, rename, delete, and restore capabilities Scope: Works entirely on named views in the current drawing using only basic AutoLISP, ActiveX, and a temporary DCL file Interaction style: Single dialog with live filter, match-case toggle, multi-select list, and action buttons that keep the dialog open for iterative operations
namedviewlist 001

Command:

Command: NamedViewList Execution: Type NamedViewList and press Enter Dialog title: Select Named View Main controls: • Filter text box (live updates list) • Match case toggle • Clear button for the filter • Multi-select list of named views • Count label showing “X of Y views” • OK, Zoom, Delete, Cancel buttons Close behavior: Only OK or Cancel close the dialog; Zoom and Delete keep it open

Description:

The routine collects all named views from the current drawing, sorts them case-insensitively, and displays them in a list box with live filtering and optional case-sensitive matching. The user can select one or more views, zoom to a selected view without closing the dialog, delete one or several views in-place, or accept the selection with OK to restore multiple views sequentially after the dialog closes. It uses a temporary DCL file written on the fly, portable string and list helpers (no reliance on external libraries), and cleans up the dialog and temp file on exit or error.

Helper function: (if any)​

NVL-len — Wrapper for strlen to get string lengthNVL-up — Uppercases strings using strcase for case-insensitive operationsNVL-trim — Trims leading and trailing spaces from a string without using vl-string-trimNVL-strcmp — Lexicographic string compare (case-sensitive) returning -1, 0, or 1NVL-cicmp — Case-insensitive comparator built on NVL-strcmp and NVL-upNVL-sort — Insertion sort utility that sorts a list using a comparator function symbolNVL-filter — Filters a list by predicate function symbol, returning only items that matchNVL-pos — Returns zero-based index of an item in a list or nil if not foundNVL-any — Returns T if any element in a list satisfies the predicate functionNVL-replace-char — Replaces all occurrences of one character in a string with anotherNVL-parse-indexes — Converts list_box selection string (space/comma separated) into a list of integersNVL-del-view — Safely deletes a named view by name via ActiveX (vla-item / vla-delete)NVL-zoom-view — Zooms to a named view using Document.ActiveViewport.SetView and reapplies viewportNVL-fill-list — Populates the list_box with the current filtered view list and updates the count labelNVL-apply-filter — Applies the current filter text and case-match setting to update viewFiltered and the UINVL-rename-at-index — Renames a view at a specific filtered index, checks for name conflicts, runs RENAME, and refreshes lists*error* — Global error handler that reports errors (except cancel/exit), unloads dialog, deletes temp DCL, and exits cleanly

Functionalities:

Automatic view collection — Reads all named views from the current drawing and sorts them case-insensitivelyLive filtering — As you type in the Filter box, the list updates instantly using wildcard matchingCase sensitivity toggle — “Match case” toggle switches between case-sensitive and case-insensitive filtersMulti-selection — The list box allows multiple view selection and stores indices for later operationsInline rename — Double-clicking a view in the list triggers a rename prompt and live update of the sorted view listIn-place delete — The Delete button removes selected views via ActiveX and refreshes the filtered and full lists without closing the dialogZoom without closing — The Zoom button switches to the first selected view while the dialog remains open for further navigationBatch restore — After clicking OK, each selected view is restored in sequence using the -VIEW _R commandTemporary DCL management — Writes a compact DCL definition to a temp file, loads it, then deletes it after dialog use or errorPortable implementation — Avoids reliance on higher-level vl-string or float flags and uses only explicit helper functions for portability

Result:

View navigation — User can quickly find and zoom to any named view using filter and zoom without leaving the dialogClean view list — Unwanted views can be deleted directly from the interface, keeping the named view list organizedConsistent naming — Views can be renamed in-place with conflict checks, ensuring unique namesBatch restore — Selected views are restored after OK, enabling quick cycling or setup of multiple views in one runNon-destructive settings — Aside from view edits, no drawing geometry is modified, and all temporary UI artifacts are cleaned up

Images, animations etc.

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: Bookmark
Tags: Bookmark
0
Would love your thoughts, please comment.x
()
x