aryanarch Posted December 20, 2009 Posted December 20, 2009 any one know a lisp to click at a point and read xyz after that it convert that corrdinat to mtext Quote
Lee Mac Posted December 20, 2009 Posted December 20, 2009 Quick one: (defun c:mpt (/ M-Point M-Text pt) (defun M-Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)))) (defun M-Text (pt val) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 val)))) (while (setq pt (getpoint "\nPick Point: ")) (M-Point (setq pt (trans pt 1 0))) (M-Text pt (apply 'strcat (mapcar 'strcat '("X = " "\nY = " "\nZ = ") (mapcar 'rtos pt))))) (princ)) Quote
aryanarch Posted December 21, 2009 Author Posted December 21, 2009 thank u lee, this code is usefull Quote
Lee Mac Posted December 21, 2009 Posted December 21, 2009 thank u lee, this code is usefull You're welcome Quote
aryanarch Posted December 28, 2009 Author Posted December 28, 2009 hi lee mac can u change the text height or rotation of the mtext in this code because i made a new text style and new layer, i made the to the current, but it is not working with this text style.. ----------------------------------------------------------------- Quick one: (defun c:mpt (/ M-Point M-Text pt) (defun M-Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)))) (defun M-Text (pt val) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 val)))) (while (setq pt (getpoint "\nPick Point: ")) (M-Point (setq pt (trans pt 1 0))) (M-Text pt (apply 'strcat (mapcar 'strcat '("X = " "\nY = " "\nZ = ") (mapcar 'rtos pt))))) (princ)) Quote
Lee Mac Posted December 28, 2009 Posted December 28, 2009 The original code will take on the properties of the current textstyle, but this will give you manual control: (defun c:mpt (/ M-Point M-Text pt height rotation) (setq height 2.5 rotation 0.0) [color=Blue][b];; Text Height and Rotation[/b][/color] (defun M-Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)))) (defun M-Text (pt val hgt rot) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 val) (cons 40 hgt) (cons 50 rot)))) (while (setq pt (getpoint "\nPick Point: ")) (M-Point (setq pt (trans pt 1 0))) (M-Text pt (apply 'strcat (mapcar 'strcat '("X = " "\nY = " "\nZ = ") (mapcar 'rtos pt))) height rotation)) (princ)) Quote
stevesfr Posted December 28, 2009 Posted December 28, 2009 The original code will take on the properties of the current textstyle, but this will give you manual control: (defun c:mpt (/ M-Point M-Text pt height rotation) (setq height 2.5 rotation 0.0) [color=blue][b];; Text Height and Rotation[/b][/color] (defun M-Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)))) (defun M-Text (pt val hgt rot) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 val) (cons 40 hgt) (cons 50 rot)))) (while (setq pt (getpoint "\nPick Point: ")) (M-Point (setq pt (trans pt 1 0))) (M-Text pt (apply 'strcat (mapcar 'strcat '("X = " "\nY = " "\nZ = ") (mapcar 'rtos pt))) height rotation)) (princ)) How to change output to Y, X, Z instead? Quote
Lee Mac Posted December 28, 2009 Posted December 28, 2009 (defun c:mpt (/ M-Point M-Text pt height rotation) (setq height 2.5 rotation 0.0) ;; Text Height and Rotation (defun M-Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)))) (defun M-Text (pt val hgt rot) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 val) (cons 40 hgt) (cons 50 rot)))) (while (setq pt (getpoint "\nPick Point: ")) (M-Point (setq pt (trans pt 1 0))) (M-Text pt (apply 'strcat (mapcar 'strcat '("Y = " "\nX = " "\nZ = ") (mapcar 'rtos (list (cadr pt) (car pt) (caddr pt))))) height rotation)) (princ)) Quote
stevesfr Posted December 28, 2009 Posted December 28, 2009 (defun c:mpt (/ M-Point M-Text pt height rotation) (setq height 2.5 rotation 0.0) ;; Text Height and Rotation (defun M-Point (pt) (entmakex (list (cons 0 "POINT") (cons 10 pt)))) (defun M-Text (pt val hgt rot) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 val) (cons 40 hgt) (cons 50 rot)))) (while (setq pt (getpoint "\nPick Point: ")) (M-Point (setq pt (trans pt 1 0))) (M-Text pt (apply 'strcat (mapcar 'strcat '("Y = " "\nX = " "\nZ = ") (mapcar 'rtos (list (cadr pt) (car pt) (caddr pt))))) height rotation)) (princ)) Lee, thanks for the lesson on the use of rtos ! now I can fix all my other resulting "xyz" programs to "yxz" (which for me is N,E,Elev) !! Quote
ttsadaf Posted January 4, 2010 Posted January 4, 2010 very well ............... beautiful lisp routines......... awesome.......... tahnx very much friends....... Quote
Lee Mac Posted January 4, 2010 Posted January 4, 2010 very well ...............beautiful lisp routines......... awesome.......... tahnx very much friends....... You're welcome Quote
aryanarch Posted January 10, 2010 Author Posted January 10, 2010 when i choose break at point in auto cad and i repeat this command by pressing enter or space it change the command to break. how to remain it to do break at point? thank u Quote
BearDyugin Posted January 10, 2010 Posted January 10, 2010 Here my function, which write geodetic coordinates on leader (defun c:geo_koord_leader (/ pod_z koord y x z xyz) (initget "Yes No") (setq pod_z (getkword "\nShow Z [Yes/No] <No>? : ") ) (while (and (setq koord (getpoint "\nPoint <Exit>")) ) (setq y (strcat "X=" (rtos (nth 0 koord) 2 3)) x (strcat "Y=" (rtos (nth 1 koord) 2 3)) z (if (= pod_z "Y") (strcat "Z=" (rtos (nth 2 koord) 2 3)) "" ) ) (VL-cmdf "_leader" koord pause "" x y z "") ) ) (princ "Command name: geo_koord_leader") Quote
e-cleric Posted February 18, 2010 Posted February 18, 2010 Hello! Is there some possibility to change the numerological order? To be more specific: there is need in placing numbers beginning from north-west around the closed polyline (rectangle) instead of start point of polyline. Will be very grateful for replies ) Quote
Lee Mac Posted February 18, 2010 Posted February 18, 2010 Not sure if my Point Manager program can help at all? (Link in my Sig) Quote
ttsadaf Posted February 21, 2010 Posted February 21, 2010 yes very nice lisp..... but this lisp is giving the coordinates like (y,x) it vl be more better if u make it (x,y) ....... waiting for your reply........ i want to say that it is giving y coordinates first and x coordinates next....... can u make it to give it x coordinates and then y coordinates........ Quote
BearDyugin Posted February 21, 2010 Posted February 21, 2010 yes very nice lisp.....but this lisp is giving the coordinates like (y,x) it vl be more better if u make it (x,y) ....... waiting for your reply........ i want to say that it is giving y coordinates first and x coordinates next....... can u make it to give it x coordinates and then y coordinates........ Well, simply I have got confused that X increases upwards (by the North) at us at geodesists, the same X to the right (on the East) in mathematical system of co-ordinates. Therefore here two codes 1) For geodesists ↑x (defun c:geo_koord_leader (/ pod_z koord y x z xyz) (initget "Yes No") (setq pod_z (getkword "\nShow Z [Yes/No] <No>? : ") ) (while (and (setq koord (getpoint "\nPoint <Exit>")) ) (setq y (strcat "Y=" (rtos (nth 0 koord) 2 3)) x (strcat "X=" (rtos (nth 1 koord) 2 3)) z (if (= pod_z "Y") (strcat "Z=" (rtos (nth 2 koord) 2 3)) "" ) ) (VL-cmdf "_leader" koord pause "" x y z "") ) ) (princ "Command name: geo_koord_leader") 2) For all other normal people →x (defun c:math_koord_leader (/ pod_z koord y x z xyz) (initget "Yes No") (setq pod_z (getkword "\nShow Z [Yes/No] <No>? : ") ) (while (and (setq koord (getpoint "\nPoint <Exit>")) ) (setq x (strcat "X=" (rtos (nth 0 koord) 2 3)) y (strcat "Y=" (rtos (nth 1 koord) 2 3)) z (if (= pod_z "Y") (strcat "Z=" (rtos (nth 2 koord) 2 3)) "" ) ) (VL-cmdf "_leader" koord pause "" x y z "") ) ) (princ "Command name: math_koord_leader") Quote
Lee Mac Posted February 21, 2010 Posted February 21, 2010 yes very nice lisp.....but this lisp is giving the coordinates like (y,x) it vl be more better if u make it (x,y) ....... waiting for your reply........ i want to say that it is giving y coordinates first and x coordinates next....... can u make it to give it x coordinates and then y coordinates........ Are you referring to my program suggestion or GeoBuilder's LISP? 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.