Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cut/Fill Report For Point Group to Surface

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
mabbas
2203 Views, 18 Replies

Cut/Fill Report For Point Group to Surface

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?

18 REPLIES 18
Message 2 of 19
tcorey
in reply to: mabbas

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

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 3 of 19
mabbas
in reply to: tcorey

I will give it a try.  Thanks!

Message 4 of 19
jamesbarnett
in reply to: tcorey

This looks like something I've been trying to find, but I don't know how to use it. Could you tell me how?


AutoCAD Civil 3D 2022
Message 5 of 19
tcorey
in reply to: jamesbarnett

Save the code to a file with .lsp extension. Copy and paste into Notepad would work.

Use Appload command to load the program.

After loading, type GO to make it run. If you still have trouble, I will be at my desk tomorrow afternoon, 530-221-2994, and you can give me a call.


Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 6 of 19
jamesbarnett
in reply to: tcorey

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.


AutoCAD Civil 3D 2022
Message 7 of 19
PLSNV
in reply to: tcorey

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

Message 8 of 19
Jeff_M
in reply to: PLSNV

Add the line:
(vl-load-com)
to the very beginning of the file.
Jeff_M, also a frequent Swamper
EESignature
Message 9 of 19
PLSNV
in reply to: Jeff_M

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.

Message 10 of 19
PLSNV
in reply to: PLSNV

Nevermind, I appreciated your help. 

My points were outside the surface...

Message 11 of 19
C3D_TomR
in reply to: tcorey

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.

EESignature
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

Autodesk Group Network Leader

Message 12 of 19
parwinder99QSKKP
in reply to: tcorey

Is it possible to insert as a label near point in drawing, instead of txt report output

Message 13 of 19
talldrinBX7D5
in reply to: tcorey

@tcorey 

I keep getting an error when I try to run the LISP.

 

; error: bad argument type: streamp nil

 

I think it has something to do with writing to the text file.

 

Any help would be appreciated.

Message 14 of 19
trobinsonXGGBZ
in reply to: tcorey

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

Message 15 of 19

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"

Message 16 of 19

It was the detail for the two "\\" before each folder.

It works now. Thank you

Message 17 of 19
cruzgo
in reply to: trobinsonXGGBZ

This could be too much to ask but....is it possible to select a point group?

Otherwise, the LISP routine worked just fine.

Thanks!

Message 18 of 19
akeicher
in reply to: C3D_TomR

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!

Message 19 of 19
gavin.murby
in reply to: tcorey

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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report