Jump to content

Z values of points


Recommended Posts

Hello to all, does anybody know of a way to:.........

Basically I have received a file from my client containing all the spot elevations of a surveyed area. These spot elevation (points) are nothing more than text where the insertion point is a northing, easting and an elevation. Unfortutely all of the Z values (elevations) are set to zero, which means I cannot create a contour drawing out of these points. So what I am asking is if there is a way to move all of these text contents to its equivalent z values.

I have more than 15 thousand points and doing it one by one is not a task that could easily be done.

Many thanks...

points.JPG

Zvalues.dwg

Edited by Nardino
Link to comment
Share on other sites

Can you post the drawing, or even just a sample of some of the points as you have them now, I would imagine it is possible to get all the point text into excel and from there create a script to insert the text back along with a point at the correct elevation, but someone will need to see the text properties.

Link to comment
Share on other sites

Something like this, The details were taken out of Autocad by selecting all the text and using the "list" command, it helps to have "qaflags=2" and also having log files enabled in Autocad options, which creates a txt file that holds the complete command history for each drawing, which can be copied and pasted into excel.

I couldn't include the whole spread sheet because the file size was too big, but it should give you the idea, I then filtered the sheet just to show the relevant rows and copied the cells with the "point" formulas Ctrl+c.

Then goto the drawing and make sure you click into the command line so that it is active and press Ctrl+v, and just wait a minute for the script to run. It probably took about 20 minutes to do this for 2400 points, 15000 would only add a minute or two.

points1.xlsx

Zvalues1.dwg

Link to comment
Share on other sites

here is a lisp the only thing is it uses the insert point as the point location. This makes points with a Z value. This problem has been around a long time look at code date.

 

; converts text to a point with xyz 
; z value equal to text
; by Alan H Nov 99

(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)

(while (not (setq ss (ssget))))     

(command "layer" "new" "txthts" "")
(setvar "clayer" "txthts")
(setvar "pdsize" 3)
(setvar "pdmode" 35)

(while (setq en (ssname ss 0))
    ; Entity type
    (setq entyp (cdr (assoc 0 (entget en)))) 

   (if (= entyp "TEXT")
   (progn
   (setq xyz (cdr (assoc 10 (entget en))))
   (setq txtht (cdr (assoc 1 (entget en))))
(princ txtht)
   (setq txtz (atof txtht))

   (setq ptxyz (list (car xyz)(cadr xyz) txtz))
   (command "point" ptxyz)
   )                         
   )                              
   ; Delete each measured entity from set
   (ssdel en ss)
;end while
)

(setvar "osmode" oldsnap)

(princ)

Link to comment
Share on other sites

Are these texts are on correct position ? You can extract coordinates of text position in excel and draw them back into cad as points

Link to comment
Share on other sites

The x and y position are correct. It is the z value that is at 0, which is incorrect. Anyway thanks to steven-g and bigal the problem has been solved.

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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