Short description
๐ BMEntityPos is an SEO-friendly AutoCAD AutoLISP and DCL bookmark manager for saving, filtering, and revisiting important drawing entity positions.
It helps CAD users pick drawing objects, store their bounding box coordinates, add remarks, organize bookmarks by entity group, and zoom back to saved locations inside the DWG.
The main benefit is faster drawing navigation, better object tracking, cleaner review workflows, and improved AutoCAD and Civil 3D productivity for large production drawings.
Command:
๐งฐ Load the AutoLISP file with APPLOAD or by using (load "BMEntityPos.lsp") in AutoCAD or Civil 3D.
๐ Run BMEntityPos to open the DCL dialog named Bookmarked Entity Positions.
๐ Use Pick from drawing to select supported entity types and append them as bookmark records.
๐ Use Zoom to return to the stored entity position or refreshed entity extents.
๐ Use Set, Duplicate, Delete, Clear, Save, Load, and Import to manage the bookmark list.
๐ง Target platform: AutoCAD and Civil 3D using AutoLISP, Visual LISP ActiveX, and a runtime-generated DCL user interface.
Description:
๐ BMEntityPos is an AutoCAD and Civil 3D AutoLISP utility that creates a practical bookmark manager for drawing entities.
The user runs BMEntityPos, opens a DCL dialog, selects drawing objects, and stores each object as a bookmark with label, bounding-box start point, bounding-box end point, color information, object handle, entity type, and remark text.
The tool is useful for CAD review, model checking, object tracking, issue navigation, drawing cleanup, and returning quickly to important DWG locations without manually searching through the drawing.
The program supports common AutoCAD entity types such as TEXT, MTEXT, LINE, LWPOLYLINE, POLYLINE, CIRCLE, SPLINE, and INSERT block references.
It uses synchronized list boxes to show element data, coordinates, color, and remarks, while group filtering allows the user to view Text, Lines, Polylines, Circles, Splines, Blocks, or all saved bookmarks.
For reliable navigation, the routine attempts to resolve the saved entity handle with handent and refresh the bounding box before zooming. If the entity no longer exists, it falls back to stored coordinates.
Important limitation: this AutoLISP program does not edit Civil 3D ProfileView, SectionView, Alignment, bands, labels, corridors, surfaces, or Civil 3D styles. Its real purpose is AutoCAD entity bookmarking, DCL-based bookmark management, saved view navigation, remark tracking, and list-file persistence.
Helper function: (if any)โ
- ๐ Command entry point –
c:BMEntityPosstarts the DCL-based bookmark manager and controls the dialog loop. - ๐จ Runtime DCL writer –
bm-write-dclcreates the temporary dialog definition usingvl-filename-mktempand loads it withload_dialog. - ๐ Selection and bookmark capture –
bm-pick-and-storeusesssgetto collect supported AutoCAD entities and append bookmark records to*bm-list*. - ๐ Bounding box detection –
bm-get-bboxusesvla-getboundingboxfirst, then falls back to DXF coordinate data when bounding boxes are unavailable. - ๐ Zoom window generation –
bm-make-window,bm-zoom-ll-ur, andbm-apply-zoomcreate padded zoom windows and callvla-ZoomWindow. - ๐ Handle recovery logic –
handentattempts to find the original drawing object so zoom operations can update extents after object edits. - ๐ Synchronized list-box refresh –
bm-update-listkeeps the No or Element, Coordinates, Color, and Remark list boxes aligned. - ๐ง Filtered index mapping –
*bm-index-map*maps visible rows back to original bookmark positions so duplicate, delete, zoom, and remark updates remain correct under filters. - ๐ท๏ธ Group filter builder –
bm-build-groups,bm-update-group-popup, andbm-pass-filterclassify bookmarks into All, Text, Lines, Polylines, Circles, Splines, Blocks, and Other. - ๐ Remark management –
bm-update-remark-fieldandbm-set-remarkdisplay and update user notes for the selected bookmark. - ๐งฉ List manipulation helpers –
bm-replace-nth,bm-remove-nth, andbm-insert-after-nthupdate the bookmark list safely. - ๐ค Save, load, and import workflow –
bm-save-list,bm-load-list,bm-import-list,bm-write-list-to-file,bm-read-list-from-file, andbm-file-pathmanage persistent list files in the drawing folder.
Functionalities:
- ๐ Open a bookmark manager dialog – run
BMEntityPosto manage saved entity positions from a DCL interface. - ๐ Pick objects from the drawing – select text, lines, polylines, circles, splines, and blocks with
ssget. - ๐ Store entity extents – save lower-left and upper-right coordinate windows for future zoom operations.
- ๐ Zoom to bookmarked positions – return instantly to saved DWG locations using padded
vla-ZoomWindownavigation. - ๐ Refresh zoom by entity handle – use
handentto re-check the original object before zooming when possible. - ๐ Add and update remarks – attach practical review notes, coordination comments, or QA remarks to each bookmarked object.
- ๐ Use synchronized list boxes – inspect element labels, coordinates, color data, and remarks in aligned DCL lists.
- ๐ท๏ธ Filter bookmarks by group – show All, Text, Lines, Polylines, Circles, Splines, Blocks, or Other object categories.
- ๐งฉ Duplicate bookmark rows – clone a selected bookmark entry immediately after the original item.
- ๐ด Delete selected bookmarks – remove unwanted saved positions from the in-memory bookmark list.
- ๐งน Clear all bookmarks – reset the active bookmark list and refresh the DCL interface.
- ๐ค Save bookmark lists – write the current list to
[DWG base name]_BMEntityPos.lstin the drawing folder. - ๐ Load default bookmark lists – reload saved bookmark data from the active drawing folder.
- ๐งฐ Import external bookmark lists – replace the current in-memory list with a selected
.lstfile. - ๐จ Capture color metadata – read true color
DXF 420or color indexDXF 62, including ByLayer and ByBlock cases.
Result:
โ
The final result is a focused AutoCAD AutoLISP bookmark manager that helps users record important entity locations, organize them by object type, add remarks, and zoom back to saved drawing areas quickly.
It reduces repetitive manual navigation, improves drawing review workflows, supports better CAD quality control, helps users manage object-based notes, and makes large AutoCAD and Civil 3D drawings easier to inspect.
Images, animations etc.
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>
