Jump to content

total area of 3d solid


ayman_48

Recommended Posts

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)
)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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)
)

Link to comment
Share on other sites

  • 6 years later...
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?

Link to comment
Share on other sites

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...