Author Topic: Help volume between surfaces  (Read 802 times)

0 Members and 1 Guest are viewing this topic.

nekonihonjin

  • Newt
  • Posts: 103
Help volume between surfaces
« on: July 10, 2022, 10:03:09 PM »
Hey guys I'm trying to make a lisp to automate a series of steps I do to calculate the volume contained between two surfaces.
These surfaces were generated from the TriangV0.6.7 lisp, along with their outer boundaries with the help of the XSHAPE command, also part of the same lisp.
I attach a file showing the steps I follow to obtain such a volume. I attach also what I was able to automate but it is still missing a lot and honestly it is all I understand about lisp.
I would appreciate if you can help me to automate it completely.


Code: [Select]
(defun C:volumen( / upsurf lowsurf upborder lowborder)
(PROMPT "UPPER SURFACE")
(setq upsurf (ssget))
(PROMPT "LOWER SURFACE")
(setq lowsurf (ssget))
(setq upborder (entsel "\nUpper surface border: "))
(setq lowborder (entsel "\nLower surface border: "))
(command "_copy" upsurf "" "_D" "0,0,-500")
(command "_copy" lowsurf "" "_D" "0,0,500")
(command "_move" upborder lowborder "" "_D" "0,0,-1000")
(command "_extrude" "_MO" "_SU" upborder lowborder "" "2000")


(command "_selectsimilar" upsurf "") ; (I can't use another command after selecting here)


(princ)

)


ribarm

  • Gator
  • Posts: 3264
  • Marko Ribar, architect
Re: Help volume between surfaces
« Reply #1 on: July 10, 2022, 10:51:08 PM »
I haven't checked DWG, but I believe you could try to convert 3DFACE entities - if from Triang*.lsp to REGION entities and then create union surface with just UNION command... Then with SURFACE entities you could try SURFSCULPT or similar... For upper/lower borders I don't know as I don't have CAD on this Laptop for checking... Perhaps you don't have SURFSCULPT, but if you need calculation, you could do it and by math... For sure you can, but if you need visual confirmation, then also EXTRUDE is the way to do it... There are several ways : create simple planar triangle from each 3DFACE; extrude it; SLICE it - capping and perform MASSPROP...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

nekonihonjin

  • Newt
  • Posts: 103
Re: Help volume between surfaces
« Reply #2 on: July 10, 2022, 11:19:51 PM »
Thanks for the quick reply ribarm, I will try the region, it sounds simpler than what I do. I don't need the visual, if you can calculate the volume just by selecting the surfaces it's better, but I think it would involve more complex code and it's even further out of my reach.