View Full Version : LISP Routine for volume & weights of 3D Solids
mishman
2020-02-11, 03:40 PM
We know that we can get the mass/volume of a 3D object in AutoCAD using the massprop tool. We know that in order to determine what the weight of the solid would be is to multiply the volume times the density of the material that the solid represents. Jeffry Sanders posted on his website a LISP routine he created that would report the weight via DCL by selecting from various materials and selecting a 2D area then providing input for thickness of material. This is a nice routine, however I could really use a similar routine for just selecting a 3D Solid Object, no 2D area or thickness. I'd like the same interface of setting units and selecting materials. I have reached out to Jeffry Sanders via jps@jefferypsanders.com several times with no response. Attached zip contains the original .lsp and .dcl files and a pdf showing the interface and describing what I'd like to see. An even better setup would be for the routine to use a separate list file for the materials, that way I could easily update the materials as needed. I am not good enough with LISP to make such a modification, can anyone modify the original files for me to accomplish what I am looking for?
BIG-AL
2020-02-16, 11:51 PM
Its so easy so multiply by your material density.
(setq obj (vlax-ename->vla-object (car (entsel "pick object "))))
(setq vol (* (vlax-get Obj 'volume) matdense))
peter
2020-02-17, 04:38 PM
I have a routine that allows the user to enter densities to materials in a dialog and select solids or blocks with nested solids and calculate the weight and centroid of the assembly.
If you like I can share it with you if you send me a personal message with your email address.
shadashiindia770168
2020-02-18, 04:15 AM
We know that we can get the mass/volume of a 3D object in AutoCAD using the massprop tool. We know that in order to determine what the weight of the solid would be is to multiply the volume times the density of the material that the solid represents. Jeffry Sanders posted on his website a LISP routine he created that would report the weight via DCL by selecting from various materials and selecting a 2D area then providing input for thickness of material. This is a nice routine, however I could really use a similar routine for just selecting a 3D Solid Object, no 2D area or thickness. I'd like the same interface of setting units and selecting materials. I have reached out to Jeffry Sanders via jps@jefferypsanders.com several times with no response. Attached zip contains the original .lsp and .dcl files and a pdf showing the interface and describing what I'd like to see. An even better setup would be for the routine to use a separate list file for the materials, that way I could easily update the materials as needed. I am not good enough with LISP to make such a modification, can anyone modify the original files for me to accomplish what I am looking for?
Use this: 3DSolidBox (https://www.kdmsoft.net/3dsolidbox.html)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.