Jump to content

Recommended Posts

Posted

hi guys

is there lisp routines can calculate total area of 3d solid box

Posted

The built-in AREA command with Object option will give you the area of 3D solids.

Posted

maybe ....

(defun c:Test (/ val ss i sn)
 (if (setq val 0
           ss  (ssget '((0 . "3DSOLID")))
     )
   (repeat (setq i (sslength ss))
     (setq sn (ssname ss (setq i (1- i))))
     (command "_.area" "" (entlast))
     (setq val (+ (getvar 'area) val))
   )
 )
 (if (not (zerop val))
   (print val)
 )
 (princ)
)

Posted
the built-in area command with object option will give you the area of 3d solids.

than's for quick reply but i need to choose multiple object

Posted
maybe ....

(defun c:test (/ val ss i sn)
 (if (setq val 0
           ss  (ssget '((0 . "3dsolid")))
     )
   (repeat (setq i (sslength ss))
     (setq sn (ssname ss (setq i (1- i))))
     (command "_.area" "" (entlast))
     (setq val (+ (getvar 'area) val))
   )
 )
 (if (not (zerop val))
   (print val)
 )
 (princ)
)

 

thank's very much this working good :D

Posted

I think it's not working at all so good... :

 

(defun c:Test (/ val ss i sn)
 (if (setq val 0
           ss  (ssget '((0 . "3DSOLID")))
     )
   (repeat (setq i (sslength ss))
     (setq sn (ssname ss (setq i (1- i))))
     [color=red](command "_.area" "o" sn)[/color]
     (setq val (+ (getvar 'area) val))
   )
 )
 (if (not (zerop val))
   (print val)
 )
 (princ)
)

 

M.R.

Posted
thank's very much this working good :D

 

You're welcome .

 

But the modification by marko is correct , so please use the one he modified This one

 

 

Thank you marko for your modifications :thumbsup:

 

Thanks

  • Like 1
Posted

thanks makro for modification also thanks to tharwat

Posted

A single call to "Area" command would be enough

 

(defun c:Test2 (/ ss i)
 (if (setq ss (ssget '((0 . "3DSOLID"))))
   (progn
     (command "_.area" "_Add" "_O")
     (repeat (setq i (sslength ss))
(command (ssname ss (setq i (1- i))))
     )
     (command "" "")
     (print (getvar 'Area))
   )
 )
 (princ)
)

  • 6 years later...
Posted
On 4/19/2012 at 4:10 AM, Tharwat said:

 

You're welcome .

 

But the modification by marko is correct , so please use the one he modified This one

 

 

Thank you marko for your modifications :thumbsup:

 

Thanks

any way to export this to excel?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...