I am looking for a way to produce a cut/fill report for a group of points to a surface. For example I have a point group of 977 points that are as-built survey points and I want the height of each point in relation to an existing surface (the design surface).
I know I can use the Inquiry Tool and pick one point at a time and do the math, no thanks.
I know I can create a surface from the points and then a volume surface to push the points to, in essence giving the cut/fills. A lot of overhead...
It seems like this should be a simple report for C3D. Am I missing something? Any ideas?
Solved! Go to Solution.
Solved by tcorey. Go to Solution.
The following code will do what you're asking.
;copyright (c)2014 by Timothy Corey ;Delta Engineering Systems, Redding, CA ;Autodesk Authorized Value-Added Reseller ;permission is hereby granted for free use of this program as-is ;or modified to your specifications. ;This program or any portion may not be sold or combined with any ;for-sale software. ;It is the responsibility of the user to debug the software ;to determine its usability and accuracy. ;This program will ask for a reference surface object and a selection set of Civil 3D Points ;a report will then be written, c:\PointDepth.txt, which will list PointNumber, PointElevation, ;SurfaceElevation and DistanceToSurface. Change the file location and name to your specifications. (defun c:go ( / srf vsrf fl pts len ctr p vp pno x y elv srfz depth elvx srfzx output) (setq srf (car (entsel "\nSelect reference surface: ")) vsrf (vlax-ename->vla-object srf) ) (setq fl (open "c:\\PointDepth.txt" "w")) ;change file name and path to your specs (write-line "PointNumber, PointElevation, SurfaceElevation, DistanceToSurface" fl) (prompt "\nSelect points to report: ") (setq pts (ssget) len (sslength pts) ctr 0) (while (< ctr len) (setq p (ssname pts ctr)) (if (= (cdr (assoc 0 (entget p))) "AECC_COGO_POINT") (progn (setq vp (vlax-ename->vla-object p) pno (itoa (vlax-get-property vp 'Number)) x (vlax-get-property vp 'Easting) y (vlax-get-property vp 'Northing) elv (vlax-get-property vp 'Elevation) ) (setq srfz (vlax-invoke-method vsrf 'FindElevationAtXY x y)) (setq depth (rtos (- srfz elv) 2 2)) (setq elvx (rtos elv 2 2) srfzx (rtos srfz 2 2) ) (setq output (strcat pno "," elvx "," srfzx "," depth)) (write-line output fl) ) ) (setq ctr (1+ ctr)) ) (close fl) (princ) )
This looks like something I've been trying to find, but I don't know how to use it. Could you tell me how?
Tim,
Sorry to have bothered you. I didn't know that I don't have write permission to the c drive. I just changed my directory and everything worked like a dream. Thanks for putting this lsp out there fore everyone.
Hey guys,
This lisp routine looks like something I've been looking for however, when I type GO, I cant seem to click on my surface. It says ; error: no function definition:
VLAX-ENAME->VLA-OBJECT
The surface I have is defined by contours only. I'm sure its user error, if you could give me any suggestions they would be greatly appreciated...
Thanks Jeff.
It appears it works however, on half of my points it says ; error: Automation Error. Triangle is deleted. The other half worked fine and they gave me the report (vertical differences) in the command line, is that how it should output the report? Its no problem, just making sure I have it correct.
After editing the path location for the output file, the lisp you created worked great, @tcorey! Thank you for sharing the code on the forums for us to use.
Tom Richardson
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Autodesk Certified Professional in Civil 3D for Infrastructure Design
AutoCAD Certified Professional
------------------------------------
Autodesk AEC Community Blog
Crossing the line with Civil 3D
Twitter | LinkedIn
------------------------------------
Austin CAD User Group Resources
Blog | Discord | LinkedIn
Is it possible to insert as a label near point in drawing, instead of txt report output
Hi,
I tried changing the path the PointDepth.txt file saves to but the lisp does not work.
I get the following error -
error: bad argument type: streamp nil
Please help
it happened to me as i didnt have writing rights to C drive. Make sure to pic folder where you can write.
e.g c:\\Users\\AutoCAD User\\ols\\PointDepth2.txt" "w"
It was the detail for the two "\\" before each folder.
It works now. Thank you
This could be too much to ask but....is it possible to select a point group?
Otherwise, the LISP routine worked just fine.
Thanks!
Would someone please post a screenshot of how you edited the text to make this LISP routine work?
I too am getting the error, "bad argument type: streamp nil"
Thank you!
Good afternoon,
I need a little help - The lisp seems to be working but i cannot seem to display the level difference.
Would you be able to point me in the right direction.
Cheers
Gavin