View Full Version : Convert text entitys to x,y,z
Paul Mc
18th Jan 2006, 04:42 pm
I'm looking for an add-on or a lisp program that will take a piece of text, for example the annotation is 115.234, and convert it into either a point using the insertion of the text as x,y and 115.234 as z. OR just move the z value on the selected text to 115.234.
If anyone can help me find this I would be geately appreciated.
Paul
paulmcz
18th Jan 2006, 05:14 pm
(defun c:mz (/ ss base dest)
(setq ss (ssget))
(setq base '(0 0 0))
(setq dest '(0 0 115.234))
(command "move" ss "" base dest)
)
Is this what you had in mind?
Paul Mc
18th Jan 2006, 06:11 pm
That isn't exactly what I'm looking for. The script above would work for changing the Z values all to 115.234 but I'm wanting to change the Z value to whatever the text reads.
I've got an existing drawing which contains only text, all elevations, and need to create a DTM surface. The text are all numbers. To create this 3D surface, I'll need to create a new point at the insertion of the text and apply a Z value of whatever the text reads. My problem is that there are over 500 pieces of text and this would take a considerable amount of time. Using some add-on or lisp routin would greatly help.
David Bethel
18th Jan 2006, 07:28 pm
(defun c:mvtxt (/ ss en ed i)
(while (not ss)
(princ "\nSelect Text To Move: ")
(setq ss (ssget '((0 . "*TEXT")))))
(setq i (sslength ss))
(while (not (minusp (setq i (1- i))))
(setq en (ssname ss i)
ed (entget en))
(if (not (zerop (atof (cdr (assoc 1 ed)))))
(command "_.CHANGE" en "" "_P" "_E" (atof (cdr (assoc 1 ed))) "")))
(prin1))
The gotcha here is if the text value is 0.00. It would take a good bit of trapping to sort that out. -David
Paul Mc
18th Jan 2006, 07:57 pm
Thanks David,
It works! If the value is 0 then it wouldnt matter because the default elevation is 0 therefore no change.
Thanks again,
Paul
kyuudousha
3rd May 2006, 01:31 pm
Hello!
I have just tried the lisp routine that you have here and it seems to work okay, however*, when I view the drawing in any 3D mode the numbers all appear to be on the same plane.
In the properties box it tells me that I have 'Z' values but I just can't see them...
What have I done wrong?
We are now using Civils 3D and this little routine is really handy for converting 2D survey drawings into 3D terrain.
Many thanks
Kyu
*Didn't you just know that was coming?
CarlB
3rd May 2006, 06:55 pm
Maybe the differences in z value are small relative to horizontal scale, thus it would be difficult to "see" elevation variations.
kyuudousha
4th May 2006, 10:27 am
Never thought of that, will give it a go....
kyuudousha
4th May 2006, 10:30 am
Thanks CarlB, it works now, I must have had a moment of Bafoonary... :oops:
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.