Automatically assign block incremental numbers each clicked point with connected line or polyline please.

Automatically assign block incremental numbers each clicked point with connected line or polyline please.

waroros_isa
Observer Observer
389 Views
4 Replies
Message 1 of 5

Automatically assign block incremental numbers each clicked point with connected line or polyline please.

waroros_isa
Observer
Observer

I am a beginner in lisp. I have a routine task like these.

1.  insert circle block number begin with some text (example 1.1 , a.1 , 2-2 ...)  and  at the 1st point. 

2.  insert 2nd block number 2 and with line or polylint to connect it.

3.  insert 3nd block with incremental number (3) and and draw the line to connect it.

... repeat it until the end point

Screenshot_2.jpg

Please, guys. Help me.

 
 
0 Likes
390 Views
4 Replies
Replies (4)
Message 2 of 5

ronjonp
Mentor
Mentor

You'd probably get more responses if you posted your drawing. This is very easy to do, here's a simple example with lines and text.

 

(defun c:foo (/ n p1 p2)
  (defun _txt (pt txt /)
    (entmake (list '(0 . "TEXT")
		   '(100 . "AcDbEntity")
		   '(67 . 0)
		   '(8 . "text")
		   '(100 . "AcDbText")
		   (cons 10 pt)
		   '(40 . 1.)
		   (cons 1 txt)
		   '(50 . 0.)
		   '(41 . 1.)
		   '(51 . 0.)
		   '(71 . 0)
		   '(72 . 1)
		   (cons 11 pt)
		   '(100 . "AcDbText")
		   '(73 . 2)
	     )
    )
  )
  (setq n 0)
  (while (and (or p1 (setq p1 (getpoint "\nSpecify start point: ")))
	      (setq p2 (getpoint p1 "\nSpecify next point: "))
	 )
    (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p2)))
    (_txt p1 (itoa (setq n (1+ n))))
    (setq p1 p2)
  )
  (_txt p1 (itoa (setq n (1+ n))))
  (princ)
)

 

 

2023-04-21_15-38-01.gif

 

Message 3 of 5

Sea-Haven
Mentor
Mentor

Nice rlx I am pretty sure have seen a version with arcs connecting maybe author will post.

 

A freebie pt num bubble.lsp. Save the Multi lsp to a support directory.

Message 4 of 5

waroros_isa
Observer
Observer

thanks for the help 😃

0 Likes
Message 5 of 5

waroros_isa
Observer
Observer
thanks for the help
0 Likes