PDA

View Full Version : Leader Lisp Routine that puts in the Elevation



denton
2004-06-03, 05:35 PM
Does anyone have a lisp routine that will put in a leader line and print out the elevation (Z coordinate) as EL 100.00?

Coolmo
2004-06-03, 08:36 PM
Z coordinate of what? The node or point that the leader is pointing to or would the user type an elevation?

peter
2004-06-04, 11:58 AM
Maybe?

Peter Jamtgaard



(defun C:LEAD100 ()
(vl-cmdf "leader" pause pause "" "100.00" "")
)

RobertB
2004-06-04, 04:06 PM
Peter, I think Denton wants the Z-coord of the object the leader points to.

Denton, what version of AutoCAD?

denton
2004-06-07, 01:26 PM
Thanks but I got what I needed from a different forum thank you anyway.

steve.perkio
2008-05-13, 01:32 PM
I asked for Denton' help with this issue, and basically got a No Thank you, I'm not going to help you reply. See the attached pdf.

Thanks Denton.


Thanks but I got what I needed from a different forum thank you anyway.

denton
2008-05-13, 01:38 PM
I asked for Denton' help with this issue, and basically got a No Thank you, I'm not going to help you reply. See the attached pdf.

Thanks Denton.

I'm sorry if I misunderstood you, I was not being rude, what help did you want on this? This post was so long ago I'm a little foggy on it. Do you want the routine?

tedg
2008-05-13, 03:26 PM
I'm sorry if I misunderstood you, I was not being rude, what help did you want on this? This post was so long ago I'm a little foggy on it. Do you want the routine?
I think "steve.perkio" was asking if you had received an answer or resolution to your question, and if so could you point him in the right direction and/or share what you got.

That's my take on it anyway...

denton
2008-05-13, 03:39 PM
Could be, but he seemed upset which was not my intention. Here's the routine for what it's worth. It some functions I use locally for looking up and restoring variables that should be commented out (initerr) and (reset):


;;; LISP: Elead.lsp
;;;
;;; Version 1.0 D.D. Denton 6/3/04
;;; Western Area Power Administration
;;; email: denton@wapa.gov 720-962-7360
;;;
;;; Purpose: Leader line that automatically labels elevations.
;;;
;;;
;;;----------------------------------------------------------------------
(defun elead (/ point ldrent oldecho lastent txtent coord2)
(initerr)
(vl-load-com)
(command "ucs" "w")
(defun laycheck ( / laychk)
(setq curlayer (getvar "clayer"))
(setq laychk (cdr (assoc 2 (tblsearch "layer" "dimen"))))
(if (= laychk nil) (command "layer" "m" "dimen" "c" 6 "" ""))
(command "layer" "s" "dimen" "")
)

(setvar "cmdecho" 0)
(laycheck)
(check_dim "dim-arrow-leader")
(command "ortho" "off")
(command "osnap" "end")
(setvar "luprec" 2)
(setvar "lunits" 2)
(while (setq point (getpoint "\nSelect point to label: "))
(setq oldecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq lastent (entlast))
(command "_.leader" point)
(princ "\nNext leader point: ")
(command pause)
(princ "\nNext leader point: ")
(command pause (strcat "EL " (rtos (caddr point)))
"")
(setq txtent (vlax-ename->vla-object (entlast)))
(setq ldrent (vlax-ename->vla-object (entnext lastent)))
(setq coord2 (vlax-safearray->list
(vlax-variant-value
(vla-get-coordinate ldrent 1))))
(if (< (/ pi 2) (angle coord2 (getvar "lastpoint")) (* pi 1.5))
(vla-put-attachmentpoint txtent acAttachmentPointMiddleRight)
(vla-put-attachmentpoint txtent acAttachmentPointMiddleLeft)
)
(vla-put-insertionpoint txtent (vlax-3d-point (getvar "lastpoint")))
(vla-put-VerticalTextPosition ldrent acVertCentered)
(setvar "cmdecho" oldecho)
)
(princ)
(command "ucs" "v")
(reset)
)
(defun c:elead () (elead))


Moderator Note:

Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)