Hey everyone,
Anyone know of a command that can calculate volumes of 3d shapes?
Thanks for any help!
|
Hey everyone,
Anyone know of a command that can calculate volumes of 3d shapes?
Thanks for any help!
Try this:
Code:(defun c:3DVOL (/ eName 3dObj) (vl-load-com) (if (and (setq eName (car (entsel "\n >> Select 3D Object for Current Volume: "))) (= "3DSOLID" (cdr (assoc 0 (entget eName)))) (vlax-property-available-p (setq 3dObj (vlax-ename->vla-object eName)) 'volume)) (princ (strcat "\n <!> 3D Volume = " (rtos (vla-get-volume 3dObj) 2 2) " <!> "))) (princ))
Last edited by RenderMan; 2010-09-28 at 04:31 PM. Reason: Renamed the command from c:FOO to c:3DVOL
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA
So....anyone know of another way to find the volume of 3D shapes!?
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA
No, what exactly are you recommending I type in the command box????
I've provided you a LISP routine, which when loaded into AutoCAD provides you a keyboard command that does exactly what you want.
To make this a little easier for you, I've uploaded a .LSP file that you can download, and have renamed the command from FOO (a common test function name) to 3DVOL (what you should enter at the command line shortly).
For starters, I'd like you to test the routine to make sure you understand it's use, and if you want to keep it (this is your decision), I'll gladly help you make it available to you at all times.
So to make the 3DVOL command available, open AutoCAD, and drag the downloaded file (from Windows Explorer) into your drawing area (either in Modelspace, or Paperspace, i.e., Not on a toolbar, etc.). Then enter 3DVOL at the command line and hit Enter... follow the prompts.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA
Ok, I drug the file from my desktop into the model space. It verified it was loaded in the command box. Once I typed "3DVOL" it prompted me to "select 3D object for current volume". Once I selected the object no other prompts were given.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA
Sure...hope this helps. It gave me some trouble saving to 07, not sure how much of this is compatible. I am working with Civ 3D 2010.
The routine works for me, William.
I've revised the code to permit selecting multiple 3DSOLID's, and returning a Total Volume.
Enjoy!
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA