Jump to content

Recommended Posts

Posted

Try the attached.

 

(defun c:enz (/ clr key pnt dim a b c)
  ;; Tharwat - 5.Jul.2019
  ;;  (load "enz.lsp") enz
  ;;  https://www.cadtutor.net/forum/topic/68126-require-lisp-3-in-1-for-xyz-coordinates-with-leader/?tab=comments#comment-552696
  
  (setq clr (getvar 'clayer)) 
  (cond ( (null (tblsearch "LAYER"  "Coor Text")) (command "-layer" "_M" "Coor Text" "_C" 7 "" "")) (t (setvar 'clayer "Coor Text")))
  (and
    (or (initget "NoZ All Z")
        (setq key
               (cond
                 ((getkword
                    "\nPick your go [No Elevation , All Coordinates , Z coordinates only] [NoZ/All/Z] < NoZ > :"
                  )
                 )
                 ("NoZ")
               )
        )
    )
    (setq pnt (getpoint "\nSpecify base point : "))
    (while pnt
    (setq dim (getvar 'DIMZIN))
    (setvar 'DIMZIN 0)
    (mapcar 'set
        '(a b c)
        (mapcar '(lambda (k p) (strcat k (rtos p 2 4)))
            '("E=" "N=" "Z=")
            pnt
        )
    )
    (setvar 'DIMZIN dim)
    (command "_.LEADER"
         "_none"
         pnt
         "\\"
         ""
         (nth (vl-position key '("NoZ" "All" "Z"))
          (list (strcat a "\\P" b) (strcat a "\\P" b "\\P" c) c)
         )
         ""
    )
    (setq pnt (getpoint "\nSpecify base point : "))
    ) ; while
  )
  (setvar 'clayer clr)
  (princ)
)

 

  • Like 1
Posted
3 hours ago, Ish said:

 wonderful Sir,

now working perfectly.

Request To You just add code for layer,  create Layer Automatic And All value must come in Layer

layer Name "Coor Text"

👏

Thanks a Lot.

 

Updated code in my last post.

Posted
12 hours ago, dlanorh said:

Try the attached.

 


(defun c:enz (/ clr key pnt dim a b c)
  ;; Tharwat - 5.Jul.2019
  ;;  (load "enz.lsp") enz
  ;;  https://www.cadtutor.net/forum/topic/68126-require-lisp-3-in-1-for-xyz-coordinates-with-leader/?tab=comments#comment-552696
  
  (setq clr (getvar 'clayer)) 
  (cond ( (null (tblsearch "LAYER"  "Coor Text")) (command "-layer" "_M" "Coor Text" "_C" 7 "" "")) (t (setvar 'clayer "Coor Text")))
  (and
    (or (initget "NoZ All Z")
        (setq key
               (cond
                 ((getkword
                    "\nPick your go [No Elevation , All Coordinates , Z coordinates only] [NoZ/All/Z] < NoZ > :"
                  )
                 )
                 ("NoZ")
               )
        )
    )
    (setq pnt (getpoint "\nSpecify base point : "))
    (while pnt
    (setq dim (getvar 'DIMZIN))
    (setvar 'DIMZIN 0)
    (mapcar 'set
        '(a b c)
        (mapcar '(lambda (k p) (strcat k (rtos p 2 4)))
            '("E=" "N=" "Z=")
            pnt
        )
    )
    (setvar 'DIMZIN dim)
    (command "_.LEADER"
         "_none"
         pnt
         "\\"
         ""
         (nth (vl-position key '("NoZ" "All" "Z"))
          (list (strcat a "\\P" b) (strcat a "\\P" b "\\P" c) c)
         )
         ""
    )
    (setq pnt (getpoint "\nSpecify base point : "))
    ) ; while
  )
  (setvar 'clayer clr)
  (princ)
)

 

thanks a lot all member who support 

, now it fine,

finally complete enz lisp.

  • 4 years later...
Posted
On 7/5/2019 at 5:30 AM, BIGAL said:

Please mention command keyword

; pick a point and make a leader
; by Alan H July 2019

(defun C:cxy ( / pt1 pt2 ans txtx txty txtz oldlay)
(command "-layer" "m" "Co-ordinates" "c" 1 "Co-ordinates" "")
(setq oldlay (getvar 'clayer))
(setvar 'clayer "Co-ordinates")
(if (not AH:Butts)(load "Multi Radio buttons.lsp"))
(if (= but nil)(setq but 1))
(setq ans (ah:butts but "V"  '("Please choose" "E-N" "E-N-Z" "Z")))
(setvar "cmdecho" 0)
(while (setq pt1 (getpoint "\nPick point for co-ordinate: "))
(setq pt2 (getpoint pt1 "\nPick point for text: "))
(if pt2
(progn
(setq txtx (strcat "E= " (rtos (car pt1) 2 3) ))
(setq txty (strcat "N= " (rtos (cadr pt1) 2 3) ))
(setq txtz (strcat "Z= " (rtos (caddr pt1) 2 3) ))
(princ "\n")
(cond
((= ans "E-N")(command "leader" pt1 pt2 "Annotation" txtx txty ""))
((= ans "E-N-Z")(command "leader" pt1 pt2 "Annotation" txtx txty txtz ""))
((= ans "Z")(command "leader" pt1 pt2 "Annotation" txtz ""))
)
)
)
)
(setvar 'clayer oldlay)
(princ)
)
(c:cxy)

 

.

 

image.png.22f0e0dc782f13a6e1a249c06fdb4688.png

Multi radio buttons.lspUnavailable

 

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...