AJSmith Posted February 11, 2011 Posted February 11, 2011 is it possible to select a number of objects and get the info for them. Such as a number of polylines forming areas and getting the total area or the very least a list of the individual areas. Answers on a post card please. Quote
ReMark Posted February 11, 2011 Posted February 11, 2011 Yes it is. Search this site for lisp routines. Small enough? Quote
AJSmith Posted February 11, 2011 Author Posted February 11, 2011 thanks but i should of said its for an LT user? Quote
ReMark Posted February 11, 2011 Posted February 11, 2011 Yep, should have. No autolisp. Need macro. Quote
Smirnoff Posted February 11, 2011 Posted February 11, 2011 thanks but i should of said its for an LT user? That's a pity. But may be for full version users: (defun c:surea(/ iCnt cCur cAre oNam tAre) (vl-load-com) (setq iCnt 0 tAre 0.0) (princ "\n<<< Pick curves to measure areas, Spacebar for Total >>>") (princ "\n---------------------------------------------------- ") (while(setq cCur(entsel "")) (princ(strcat "\n" (itoa(setq iCnt(1+ iCnt))) " ")) (if(or (vl-catch-all-error-p (setq cAre(vl-catch-all-apply 'vlax-curve-getArea (list(car cCur))))) (= 0.0 cAre) ); end or (princ "\n<!> Can't measure area for this entity <!> ") (progn (setq oNam(substr(vla-get-ObjectName(vlax-ename->vla-object(car cCur)))5)) (princ " ") (repeat(- 4(strlen (itoa iCnt)))(princ " ")) (princ oNam) (repeat(- 10(strlen oNam))(princ " ")) (princ(rtos cAre)) (if(not(vlax-curve-isClosed(car cCur))) (princ " (non closed!)") ); end if (setq tAre(+ tAre cAre)) ); end progn ); end if ); end while (textscr) (princ "\n---------------------------------------------------- ") (princ(strcat "\nTotal entities: " (itoa iCnt) ", Total area = " (rtos tAre))) (princ) ); end of c:surea Usage example: [color="#800080"]<<< Pick curves to measure areas, Spacebar for Total >>> ---------------------------------------------------- 1 Polyline 44421990.2003 2 Polyline 12365838.5665 3 Polyline 64633994.1523 (non closed!) 4 Arc 19236282.9623 (non closed!) 5 Ellipse 29217657.8478 6 Circle 34015807.281 7 Polyline 44421990.2003 ---------------------------------------------------- Total entities: 7, Total area = 248313561.2107[/color] Quote
ReMark Posted February 11, 2011 Posted February 11, 2011 Try this website for AutoCAD LT macros: http://ltunlimited.typepad.com/my_weblog/ Another AutoCAD LT help site: http://ltisacad.blogspot.com/2010/05/lt-2011-help.html Quote
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.