With a little copy and paste and some trial and error i have come this far.
but getting a error at the end to put the string
i left the original code in there tot help me
i'm not that great with lisp, just learning
- (defun c:lala (/ spc p1 p2 str lead) (vl-load-com) ;; Tharwat 08. 07. 2011 (cond ((not acdoc) (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) ) ) (setq spc (if (> (vla-get-activespace acdoc) 0) (vla-get-modelspace acdoc) (vla-get-paperspace acdoc) ) ) (while (and (setq p1 (getpoint "\n specify First Point :")) (setq p2 (getpoint p1 "\n Specify Second point :")); (setq str lst);;;;;; (car (entsel "\n Specify any entity to get its Layer name :"));;;(setq ss (ssget)) (progn (repeat (setq i (sslength ss)) (setq layer (cdr (assoc 8 (entget (ssname ss (setq i (1- i))))))) (if (not (member layer lst)) (setq lst (cons layer lst))) ) (setq lst (acad_strlsort lst)) )(setq str lst);;; ) (progn (setq lead (vla-addmleader spc (vlax-make-variant (vlax-safearray-fill (safearray vlax-vbdouble '(0 . 5)) (apply 'append (list p1 p2)) ) ) 0 ) ) (vla-put-textstring lead (cdr (assoc 8 (entget str)))) ) ) (princ))
|