Jump to content
toxicsquall

Get Z coordenate from a point or 3Dpolyline

Recommended Posts

toxicsquall

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)

 

 

Share this post


Link to post
Share on other sites
Emmanuel Delay


(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)

  • Like 1

Share this post


Link to post
Share on other sites
dlanorh

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

Share this post


Link to post
Share on other sites
toxicsquall

THANK YOU SO MUCH!!!!

The last one worked exactly as i wish for.

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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