Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 2
kulfi
264 Views, 1 Reply

Leader Code

Hi,

I need Visual Lisp code for the leader i have attached.

Kulfi
Electronics Engineer

Pind Saudi Arabia



1 REPLY 1
Message 2 of 2
hmsilva
in reply to: kulfi

Something like this perhaps.

Untested, I don't have AutoCAD in this laptop...

(defun c:test ( / ACTLYT LEAOB MTXTOB PT1 PT2 PT3 PTLST PTS PTSVAR)
  (vl-load-com)
  (if (and (setq pt1 (getpoint "\nPick the first point: "))
	   (setq pt2 (getpoint pt1 "\nPick the second point: "))
	   (setq pt3 (getpoint pt2 "\nPick the third point: "))
      );; and
    (progn
      (setq actlyt (vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))
	    mtxtob (vla-addmtext actlyt (vlax-3d-point pt3) 1 "")
	    ptlst  (apply 'append (list pt1 pt2 pt3))
	    pts	   (vlax-make-safearray vlax-vbDouble '(0 . 8))
      );; setq
      (vlax-safearray-fill pts ptlst)
      (setq ptsvar (vlax-make-variant pts))
      (setq leaob (vla-addleader actlyt ptsvar mtxtob acLineWithArrow))
      (vla-put-dimensionlinecolor leaob 1)
      (vla-put-arrowheadsize leaob 0.88)
      (vla-put-textgap leaob 0.0)
      (vla-put-verticaltextposition leaob 0)
      (vla-put-layer leaob "N-E-TEXT")
      (vla-delete mtxtob)
    );; progn
  );; if
  (princ)
);; test

 

HTH

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost