toxicsquall Posted July 10, 2019 Posted July 10, 2019 I'm having a problem getting a Z coordinate from a point or a object, like a 3dPolyline. I need to put a text in front of it. I have this one, but it only gets the X and Y coordinates and I just need the Z coordinate. Quote (defun C:incoord (/ pc) (setq pc (getpoint "\nClick on the point: ")) (while pc (##InsTextCoord pc) (setq pc (getpoint "\nNext Point [Or <Enter> to end]: ")) ) (princ) ) (defun ##InsTextCoord (ponto / px py) (setq px (car ponto)) (setq py (cadr ponto)) (command ".text" ponto "" "" (strcat "X= " (rtos px) ", Y= " (rtos py))) ) (princ "\n INCOORD to start") (princ) Quote
Emmanuel Delay Posted July 10, 2019 Posted July 10, 2019 (defun C:incoord (/ pc) (setq pc (getpoint "\nClick on the point: ")) (while pc (##InsTextCoord pc) (setq pc (getpoint "\nNext Point [Or <Enter> to end]: ")) ) (princ) ) (defun ##InsTextCoord (ponto / px py pz) (setq px (car ponto)) (setq py (cadr ponto)) (setq pz (caddr ponto)) (command ".text" ponto "" "" (strcat "X= " (rtos px) ", Y= " (rtos py) ", Z= " (rtos pz) )) ) (princ "\n INCOORD to start") (princ) 1 Quote
dlanorh Posted July 10, 2019 Posted July 10, 2019 You could just (defun c:incoord (/ pc) (while (setq pc (getpoint "\nClick on the point or Enter to End : ")) (command ".text" pc "" "" (strcat "Z = " (rtos (caddr pc)))) ;(command ".text" pc "" "" (strcat "X = " (rtos (car pc)) ",Y = " (rtos (cadr pc)) ",Z = " (rtos (caddr pc)))) ) (princ) ) (princ "\nType incoord to start") (princ) If you want X,Y & Z comment out the first (command ".text" ....) and uncomment the second (command ".text" ....) Quote
toxicsquall Posted July 10, 2019 Author Posted July 10, 2019 THANK YOU SO MUCH!!!! The last one worked exactly as i wish for. 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.