Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XYZ Lisp Routine for giving me the coordinates of a 3d point in text form

9 REPLIES 9
Reply
Message 1 of 10
cmiro
19438 Views, 9 Replies

XYZ Lisp Routine for giving me the coordinates of a 3d point in text form

I need a lisp routine that enables me to click on a 3d polyline point and is able to provide me a line then text with the X=?? Y=?? Z=?? coordinates of that point. I have found something but doesnt do it very well. I am using 2008 and need help asap.

Thank you!

PS. I do understand lisps but do not know how to code one up quick enough.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: cmiro

Hi,

The next little snipet should give you a start:

;;;========================
(defun c:txtcoords ( / pt)
(if (setq pt (getpoint "Select point: "))
(prompt
(strcat
"\n"
"X=" (rtos (car pt))
" ; "
"Y=" (rtos (cadr pt))
" ; "
"Z=" (rtos (caddr pt))
)
)
)
(princ)
)
;;;========================

HTH

--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.


a écrit dans le message de news: 6218844@discussion.autodesk.com...
I need a lisp routine that enables me to click on a 3d polyline point and is
able to provide me a line then text with the X=?? Y=?? Z=?? coordinates of
that point. I have found something but doesnt do it very well. I am using
2008 and need help asap.

Thank you!

PS. I do understand lisps but do not know how to code one up quick enough.
Message 3 of 10
gilsoto13
in reply to: cmiro

Here is a routine that will draw a leader using the current dimscale.. and the current text style and height... It will ask you for the 3 points to draw the leader... the first point is going to be the required for the coodinates, and you can select it just by having the osnap set with "node", then the coordinates will appear as a mtext with 3 lines, x, y, and Z..

You can change the leader by a lwpolyline or 2 lines inside the lisp.
Message 4 of 10
gilsoto13
in reply to: cmiro

Sorry I posted a simple leader... here is the coordinates lisp descripted above.
Message 5 of 10
zrehman
in reply to: gilsoto13

hello

this is very help full lisp but i have a file in millimeter and i need a coordinates in meters with out scale the drawing,

 

please help me,

 

thanks

Message 6 of 10
paullimapa
in reply to: zrehman

just change the following 3 lines of the code from:

(setq px (rtos (nth 0 p1 ) 2 4))
(setq py (rtos (nth 1 p1 ) 2 4))
(setq pz (rtos (nth 2 p1 ) 2 4))

 

to:

(setq px (rtos (/ (nth 0 p1 ) 1000) 2 4))
(setq py (rtos (/ (nth 1 p1 ) 1000) 2 4))
(setq pz (rtos (/ (nth 2 p1 ) 1000) 2 4))

 

 

Area Object Link | Dwg Setup | Feet-Inch Calculator | List on Steroids
Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 7 of 10
zrehman
in reply to: paullimapa

Thanks Mr. Paul Li

Message 8 of 10
paullimapa
in reply to: zrehman

Message 9 of 10
19jjh71
in reply to: paullimapa

Hi I really like your lisp for placing coordinates. Can you tell me how I can specify the text size? I have tried setting the dwg textsize before I use your lisp but seems to make no difference.

 Thanks for your help.

James

Message 10 of 10
Kent1Cooper
in reply to: 19jjh71


@19jjh71 wrote:

Hi I really like your lisp for placing coordinates. Can you tell me how I can specify the text size? I have tried setting the dwg textsize before I use your lisp but seems to make no difference.

....


I assume, from the fact that setting the current text size for the drawing doesn't do it, that you're using the second of gilsoto13's routines [whether incorporating pli's adjustments or not], which uses a Leader, rather than Text as in the first one.  Set a Dimension Style or MultiLeader Style [depending on your version] with the appropriate text height as the current one [or build the setting of that into the routine].

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost