I’ve been sitting next to Dana every day for the past week and I seem to have caught a mild case of the blogging disease she’s afflicted with. I don’t know how long it will last, so I figured I better post as much as I can before it wears off and I fall silent again like Charlie Gordon in Flowers for Algernon.Â
One problem often encountered is the difficulty in making a surface from a huge amount of data generated from Lidar topographic surveys. It should be no secret that if you have access to the point file (ascii format will do) you can use the file as data for your surface without importing all the points into your dwg file. Under the Definition collection for your surface, right-click on Point Files, select Add, select format and your ascii file. The result is a surface without all the Point Object overhead. Well, what to do if you don’t have the ascii file? What if you only have a huge dwg with polylines that represent the contours? You use this nifty little bit of code, that’s what…
Of course you know you can build a surface from contour data. But all those vertices weigh heavy on the drawing file size and, more importantly, on drawing performance (pan, zoom, regen, etc). So, you could weed the contour vertices and reduce the data, but you paid for all that data (or someone did) and by god you want to use it all so you get your money’s worth. Wouldn’t be cool if you could write out the XYZ coordinates of each polyline vertex to a ascii file? You could then use the technique described above.
Peter Funk whipped this little macro up while I ran for a cup of coffee. Yes, he’s that good. And after some extra tweaking by Rob Todd (see Jason’s post about Survey extension for a real example of Rob’s mad programming chops), this thing was ready for prime time. Try it and of course, use at your own risk.
- load the macro
- select all the polylines FIRST
- run the macro
- file is saved to C:\polyline.txt
For dwgs with lots of polyline vertices, it can take several minutes to export all the data. However, after that, it takes very little time to create a surface. The data set I was working with had 947,648 vertices. The surface was built in 50 seconds. It took another 60 seconds to apply 1′ contours. Not too shabby. Beware though, looking at a surface this big in Object Viewer will likely cause a crash. Hey, I never said the world was a perfect place.