Author Topic: Tough Questions - Volume Lisp  (Read 3908 times)

0 Members and 1 Guest are viewing this topic.

johnshar123xx

  • Guest
Tough Questions - Volume Lisp
« on: November 30, 2009, 03:03:57 PM »
Tough Questions - Volume Lisp


AutoCAD 2007
I have a quite a few tough questions/requests and I am currently looking for some lisps to solve them.  I have been doing some searching online to find the lisps I need, and although I have been able to find some stuff, I still have some things that I can't seem to find exactly what I am looking for.  I would like to take the opportunity ahead of time to thank every who views my questions and for any help that is given.


I am looking for a lisp that will allow me to select a closed polyline shape and have it ask the depth and have the lisp calculate the volume of the area within the closed polyline shape.  If someone wants to get really crazy, it would be really amazing to be able to select multiple closed polyline shapes within each other that have z elevations set to them for example the grading of a pond per say.  Where the lisp would be able to calculate the volume of the pond, based on the grading shapes (closed polylines) within each other and the "Z" elevations set to them.  I have included a grading drawing of a pond, for an example.

Is anyone up for the challenge?

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Tough Questions - Volume Lisp
« Reply #1 on: November 30, 2009, 03:04:54 PM »
It sounds like what you REALLY need is Civil 3D (or Map).
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Lee Mac

  • Seagull
  • Posts: 12928
  • London, England
Re: Tough Questions - Volume Lisp
« Reply #2 on: November 30, 2009, 03:06:08 PM »
What is this... a shopping list?

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Tough Questions - Volume Lisp
« Reply #3 on: November 30, 2009, 03:07:15 PM »
What is this... a shopping list?
The holidays ARE rapidly approaching!
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

jromkes

  • Guest
Re: Tough Questions - Volume Lisp
« Reply #4 on: November 30, 2009, 03:08:25 PM »
Maybe you should try to learn lisp yourself. You have a great need for it

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Tough Questions - Volume Lisp
« Reply #5 on: November 30, 2009, 03:34:08 PM »
Maybe you should try to learn lisp yourself. You have a great need for it
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Lee Mac

  • Seagull
  • Posts: 12928
  • London, England
Re: Tough Questions - Volume Lisp
« Reply #6 on: November 30, 2009, 03:44:03 PM »
Maybe you should try to learn lisp yourself. You have a great need for it

second

SomeCallMeDave

  • Guest

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Tough Questions - Volume Lisp
« Reply #8 on: December 01, 2009, 09:21:45 AM »
It sounds like what you REALLY need is Civil 3D (or Map).
Ditto.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

johnshar123xx

  • Guest
Re: Tough Questions - Volume Lisp
« Reply #9 on: December 02, 2009, 03:49:13 PM »
Thanks for all the opinions, I guess.
Special thanks to David Blackmon for help with an answer.  I am currently trying to test that lisp out, as of now can't tell if it works or not.  Once I test it out more I will let everyone know how it works.
Thanks again

JCTER

  • Guest
Re: Tough Questions - Volume Lisp
« Reply #10 on: December 02, 2009, 03:52:14 PM »
You know... if you have closed polys at their correct Z elevation, you could just use the LOFT command, introduced in 2007, to create a solid from those cross sections, and in the properties of this new object, it'll tell ya the volume.  Pretty sure it tells you the volume there, I'm too lazy to test it.  If it doesn't show it there, I -know- it'll show it on the MASSPROP readout, amongst 103854 other stats for the object that you would never care about.

johnshar123xx

  • Guest
Re: Tough Questions - Volume Lisp
« Reply #11 on: December 09, 2009, 09:49:28 AM »
Another Success Story

I have been able to test out both methods given and they both have there uses and they both work great.  These are exactly what I was looking for.

Special thanks to David Blackmon for creating this lisp a while back and for being willing to share and to James Cannon for supplying the 3d method of using the LOFT command.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Tough Questions - Volume Lisp
« Reply #12 on: December 09, 2009, 12:01:14 PM »
If you're using extrusions. this may help you:

Code: [Select]
(defun c:ext2slp (/ x y ss)
  (if (and (setq x (getdist "\nEnter height (Y value):"))
  (setq y (getdist "\nEnter slope (X value):"))
  (setq ss (ssget))
      )
    (command "._extrude" ss "" "_taper" (- (* 180. (/ (atan x) pi))) y)
  )
  (princ)
)

And this will add the volume of multiple solids:

Code: [Select]
(defun c:vol (/ ss)
  (if (setq ss (ssget '((0 . "3dsolid"))))
    (alert (strcat
     "Total Volume: "
     (rtos (apply '+
  (mapcar (function (lambda (x) (vla-get-volume x)))
  (mapcar 'vlax-ename->vla-object
  (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
  )
  )
   )
     )
   )
    )
  )
  (princ)
)
« Last Edit: December 09, 2009, 12:11:54 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC