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 use • Entity type read — Uses entget and (assoc 0 …) to determine the DXF type of each entity • getboundingbox — Helper that converts an entity name to a VLA object, calls vla-getboundingbox, and returns lower-left and upper-right corners as 3D point lists • Label 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 X • Line 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 getboundingbox • Circle 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 point • Fallback case — For unknown types, labels as “UNKNOWN” with zeroed points to avoid nil values • Selectable 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 objects • No geometry modification — The routine does not create or delete any drawing entities; it only reads and stores data • Ready for downstream tools — Other routines can later consume *textPositions* to place markers, labels, leaders, or export coordinates
Images, animations etc.
Additional info:
Learn more:
Open Website
Share this page:
Subscribe
Login
0 Comments
Oldest
Tags: Bookmark
Tags: Bookmark
