Function Syntax: BookmarkEntities Version: 1 Date: 30.11.2025 N/A Description This AutoLISP program defines the command BMEntityPos, which provides a DCL-based bookmark manager for drawing entities. It lets the user pick objects from the drawing, stores their position extents and metadata in a global list, shows them in synchronized list boxes, supports group filtering, lets the user add remarks, and can zoom to the bookmarked location. It also supports saving, loading, and importing the bookmark list as a file in the drawing folder. Primary user workflow - The user runs BMEntityPos. - A dialog opens titled Bookmarked Entity Positions, populated from the current in-memory bookmark list. - The user may click Pick from drawing to select entities and append them as new bookmarks. - The user can select a bookmark row and then use: - Zoom to zoom to the stored window of that bookmarked entity. - Set to write or update a remark for the selected bookmark. - Duplicate to clone the selected bookmark entry in place. - Delete to remove the selected bookmark entry. - The user can restrict what is displayed using the Group filter popup (All, Text, Lines, Polylines, and so on). - The user can Save, Load, or Import bookmark lists from list files. - The user closes the dialog with OK or Cancel. Data model and globals - Bookmarks are stored in the global list *bm-list*. - Each bookmark entry is a 7-item list in the form: - (label startPt endPt colorStr handle etype remark). - Visible list rows are mapped back to original indices using *bm-index-map*, enabling filtering without losing original positions. - The current group filter is stored in *bm-group*, and available groups are stored in *bm-groups* with All always present. Core functionalitiesPick and store bookmarks from the drawing: - Uses ssget to select allowed types: TEXT, MTEXT, LINE, LWPOLYLINE, POLYLINE, CIRCLE, SPLINE, INSERT. - Extracts geometry extents primarily via vla-getboundingbox, and falls back to key DXF points where needed. - Stores both a start point and end point, typically lower-left and upper-right of a bounding box, suitable for zoom window creation. - Captures handle and entity type so the routine can attempt to resolve the entity later using handent. - Captures a color descriptor string based on true color DXF 420 if present, otherwise color index DXF 62, with ByLayer and ByBlock cases handled.Interactive zoom to a bookmarked entity: - Uses a computed zoom window with padding and calls vla-ZoomWindow. - If the stored handle still resolves to an entity, it refreshes bounding box values before zooming to stay accurate after edits.Synchronized list display across four list boxes: - No or Element list, Coordinates list, Color list, and Remark list stay aligned. - Selecting any list box updates the other three to the same index and refreshes the remark field accordingly.Remark management: - Displays the remark of the selected entry in an edit box. - Applies changes using Set, which updates only the remark field within the bookmark entry list.Duplicate and delete entries: - Duplicate inserts a copy of the selected entry immediately after it in the master list. - Delete removes the selected entry from the master list.Group-based filtering: - Automatically derives groups from entity types, such as Text, Lines, Polylines, Circles, Splines, Blocks, and Other. - The popup list is rebuilt each refresh so newly added entity types appear in the filter options. - Filtering affects only what is shown, while preserving underlying list indices through *bm-index-map*.File operations for persistence: - Save: writes the current list to a default file in the drawing folder named [DWG base name]_BMEntityPos.lst. - Load: loads from that default file path and replaces the in-memory list. - Import: prompts for an external list file and replaces the in-memory list with that file contents. - File format is a printed Lisp list written using prin1 and read back using read on the first line of the file.Clear all: resets the list and index map to nil and refreshes the UI. DCL user interface behavior - The DCL definition is written to a temporary file at runtime using vl-filename-mktemp and loaded with load_dialog. - Layout includes four list boxes shown side-by-side (No or Element, Coordinates, Color, Remark) plus a Group filter popup list. - Buttons available: - Pick from drawing, Duplicate, Delete. - Clear, Save, Load, Import. - Zoom, OK, Cancel. - The dialog stays open while most actions occur; picking entities is handled by temporarily closing the dialog with a specific return code and then re-opening it in a loop. Important commands and key internal functions - Entry point command: c:BMEntityPos. - DCL writer: bm-write-dcl. - List refresh and filtering: bm-update-list, bm-build-groups, bm-update-group-popup, bm-pass-filter. - Pick and append: bm-pick-and-store. - Zooming: bm-apply-zoom, bm-make-window, bm-zoom-ll-ur, bm-get-bbox. - Remark operations: bm-update-remark-field, bm-set-remark. - Entry list manipulation: bm-replace-nth, bm-remove-nth, bm-insert-after-nth. - File operations: bm-save-list, bm-load-list, bm-import-list, bm-write-list-to-file, bm-read-list-from-file, bm-file-path. Notable behaviors and edge cases - Handle resolution: zoom attempts to resolve the original entity using handent. If the handle is no longer valid, it falls back to stored coordinates. - Bounding box availability: some objects may fail vla-getboundingbox; the routine uses DXF points as fallback when possible. - Filtering and indexing: visible list indices are not the same as underlying list indices; mapping is maintained explicitly to keep actions correct under filtering. - Save format: only the first line is read on load, so the file must contain the entire printed list on one line to reload correctly. - UI loop design: pick from drawing closes the dialog and re-opens it, enabling selection in the drawing with