Add_Bookmark

Short description

Purpose: Collect and store basic positional data about selected entities into a global bookmark list for later use Scope: Works on TEXT, MTEXT, LINE, LWPOLYLINE, POLYLINE, CIRCLE, SPLINE, and INSERT (blocks) Output storage: Appends entries to global variable *textPositions* in the form (label startPoint endPoint)

Command:

Command: BMEntityPos Execution: Type BMEntityPos then press Enter Selection filter: Prompts for selection of TEXT, MTEXT, LINE, LWPOLYLINE, POLYLINE, CIRCLE, SPLINE, and INSERT entities Feedback: Prints how many entities are currently stored in *textPositions* after processing

Description:

This routine lets you select a mixed set of supported entities and extracts a simple “label + start point + end point” triple for each, then pushes that triple into a global bookmark list for later processing by other tools or routines. For text and block inserts it uses their insertion point and a synthetic end point offset, for lines and splines it uses their defined endpoints, for polylines it uses the bounding box corners, and for circles it uses center plus a radius-based corner point. After all selected entities are processed, it reports the total number of bookmarked entries now stored, building up a reusable memory of object positions across multiple command runs.

Helper function: (if any)​

Global list initializer — If *textPositions* is nil, initializes it to an empty list before useEntity type read — Uses entget and (assoc 0 …) to determine the DXF type of each entitygetboundingbox — Helper that converts an entity name to a VLA object, calls vla-getboundingbox, and returns lower-left and upper-right corners as 3D point listsLabel selection — Determines a short label string per entity type (real text for TEXT/MTEXT, type names like “LINE”, “POLYLINE”, “CIRCLE”, “SPLINE”, or “BLOCK: name”)Bookmark builder — For each entity builds a list (txt startPt endPt) and conses it onto *textPositions*

Functionalities:

Text handling — For TEXT and MTEXT, stores the actual string content and uses the insertion point as start, with an artificial end point offset 10 units in XLine handling — For LINE, uses the true start point (DXF 10) and end point (DXF 11) and labels it as “LINE”Polyline handling — For LWPOLYLINE and POLYLINE, labels as “POLYLINE” and uses bounding box corners from getboundingboxCircle handling — For CIRCLE, uses the center (DXF 10) and a corner computed from center plus radius in X and Y, labels as “CIRCLE”Spline handling — For SPLINE, uses DXF 10 and 11 as start and end points, labels as “SPLINE”Block handling — For INSERT, uses the block name (DXF 2) prefixed with “BLOCK: ” and uses insertion point plus an X-offset as end pointFallback case — For unknown types, labels as “UNKNOWN” with zeroed points to avoid nil valuesSelectable accumulation — Multiple runs keep pushing new bookmarks into *textPositions* instead of overwriting it

Result:

Bookmark list updated*textPositions* ends up containing one entry per processed entity in the format (label startPt endPt)Entity count feedback — Command line reports how many entries are now stored, giving quick confirmation of captured objectsNo geometry modification — The routine does not create or delete any drawing entities; it only reads and stores dataReady for downstream tools — Other routines can later consume *textPositions* to place markers, labels, leaders, or export coordinates

Images, animations etc.

Pixel

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="Add_Bookmark">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: BMEntityPos</Bold>
<LineBreak/>
<Hyperlink>N/A</Hyperlink>
<LineBreak/>		
Bookmarks location for Texts/MTexts, Lines, Lwpolyline or Polyline, Circles, Splines and Blocks, in this way:
<LineBreak/>	
Text/MText: uses insertion point and end based on width
<LineBreak/>	
Line: start and end points
<LineBreak/>	
Lwpolyline or Polyline: first and last vertex
<LineBreak/>	
Circle: center and radius to define the edge point
<LineBreak/>	
Spline: start and end control points
<LineBreak/>	
Block: insertion point and a point 10 meters to the right
</TextBlock>
 
 <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->

 
 </StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
</ResourceDictionary>

Additional info:

Share this page:

Leave a Reply

Page Tag: 🏷️ Autocad Lisps

  • Add_Bookmark

    Short description Purpose: Collect and store basic positional data about selected entities into a global bookmark list for later use Scope: Works on TEXT, MTEXT, LINE, LWPOLYLINE, POLYLINE, CIRCLE, SPLINE, and INSERT (blocks) Output storage: Appends entries to global variable *textPositions* in the form (label startPoint endPoint) Command: Command: BMEntityPos Execution: Type BMEntityPos then press…

  • Clear_Bookmarks

    Short description Clears the internal **bookmark list** used by BMEntityPos for storing text/entity positions Provides a simple confirmation dialog before erasing stored data Ensures the global list *textPositions* is reset safely Command: Command: ClearTextPos Input: Confirmation via alert dialog (OK / Cancel) Effect: Clears global bookmark storage list Description: This command displays a confirmation alert…

  • Exp_Imp_NamedViews

    Short description🧭 AutoCAD AutoLISP utility for exporting and importing Named Views and related Visual Styles through a DCL dialog, predefined project folders, TXT files, and session aware folder handling. Command:ExpImpNVU, NVVIEWSIO, ExportViews, ImportViews, -ExportViews, -ImportViews Description:🧭 Exp_Imp_NamedViews is an AutoCAD LISP tool for transferring Named Views between drawings. It provides a dialog driven workflow for…

  • BookmarkEntities

    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,…

  • ReplaceBlocks_vs.01

    Short description🔁🧱 Replace selected AutoCAD block references with another block definition while preserving insertion point, rotation, scale, layer, normal, and optionally matching attribute values. Command:🚀 Primary command: ReplaceDrawingBlocks ⚡ Alias command: BRE 🧹 Reset command: ReplaceDrawingBlocksRESET ℹ️ Version command: ReplaceDrawingBlocksVERSION Run ReplaceDrawingBlocks or BRE in the AutoCAD command line to open the embedded DCL Replace…

  • DelUnusedBlocks

    Short description🚀 DelUnusedBlocks is an AutoCAD AutoLISP and DCL cleanup utility for finding and deleting unused block definitions from the active DWG drawing. 🧹 The tool scans the AutoCAD block table, filters out inserted blocks, xrefs, layout blocks, anonymous blocks, and dependent definitions, then displays only deletable unused block names in a multi-select dialog. ✅…

  • DynamicBlockCounter

    Short description🚀 DynamicBlockCounter is an AutoCAD and Civil 3D AutoLISP block counting utility for standard blocks, dynamic blocks, xrefs, and visibility-state summaries in the current drawing layout. It helps CAD users quickly audit DWG block usage, count dynamic block visibility states, and export clean TXT or CSV reports for drawing coordination, quantity checking, and CAD…

  • DynamicBlockFilter

    Short description🚀 DynamicBlockFilter is an AutoCAD and Civil 3D compatible AutoLISP utility for selecting dynamic block references by their dynamic property values. It helps CAD users quickly isolate matching dynamic blocks in a DWG, reduce manual selection time, and improve drawing cleanup, block auditing, and AutoCAD production workflows. Command:🧰 Load the LISP with APPLOAD or…

  • DeleteBlocks

    Short description🚀 DeleteBlocks is an AutoCAD AutoLISP and DCL utility for deleting block definitions and their block references from a DWG drawing. It helps CAD users inspect block names, review instance counts, filter block lists, select unused blocks, and remove unwanted block definitions faster. The main benefit is cleaner AutoCAD drawings, reduced block clutter, faster…

  • DelSelectBlock

    Short description🚀 DelSelectBlock is an AutoCAD AutoLISP and DCL utility for deleting every block reference that matches a selected raw block name in the active DWG drawing. It helps CAD users quickly remove repeated block instances, manage block cleanup, optionally purge the block definition, and keep deletion settings saved between sessions. Command:🧰 Load the LISP…