LISP Draw Line from justify of the Text

LISP Draw Line from justify of the Text

daohaquang
Enthusiast Enthusiast
1,272 Views
3 Replies
Message 1 of 4

LISP Draw Line from justify of the Text

daohaquang
Enthusiast
Enthusiast

Help me  LISP. I have many dtext. I want when choosing a series of dtext then the lisp will draw a series of lines with the starting point of the line is the insertion point of the text. All Lines vertically from bottom to top. Sorry for my English not good

CAD.jpg

 

0 Likes
Accepted solutions (1)
1,273 Views
3 Replies
Replies (3)
Message 2 of 4

pbejse
Mentor
Mentor
Accepted solution
(Defun c:LFDTJ (/ ss i e data p val)
  (if (setq ss (ssget '((0 . "TEXT") (1 . "*#.#*"))))
    (repeat (setq i (sslength ss))
      (setq e (ssname ss (Setq i (1- i))))
      (setq data (mapcar '(lambda (dx)
			    (cdr (assoc dx (entget e)))
			  )
			 '(10 11 1 8)
		 )
      )
      (if (numberp (setq val (read (Caddr data))))
	(entmakex (list	(cons 0 "LINE")
			(cons 8 (last data))
			(cons 10
			      (setq p (if (vl-every 'zerop (Cadr data))
					(car data)
					(cadr data)
				      )
			      )
			)
			(cons 11 (polar p (/ pi 2.0) val))
		  )
	)
      )
    )
  )
  (princ)
)
Message 3 of 4

daohaquang
Enthusiast
Enthusiast

thank you so much

0 Likes
Message 4 of 4

pbejse
Mentor
Mentor

@daohaquang wrote:

thank you so much


You are welcome @daohaquang 🙂