Spot elevations

Hi all!
Have a CAD file with spot elevations written in text. Is there any way I can make this into a 3D landscape?
Thanks!

Please elaborate on what the CAD file looks like. Or share some similar file here.

If you are able to get the values into a csv file, you can import the points and use TopoShaper e.g. to create the landscape.

All I can see is some line that seem to connect text labels with different values (not the same height).
Other text labels aren’t “even” connected.
If you do have lines representing elevation (contours), you could import the CAD and use the ‘Sandbox’ tool ‘From Contours’ to generate the terrain. It doesn’t seem that way in your case.

Are the dots with text labels on one plane or on elevation in your CAD?
It isn’t all that clear to me.

I once wrote a Lisp routine for AutoCad that read the numbers in such text entities and drew a vertical line to the corresponding height at the location of the texts. That could then be imported into SketchUp and a terrain mesh added with the Sandbox from Contours tool. I remember posting it but couldn’t locate it so it could have been at the older Google-based forum. I don’t have it in my laptop but I can re-post it when I go home tomorrow or on Sunday.

Edit: found it. Here it is, zipped, as .lsp is not a supported file type TXT23D2.zip (633 Bytes)

Anssi

1 Like

Tried uploading the CAD but it is 4MB which is not within the boundaries.
How do I use your file Anssi?

You must have AutoCad.
Unzip the file. Place the txt23d2.lsp file in a folder that is within your AutoCad search path. Alternatively you can use the Appload command and navigate to the file.
type (load “txt23d2”) in the command line follopwed by Enter.
type txt23d and Enter
Select the text objects
Enter a scale factor (if the survey texts are in a different unit than your DWG, mine are often in meters while I use millimeters, so I would use 1000)

The result should be a “forest” of vertical lines.

Anssi

did not work for me. This is the Autocad file. I have autocad.

Drawing1.zip (443.9 KB)

This is the text files however I cannot get it into sketchup as a topography no matter what.

Here’s your CSV back with just X,Y,Z values.
Drawing1CSV.zip (76.7 KB)
However, the Z value is always 0 ?
I also assume the large numbers are mm ??
The output will always be 2d - there is no ‘elevation’ with a constant Z=0.

Incidentally your DWG link goes to a BAK file - this needs renaming DWG…
It’s a also contains lots of unnecessary data…

You need to cut it down to just the text giving the 2d spot-heights.
Then run the lisp code to make a file with the height taken as the text, with the XY from the texts’ positions

Sorry to be late with an answer. My lisp is a bit old but it should just ignore any non-text objects selected. On the other hand, it works only with old-style text objects, Mtext-s need to be exploded before running it.

I would have tried to run it for you but I will have access to Autocad only next week.

Anssi

A possible issue is that the text for each height is in the form “1 234”
With a separate + block in the space.
The AutoLisp code might not cope well with making a float from such a string as it’ll become 1.0 not 1.234 ?
I suppose the space could be replaced by . before doing the processing…

Anssi,

Thank you for your help.

The “forest” of vertical lines has been created in Sketchup but I cannot work out what to do now…

i.e. how do I join them up? Points are not generated at the top of the each line in order for “pnts2mesh.rb” (for example) to work…

I’m dealing with c. 5,000 lines and so I can’t manually connect the top of each line.

I’ve done all this before but I just cannot remember!

Thanks a lot in advance

You can select the lines and try the “Sandbox from contours” tool. It might take a long time. Contrary to what you would expect, the tool works on any geometry, not just traditional contour lines.

Anssi

I have sandbox but there is no contours tool. Any idea how I can use it?

Spot.zip (2.5 MB)

This is the file. The spot elevations are under ex heights.

Anssi,

Thank you so much. All worked perfectly!

Is there a way to replace the space with a dot? That way I could scale 1000 and problem would be solved.
Thanks.

You need to add some lines of AutoLisp to process each read in Text’s string and replace ’ ’ with ‘.’
There are several websites explaining this…

this is quite easy to understand:
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/files/GUID-D8EE91DC-D4DB-43E0-9AFE-5FA166C0896D-htm.html
e.g.

(vl-string-subst "." " " "1 234")
>>>
"1.234"

When batch processing several elements, then the third argument is the string reference relating to that text-element, you need to setq it to become the new string, that is then tof processed and used in the point’s Z value later…