dlanorh Posted July 10, 2019 Posted July 10, 2019 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) ) 1 Quote
tombu Posted July 10, 2019 Posted July 10, 2019 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. Quote
Ish Posted July 11, 2019 Author Posted July 11, 2019 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. Quote
Narender Singh Posted December 11, 2023 Posted December 11, 2023 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) . Multi radio buttons.lspUnavailable Quote
Recommended Posts
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.