Jump to content

Routine to display xyz values


Northstar

Recommended Posts

Guest Alan Cullen

Try this one, if it doesn't work for you I have another one which is for survey drawing settings.

 

;;--------------------------------------------------------------------------
;; COORDRL.LSP              PLACE CO-ORDINATE & LEVEL TEXT OF SELECTED POINT
;;==========================================================================
;;DESCRIPTION:  This routine will place co-ordinate text and point level
;;              alongside a defined (user selected) point.  The `x', `y' & `z' 
;;              values of the selected point will be preceded with an `E', `N' 
;;              &`RL' respectively. This routine also places a donut at the 
;;              point.  The co-ord & level text is then echoed to the screen 
;;              alongside the selected point, and the user is prompted to select 
;;              the desired location of the text.  
;;
;;START COMMAND........   coordrl
;;
;;WRITTEN BY:   ALAN CULLEN           November 1999
;;
;;AMENDED:      October 2007          Re-written for Tiger
;;
;;---------------------------ERROR HANDLER------------------------------
(defun clerr (s)
(if (/= s "Function cancelled")
 (if (= s "quit / exit abort")
  (princ)
  (princ (strcat "\nError: " s))
 )
)
(setvar "donutid" olid)
(setvar "donutod" olod)
(setvar "blipmode" olblip)
(setvar "LUPREC" oluprec)
(setvar "osmode" olsnap)
(setq el1 nil el2 nil)
(setvar "cmdecho" ocmd)
(setvar "ANGBASE" oangbase)       ;;Angle zero direction to "north"
(setvar "ANGDIR" oangdir)         ;;Clockwise angles
(setvar "dragmode" odrag)

(if olderr (setq *error* olderr))
(princ "\nERROR...CONSOLE BREAK...PREVIOUS DRAWING STATUS RESTORED...")
(princ)
)

;;-----------------------------MAIN PROGRAM------------------------------

(DEFUN C:coordrl  ()

(princ "\n PLACE POINT CO-ORDINATE & LEVEL TEXT  -  May 2000 - Alan CULLEN")

(setq txtang 90)           					;;*** Set orientation angle for text (set for 0 deg = North, angles measured clockwise)
(setq lnspace 1.5)        					;;*** Set text line spacing factor (generally 1.
(setq olderr *error* *error* clerr)		;;Set new error handler
(setq ocmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq olid (getvar "DONUTID"))
(setvar "donutid" 0)
(setq olod (getvar "DONUTOD"))
(setvar "donutod" 5.0)           			;;*** Set outside diameter of donut
(setq oluprec (getvar "LUPREC"))
(setvar "LUPREC" 3)           				;;*** Set number of decimal places
(setq olsnap (getvar "osmode"))
(setq ts 2.5)           						;;*** Set text size
(setq olblip (getvar "blipmode"))
(setvar "blipmode" 1)           			;;*** Set BLIPMODE enviroment variable 0/1 ... 0=OFF, 1=ON
(setq oangbase (getvar "ANGBASE"))
(setvar "ANGBASE" (/ pi 2))       			;;Angle zero direction to "north"
(setq oangdir (getvar "ANGDIR"))
(setvar "ANGDIR" 1)               			;;Clockwise angles
(setq odrag (getvar "dragmode"))
(setvar "dragmode" 2)


(setq pt T)
(while pt
 (princ "\n PLACE POINT CO-ORDINATE & LEVEL TEXT  -  May 2000 - Alan CULLEN")
 (setvar "osmode" 1)
 (setq pt (getpoint "\n Pick Point (snap set to END)    <RETURN> to finish :"))                      
 (setvar "osmode" 0)
 (if (/= pt nil)
  (progn
   (setq ptx (car pt) pty (cadr pt) ptz (caddr pt))
   (setq txtptx (strcat "E " (rtos ptx)))
   (setq txtpty (strcat "N " (rtos pty)))
   (setq txtptz (strcat "RL " (rtos ptz)))
   (setq pt1 (list ptx pty 0))
   (setq txtpt1 (list ptx (+ pty (* 2(* lnspace ts))) 0))
   (setq txtpt2 (list ptx (+ pty (* lnspace ts)) 0))
   (command "doughnut" "" "" pt1 "")
   (command "text" txtpt1 ts txtang txtptx)
   (setq el1 (entlast))
   (command "text" txtpt2 ts txtang txtpty)
   (setq el2 (entlast))
   (command "text" pt1 ts txtang txtptz)
   (setq el3 (entlast))
   (prompt "\n     Select the Desired Location for Text...... ")
   (command "move" el1 el2 el3 "" pt1 pause)
)))
(setvar "donutid" olid)
(setvar "donutod" olod)
(setvar "blipmode" olblip)
(setvar "LUPREC" oluprec)
(setvar "osmode" olsnap)
(setq el1 nil el2 nil)
(setq *error* olderr)             ;; Restore old error handler
(setvar "cmdecho" ocmd)
(setvar "ANGBASE" oangbase)
(setvar "ANGDIR" oangdir)
(setvar "dragmode" odrag)

(princ)
)

Link to comment
Share on other sites

  • 9 months later...
  • 10 months later...

Gadi

try this works with 2006 cad , i have 2008 lt but no opttion to load application

great lisps

 

for the lisp you cant load, may be the autocad version is LT,

for the lisp itseld it great

but how can i collect in a table

Link to comment
Share on other sites

Thanks, when I run the command the text is upside down and the values look like O

Y 2222

Z-1111

 

I have used a lisp for this that I renamed to LLP.lsp

It will draw a leader usind current dimstyle and after an Enter it will add the X, Y, Z coordinates of the first leader point, using the current text style and size and it will draw a point also in that selected first point.

 

I have modified from its original version to do all these things.

LLP.LSP

Link to comment
Share on other sites

  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...