ayman_48 Posted April 19, 2012 Share Posted April 19, 2012 hi guys is there lisp routines can calculate total area of 3d solid box Quote Link to comment Share on other sites More sharing options...
MSasu Posted April 19, 2012 Share Posted April 19, 2012 The built-in AREA command with Object option will give you the area of 3D solids. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 19, 2012 Share Posted April 19, 2012 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) ) Quote Link to comment Share on other sites More sharing options...
ayman_48 Posted April 19, 2012 Author Share Posted April 19, 2012 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 Quote Link to comment Share on other sites More sharing options...
ayman_48 Posted April 19, 2012 Author Share Posted April 19, 2012 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 Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted April 19, 2012 Share Posted April 19, 2012 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 19, 2012 Share Posted April 19, 2012 thank's very much this working good 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 Thanks 1 Quote Link to comment Share on other sites More sharing options...
ayman_48 Posted April 19, 2012 Author Share Posted April 19, 2012 thanks makro for modification also thanks to tharwat Quote Link to comment Share on other sites More sharing options...
pBe Posted April 19, 2012 Share Posted April 19, 2012 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) ) Quote Link to comment Share on other sites More sharing options...
cadcondesign1 Posted February 13, 2019 Share Posted February 13, 2019 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 Thanks any way to export this to excel? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.