Help Needed: AutoCAD LISP – Point Numbering with Block Attributes

Help Needed: AutoCAD LISP – Point Numbering with Block Attributes

javeed4teen
Participant Participant
169 Views
1 Reply
Message 1 of 2

Help Needed: AutoCAD LISP – Point Numbering with Block Attributes

javeed4teen
Participant
Participant

Hello everyone,

I’ve prepared a LISP with some help, and I need an upgrade. Here’s what the current LISP does:

  • Takes the vertices of a selected polyline

  • Places a point at each vertex

  • Places a number (text) near each point

  • Prompts the user for text height and text offset

The problem is:

  • If two vertices are very close, it’s hard to tell which number belongs to which point.
  • I tried converting the point + number into a block with an attribute, so the number increments automatically for each vertex.
  • I want a solution where selecting the block selects both the point and the number, making it easy to see which number belongs to which point.

I’ve tried multiple approaches, but I keep running into issues:

  • Errors when creating the block programmatically

  • Attribute numbers not updating correctly

  • Blocks appearing larger than expected or containing the polyline itself

I’m looking for a robust solution where:

  1. The block contains both the point and a number attribute

  2. The number increments sequentially across all vertices and polylines

  3. The text offset is customizable

  4. A CSV with number, X, Y coordinates is exported

Has anyone successfully implemented something like this in AutoCAD using LISP? Any tips, example code, or guidance would be greatly appreciated.

Thanks in advance!

0 Likes
170 Views
1 Reply
  • Lisp
Reply (1)
Message 2 of 2

Sea-Haven
Mentor
Mentor

Have a look at this makes a block either a square or a circle and numbers them. Just add the "point" at the insertion point. Or use a "X". look at teh way the pline and circle are added.

 

 

0 Likes