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) ) 2 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
thecocuk07 Posted March 8 Posted March 8 On 7/10/2019 at 5:48 PM, 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) ) hello , Is it possible to add a point to the place where we click with the cursor and make the text dynamic? That is, if we move the point, its coordinates will change Quote
Saxlle Posted March 8 Posted March 8 Hi @thecocuk07, Yes, it is possible. You can make dynamic block with those properties and every time when you change the position of the "base point of the block", you will get desired X, Y, Z position. Best regards. 1 Quote
ronjonp Posted March 8 Posted March 8 (edited) @thecocuk07 See attached .. it's a point grouped to an mleader with a field linked to it. example.dwg Edited March 8 by ronjonp 2 Quote
smitaranjan Posted May 30 Posted May 30 can anyone convert the lisp to provide Geographic Lat: Long: of particular points Quote
BIGAL Posted May 30 Posted May 30 Converting a X y to a lat & long is not just use some formula, yes you use a formula but it has all sorts of values in it depending on where you are in the world. As you go around the world you have zones and these are relevant to where you live. There is formulas out there so google, or if you use CIV3D you can adopt a world zone and display Lat & Long's as a point style. 1 Quote
GLAVCVS Posted May 30 Posted May 30 (edited) 17 hours ago, smitaranjan said: can anyone convert the lisp to provide Geographic Lat: Long: of particular points In short: You need the point to be transformed to be referenced to an official reference system: UTM WGS84, ETRS89, etc., and you also need to know the geographic zone it's in. Therefore, if your point isn't in an official reference system and you don't have transformation parameters, your first task is to find a way to relate them. Edited May 30 by GLAVCVS 1 Quote
SLW210 Posted May 31 Posted May 31 I still believe @ronjonp solution is the best way... Yes, you need your drawing set up proper as mentioned, no matter the method. 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.