Short description
Sort / Purpose:
Bookmark entities in the current drawing and revisit them later by name, coordinates, color, and custom remarks.
• Scope: Lets you pick TEXT, MTEXT, LINE, (LW)POLYLINE, CIRCLE, SPLINE, INSERT (blocks), stores their positions + color, and gives you a manager dialog to zoom to them, duplicate, delete, filter by type, and save/load the list per DWG.
• Goal: Act as a “bookmark manager” for important entities: details, nodes, blocks, texts, etc., so you can quickly navigate and annotate them across work sessions.

Command:
Main Command:
• BMEntityPos – opens the “Bookmarked Entity Positions” dialog, where you manage all stored bookmarks (pick from drawing, zoom, remark, save, load, import, filter).
Description:
Bookmark data structure:
Each bookmark is stored in
Global lists & filters: •
*bm-list* as:
(label startPt endPt colorStr handle etype remark)
• label – friendly name like “TEXT”, “LWPOLYLINE (closed)”, “BLOCK MyBlock”, etc., depending on entity type.
• startPt – a representative start / lower point:
– Lines: start point (10).
– Polylines / splines: start point from vlax-curve-getstartpoint.
– Text / blocks / circles: usually lower bound of the bounding box, fallback to insertion point.
• endPt – usually upper bound of the bounding box, used to define a zoom window.
• colorStr – color info as text:
– If TrueColor (DXF 420) exists: "TC:<integer>".
– Otherwise: ByLayer / ByBlock / ACI number.
• handle – entity handle (DXF 5) used later to find the live entity with handent.
• etype – DXF type string (“TEXT”, “MTEXT”, “LINE”, “LWPOLYLINE”, “POLYLINE”, “CIRCLE”, “SPLINE”, “INSERT”).
• remark – user-defined comment, stored as simple string.Global lists & filters: •
*bm-list* – the full bookmark collection for the current session/drawing.
• *bm-index-map* – maps visible row index in the dialog to the real index in *bm-list* (used when group-filtering so operations affect the correct entry).
• *bm-group* – current group filter: “All”, “Text”, “Lines”, “Polylines”, “Circles”, “Splines”, “Blocks”, “Other”.
• *bm-groups* – complete list of group labels, always starting with “All”. Built dynamically from current bookmark content.
Helper function: (if any)
Picking & storing bookmarks:
• Button “Pick from drawing” calls
Group / filter system: •
Dialog listboxes & synchronization: • Columns are separate list boxes: – No / Element (
Zoom to bookmark: • Button “Zoom” calls
Remarks: • The edit box “Remark” lets you attach a free-text comment to the selected bookmark. •
Duplicate / Delete / Clear: • Duplicate – inserts a copy of the selected entry immediately after it in
Save / Load / Import (per-DWG persistence): • Automatic default file path:
bm-pick-and-store which:
– Uses ssget with filter (0 . "TEXT,MTEXT,LINE,LWPOLYLINE,POLYLINE,CIRCLE,SPLINE,INSERT").
– For each entity, determines:
• Label – e.g. “TEXT”, “LWPOLYLINE (closed)”, “3D POLYLINE”, “BLOCK MyBlock”.
• Representative start/end points via bounding box or geometry.
• Color string via bm-color-string (TrueColor/aci/ByLayer/ByBlock).
• Handle and entity type.
– Creates an entry with empty remark "" and appends it to *bm-list*.Group / filter system: •
bm-entry-group maps entity type to a group name:
– TEXT/MTEXT → “Text”.
– LINE → “Lines”.
– (LW)POLYLINE → “Polylines”.
– CIRCLE → “Circles”.
– SPLINE → “Splines”.
– INSERT → “Blocks”.
– Others → “Other”.
• bm-build-groups scans *bm-list* and builds *bm-groups* = ("All" ... unique group names ...).
• The popup “Group” in the dialog is filled from *bm-groups*; changing it updates *bm-group* and refreshes the list.
• bm-pass-filter ensures only entries matching the selected group (or All) are shown.Dialog listboxes & synchronization: • Columns are separate list boxes: – No / Element (
lb_elem) – row number + label.
– Coordinates (lb_coord) – bookmark start point as “X,Y,Z” (formatted using current LUPREC).
– Color (lb_color).
– Remark (lb_rem).
• bm-update-list rebuilds these four list boxes from *bm-list* + current group filter, and rebuilds *bm-index-map* for “visible index → real index” translation.
• Selecting in any of the list boxes forces all other list boxes to the same index and runs bm-on-select (which updates the Remark edit box).Zoom to bookmark: • Button “Zoom” calls
bm-apply-zoom:
– Uses selected row in lb_elem to get visible index, then real index via *bm-index-map*, then fetches entry from *bm-list*.
– Attempts to resolve the current entity by handle using handent. If found, recomputes the bounding box for an up-to-date zoom window (even if the object has moved). If not found, falls back to stored start/end points.
– bm-make-window builds a padded window around those two points (5% margin).
– Calls bm-zoom-ll-ur, which uses vla-ZoomWindow to actually zoom the current view.Remarks: • The edit box “Remark” lets you attach a free-text comment to the selected bookmark. •
bm-update-remark-field fills the edit box when you change selection.
• Button “Set” calls bm-set-remark which:
– Reads the current remark text.
– Updates the corresponding entry in *bm-list* (using bm-replace-nth).
– Rebuilds the lists and re-selects the same visible row so the UI stays in sync.Duplicate / Delete / Clear: • Duplicate – inserts a copy of the selected entry immediately after it in
*bm-list* via bm-insert-after-nth, then refreshes the UI.
• Delete – removes the selected entry from *bm-list* via bm-remove-nth and clears the remark field.
• Clear – empties *bm-list* and *bm-index-map* in one shot and refreshes all list boxes.Save / Load / Import (per-DWG persistence): • Automatic default file path:
DWGPREFIX + (vl-filename-base DWGNAME) + "_BMEntityPos.lst".
– This means each drawing can have its own bookmark list stored right next to the DWG (same prefix, custom suffix).
• Save – bm-save-list:
– Writes *bm-list* as a single LISP-readable expression into the default file (using prin1).
– Notifies with the path on success; warns if there’s nothing to save.
• Load – bm-load-list:
– Reads from the default per-DWG file, validates that it’s a list, assigns it to *bm-list*, and updates the dialog.
• Import – bm-import-list:
– Uses getfiled to let you choose any .lst file containing a bookmark list.
– On success, replaces current *bm-list* with the imported content and updates the dialog, with a path confirmation message.
Functionalities:
Picking & storing bookmarks:
• Button “Pick from drawing” calls
Group / filter system: •
Dialog listboxes & synchronization: • Columns are separate list boxes: – No / Element (
Zoom to bookmark: • Button “Zoom” calls
Remarks: • The edit box “Remark” lets you attach a free-text comment to the selected bookmark. •
Duplicate / Delete / Clear: • Duplicate – inserts a copy of the selected entry immediately after it in
Save / Load / Import (per-DWG persistence): • Automatic default file path:
bm-pick-and-store which:
– Uses ssget with filter (0 . "TEXT,MTEXT,LINE,LWPOLYLINE,POLYLINE,CIRCLE,SPLINE,INSERT").
– For each entity, determines:
• Label – e.g. “TEXT”, “LWPOLYLINE (closed)”, “3D POLYLINE”, “BLOCK MyBlock”.
• Representative start/end points via bounding box or geometry.
• Color string via bm-color-string (TrueColor/aci/ByLayer/ByBlock).
• Handle and entity type.
– Creates an entry with empty remark "" and appends it to *bm-list*.Group / filter system: •
bm-entry-group maps entity type to a group name:
– TEXT/MTEXT → “Text”.
– LINE → “Lines”.
– (LW)POLYLINE → “Polylines”.
– CIRCLE → “Circles”.
– SPLINE → “Splines”.
– INSERT → “Blocks”.
– Others → “Other”.
• bm-build-groups scans *bm-list* and builds *bm-groups* = ("All" ... unique group names ...).
• The popup “Group” in the dialog is filled from *bm-groups*; changing it updates *bm-group* and refreshes the list.
• bm-pass-filter ensures only entries matching the selected group (or All) are shown.Dialog listboxes & synchronization: • Columns are separate list boxes: – No / Element (
lb_elem) – row number + label.
– Coordinates (lb_coord) – bookmark start point as “X,Y,Z” (formatted using current LUPREC).
– Color (lb_color).
– Remark (lb_rem).
• bm-update-list rebuilds these four list boxes from *bm-list* + current group filter, and rebuilds *bm-index-map* for “visible index → real index” translation.
• Selecting in any of the list boxes forces all other list boxes to the same index and runs bm-on-select (which updates the Remark edit box).Zoom to bookmark: • Button “Zoom” calls
bm-apply-zoom:
– Uses selected row in lb_elem to get visible index, then real index via *bm-index-map*, then fetches entry from *bm-list*.
– Attempts to resolve the current entity by handle using handent. If found, recomputes the bounding box for an up-to-date zoom window (even if the object has moved). If not found, falls back to stored start/end points.
– bm-make-window builds a padded window around those two points (5% margin).
– Calls bm-zoom-ll-ur, which uses vla-ZoomWindow to actually zoom the current view.Remarks: • The edit box “Remark” lets you attach a free-text comment to the selected bookmark. •
bm-update-remark-field fills the edit box when you change selection.
• Button “Set” calls bm-set-remark which:
– Reads the current remark text.
– Updates the corresponding entry in *bm-list* (using bm-replace-nth).
– Rebuilds the lists and re-selects the same visible row so the UI stays in sync.Duplicate / Delete / Clear: • Duplicate – inserts a copy of the selected entry immediately after it in
*bm-list* via bm-insert-after-nth, then refreshes the UI.
• Delete – removes the selected entry from *bm-list* via bm-remove-nth and clears the remark field.
• Clear – empties *bm-list* and *bm-index-map* in one shot and refreshes all list boxes.Save / Load / Import (per-DWG persistence): • Automatic default file path:
DWGPREFIX + (vl-filename-base DWGNAME) + "_BMEntityPos.lst".
– This means each drawing can have its own bookmark list stored right next to the DWG (same prefix, custom suffix).
• Save – bm-save-list:
– Writes *bm-list* as a single LISP-readable expression into the default file (using prin1).
– Notifies with the path on success; warns if there’s nothing to save.
• Load – bm-load-list:
– Reads from the default per-DWG file, validates that it’s a list, assigns it to *bm-list*, and updates the dialog.
• Import – bm-import-list:
– Uses getfiled to let you choose any .lst file containing a bookmark list.
– On success, replaces current *bm-list* with the imported content and updates the dialog, with a path confirmation message.
Result:
Result / Usage summary:
1. Run BMEntityPos.
2. Click “Pick from drawing”, select entities; they appear in the grid with number, type, coordinates, color, and remark column.
3. Optionally assign per-bookmark remarks (e.g., “Detail A – top left node”, “Valve 12”, etc.).
4. Use “Group” filter to quickly narrow down to Text, Polylines, Blocks…
5. Use “Zoom” to jump directly to the stored object; the tool tries to use the current geometry via handle so it works even if things moved.
6. Save the list (per drawing) and later “Load” or “Import” it again to restore your navigation points in future sessions.
In short, BMEntityPos is a lightweight bookmark & navigation manager for key entities in your DWG, complete with grouping, remarks, zooming, and per-file persistence.
In short, BMEntityPos is a lightweight bookmark & navigation manager for key entities in your DWG, complete with grouping, remarks, zooming, and per-file persistence.
Images, animations etc.
Log in to download.
Log in
Log in
XAML code:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
<src:RibbonToolTip x:Key="BookmarkEntities">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: BookmarkEntities</Bold>
<LineBreak/>
<Bold>Version: 1 Date: 30.11.2025</Bold>
<LineBreak/>
<LineBreak/>
<Hyperlink>N/A</Hyperlink>
<LineBreak/>
<Bold>Description</Bold><LineBreak/>
This AutoLISP program defines the command <Run Foreground="Red">BMEntityPos</Run>, which provides a DCL-based bookmark manager for drawing entities. It lets the user <Run Foreground="DarkRed">pick objects from the drawing</Run>, stores their position extents and metadata in a global list, shows them in synchronized list boxes, supports <Run Foreground="DarkRed">group filtering</Run>, lets the user add remarks, and can <Run Foreground="DarkRed">zoom to the bookmarked location</Run>. It also supports <Run Foreground="DarkRed">saving</Run>, <Run Foreground="DarkRed">loading</Run>, and <Run Foreground="DarkRed">importing</Run> the bookmark list as a file in the drawing folder.<LineBreak/>
<LineBreak/>
<Bold>Primary user workflow</Bold><LineBreak/>
- The user runs <Run Foreground="Red">BMEntityPos</Run>.<LineBreak/>
- A dialog opens titled Bookmarked Entity Positions, populated from the current in-memory bookmark list.<LineBreak/>
- The user may click <Run Foreground="Red">Pick from drawing</Run> to select entities and append them as new bookmarks.<LineBreak/>
- The user can select a bookmark row and then use:<LineBreak/>
- <Run Foreground="Red">Zoom</Run> to zoom to the stored window of that bookmarked entity.<LineBreak/>
- <Run Foreground="Red">Set</Run> to write or update a remark for the selected bookmark.<LineBreak/>
- <Run Foreground="Red">Duplicate</Run> to clone the selected bookmark entry in place.<LineBreak/>
- <Run Foreground="Red">Delete</Run> to remove the selected bookmark entry.<LineBreak/>
- The user can restrict what is displayed using the <Run Foreground="DarkRed">Group filter</Run> popup (All, Text, Lines, Polylines, and so on).<LineBreak/>
- The user can <Run Foreground="Red">Save</Run>, <Run Foreground="Red">Load</Run>, or <Run Foreground="Red">Import</Run> bookmark lists from list files.<LineBreak/>
- The user closes the dialog with <Run Foreground="Red">OK</Run> or <Run Foreground="Red">Cancel</Run>.<LineBreak/>
<LineBreak/>
<Bold>Data model and globals</Bold><LineBreak/>
- Bookmarks are stored in the global list <Run Foreground="DarkRed">*bm-list*</Run>.<LineBreak/>
- Each bookmark entry is a 7-item list in the form:<LineBreak/>
- <Run Foreground="DarkRed">(label startPt endPt colorStr handle etype remark)</Run>.<LineBreak/>
- Visible list rows are mapped back to original indices using <Run Foreground="DarkRed">*bm-index-map*</Run>, enabling filtering without losing original positions.<LineBreak/>
- The current group filter is stored in <Run Foreground="DarkRed">*bm-group*</Run>, and available groups are stored in <Run Foreground="DarkRed">*bm-groups*</Run> with All always present.<LineBreak/>
<LineBreak/>
<Bold>Core functionalities</Bold><LineBreak/>
• <Run Foreground="DarkRed">Pick and store bookmarks from the drawing</Run>:<LineBreak/>
- Uses <Run Foreground="Red">ssget</Run> to select allowed types: TEXT, MTEXT, LINE, LWPOLYLINE, POLYLINE, CIRCLE, SPLINE, INSERT.<LineBreak/>
- Extracts geometry extents primarily via <Run Foreground="Red">vla-getboundingbox</Run>, and falls back to key DXF points where needed.<LineBreak/>
- Stores both a start point and end point, typically lower-left and upper-right of a bounding box, suitable for zoom window creation.<LineBreak/>
- Captures handle and entity type so the routine can attempt to resolve the entity later using <Run Foreground="Red">handent</Run>.<LineBreak/>
- Captures a color descriptor string based on true color <Run Foreground="DarkRed">DXF 420</Run> if present, otherwise color index <Run Foreground="DarkRed">DXF 62</Run>, with ByLayer and ByBlock cases handled.<LineBreak/>
• <Run Foreground="DarkRed">Interactive zoom to a bookmarked entity</Run>:<LineBreak/>
- Uses a computed zoom window with padding and calls <Run Foreground="Red">vla-ZoomWindow</Run>.<LineBreak/>
- If the stored handle still resolves to an entity, it refreshes bounding box values before zooming to stay accurate after edits.<LineBreak/>
• <Run Foreground="DarkRed">Synchronized list display</Run> across four list boxes:<LineBreak/>
- No or Element list, Coordinates list, Color list, and Remark list stay aligned.<LineBreak/>
- Selecting any list box updates the other three to the same index and refreshes the remark field accordingly.<LineBreak/>
• <Run Foreground="DarkRed">Remark management</Run>:<LineBreak/>
- Displays the remark of the selected entry in an edit box.<LineBreak/>
- Applies changes using <Run Foreground="Red">Set</Run>, which updates only the remark field within the bookmark entry list.<LineBreak/>
• <Run Foreground="DarkRed">Duplicate and delete entries</Run>:<LineBreak/>
- Duplicate inserts a copy of the selected entry immediately after it in the master list.<LineBreak/>
- Delete removes the selected entry from the master list.<LineBreak/>
• <Run Foreground="DarkRed">Group-based filtering</Run>:<LineBreak/>
- Automatically derives groups from entity types, such as Text, Lines, Polylines, Circles, Splines, Blocks, and Other.<LineBreak/>
- The popup list is rebuilt each refresh so newly added entity types appear in the filter options.<LineBreak/>
- Filtering affects only what is shown, while preserving underlying list indices through <Run Foreground="DarkRed">*bm-index-map*</Run>.<LineBreak/>
• <Run Foreground="DarkRed">File operations for persistence</Run>:<LineBreak/>
- <Run Foreground="Red">Save</Run>: writes the current list to a default file in the drawing folder named <Run Foreground="DarkRed">[DWG base name]_BMEntityPos.lst</Run>.<LineBreak/>
- <Run Foreground="Red">Load</Run>: loads from that default file path and replaces the in-memory list.<LineBreak/>
- <Run Foreground="Red">Import</Run>: prompts for an external list file and replaces the in-memory list with that file contents.<LineBreak/>
- File format is a printed Lisp list written using <Run Foreground="Red">prin1</Run> and read back using <Run Foreground="Red">read</Run> on the first line of the file.<LineBreak/>
• <Run Foreground="DarkRed">Clear all</Run>: resets the list and index map to nil and refreshes the UI.<LineBreak/>
<LineBreak/>
<Bold>DCL user interface behavior</Bold><LineBreak/>
- The DCL definition is written to a temporary file at runtime using <Run Foreground="Red">vl-filename-mktemp</Run> and loaded with <Run Foreground="Red">load_dialog</Run>.<LineBreak/>
- Layout includes four list boxes shown side-by-side (No or Element, Coordinates, Color, Remark) plus a Group filter popup list.<LineBreak/>
- Buttons available:<LineBreak/>
- <Run Foreground="Red">Pick from drawing</Run>, <Run Foreground="Red">Duplicate</Run>, <Run Foreground="Red">Delete</Run>.<LineBreak/>
- <Run Foreground="Red">Clear</Run>, <Run Foreground="Red">Save</Run>, <Run Foreground="Red">Load</Run>, <Run Foreground="Red">Import</Run>.<LineBreak/>
- <Run Foreground="Red">Zoom</Run>, <Run Foreground="Red">OK</Run>, <Run Foreground="Red">Cancel</Run>.<LineBreak/>
- 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.<LineBreak/>
<LineBreak/>
<Bold>Important commands and key internal functions</Bold><LineBreak/>
- Entry point command: <Run Foreground="Red">c:BMEntityPos</Run>.<LineBreak/>
- DCL writer: <Run Foreground="Red">bm-write-dcl</Run>.<LineBreak/>
- List refresh and filtering: <Run Foreground="Red">bm-update-list</Run>, <Run Foreground="Red">bm-build-groups</Run>, <Run Foreground="Red">bm-update-group-popup</Run>, <Run Foreground="Red">bm-pass-filter</Run>.<LineBreak/>
- Pick and append: <Run Foreground="Red">bm-pick-and-store</Run>.<LineBreak/>
- Zooming: <Run Foreground="Red">bm-apply-zoom</Run>, <Run Foreground="Red">bm-make-window</Run>, <Run Foreground="Red">bm-zoom-ll-ur</Run>, <Run Foreground="Red">bm-get-bbox</Run>.<LineBreak/>
- Remark operations: <Run Foreground="Red">bm-update-remark-field</Run>, <Run Foreground="Red">bm-set-remark</Run>.<LineBreak/>
- Entry list manipulation: <Run Foreground="Red">bm-replace-nth</Run>, <Run Foreground="Red">bm-remove-nth</Run>, <Run Foreground="Red">bm-insert-after-nth</Run>.<LineBreak/>
- File operations: <Run Foreground="Red">bm-save-list</Run>, <Run Foreground="Red">bm-load-list</Run>, <Run Foreground="Red">bm-import-list</Run>, <Run Foreground="Red">bm-write-list-to-file</Run>, <Run Foreground="Red">bm-read-list-from-file</Run>, <Run Foreground="Red">bm-file-path</Run>.<LineBreak/>
<LineBreak/>
<Bold>Notable behaviors and edge cases</Bold><LineBreak/>
- <Run Foreground="DarkRed">Handle resolution</Run>: zoom attempts to resolve the original entity using <Run Foreground="Red">handent</Run>. If the handle is no longer valid, it falls back to stored coordinates.<LineBreak/>
- <Run Foreground="DarkRed">Bounding box availability</Run>: some objects may fail vla-getboundingbox; the routine uses DXF points as fallback when possible.<LineBreak/>
- <Run Foreground="DarkRed">Filtering and indexing</Run>: visible list indices are not the same as underlying list indices; mapping is maintained explicitly to keep actions correct under filtering.<LineBreak/>
- <Run Foreground="DarkRed">Save format</Run>: only the first line is read on load, so the file must contain the entire printed list on one line to reload correctly.<LineBreak/>
- <Run Foreground="DarkRed">UI loop design</Run>: pick from drawing closes the dialog and re-opens it, enabling selection in the drawing with
</TextBlock>
<Grid>
<Image Source="PNG" Stretch="Uniform"/>
</Grid>
<Grid>
<MediaElement
Source="GIF"
Stretch="Uniform"
Visibility="Visible"/>
</Grid>
</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>
Additional info:
Learn more:
Open Website
Share this page:
Subscribe
Login
0 Comments
Oldest
Tags: 🏷️ Autocad Lisps, 🏷️ Bookmark_menu
Tags: 🏷️ Autocad Lisps, 🏷️ Bookmark_menu
