Search the Community
Showing results for tags 'areas closed polygons'.
-
Help with a lisp - Areas from closed polygons to current (opened) excel file
xxfaxx posted a topic in AutoLISP, Visual LISP & DCL
Hello As you may already know i am new to the forum, but not so new to autocad (been using it almost for 10 years), but i am really new to this autolisp world (and vba for that matter), i am planning in learning a lot of it by myself to automate some work we do. Anyway, i found a lisp that the user "Fixo" (a good soul that used to help noobs like me) wrote about 8 years now. The lisp in question does what i need but with one little problem. It opens a new excel file everytime it is used. I need to get the areas of closed selected polygons to the current and opened excel file, to the cell i have clicked. I hope i am making myself as clear as posible. This is the link to the autolisp file i am refering to (AreasToXL_V3 or V5) if it helps http://www.cadtutor.net/forum/showthread.php?41722-Closed-polyline-Area-values-to-Excel&p=697435#post697435 I could see that the piece of code that opens excel is this one (setq aexc (vlax-get-object "Excel.Application") xbks (vlax-get-property aexc "Workbooks") abks (vlax-invoke-method xbks "Add") xshs (vlax-get-property abks "Sheets") asht (vlax-get-property xshs "Item" 1) xcel (vlax-get-property asht "Cells") ) I am attaching (or at least trying to, because it is my first time attaching something ) two example files. a DWG and an excel one showing the result needed. Thank you very much in advance to anyone who could help at least a little Example.dwg example.xlsx