Loidy Posted July 26, 2020 Posted July 26, 2020 Hello, i'm pretty new here and I don't have idea about making lisp. I would like to request an edit of this lisp file ( LAYLENGTH -Sum Line Length and arrange in table by layer.LSP) I do not own this, and I forgot where did I download it (credits to him/her). This is what exactly i'm looking, but I also want to get the TOTAL AREA / TOTAL VOLUME / TOTAL COUNT or QUANTITY by just selecting/dragging all the items at once, and the result will be displayed in TABLE related to LAYERS, just like this LAYLENGTH FILE. I don't mind if they are in separate lisp file. I hope you guys could help me. Thank you in advance. God Bless, Stay Safe Quote
BIGAL Posted July 27, 2020 Posted July 27, 2020 (edited) A 1st step You can add the area after d (vlax-curve Need to add a check is the property area obtainable for the object, as a Line has no area so use a IF (if (= "AcDbLine" (vla-get-objectname)) (setq area 0.0) (setq area (vla-get-area (vlax-ename->vla-object ent))) ) 2nd Step need to probably do a check of layer name in list and do totals writing to table when layer name changes. Lastly a google should find what you want its a common request. Edited July 27, 2020 by BIGAL 1 Quote
Jonathan Handojo Posted July 27, 2020 Posted July 27, 2020 (edited) @BIGAL (vlax-property-available-p vlaobj 'Area) is a stronger check, so that it would work on all object that you selected having the "Area" property. Edited July 27, 2020 by Jonathan Handojo 1 Quote
devitg Posted July 27, 2020 Posted July 27, 2020 Please upload your sample.dwg where you want to apply such lisp 1 Quote
Loidy Posted July 27, 2020 Author Posted July 27, 2020 sorry sir, I don't have idea in editing. here is my cad 2010 file and I found a LAYAREA.TXT however, it cannot compute the region of an exploded volume (although i tried to add the REGION word inside those lines,plines,circle... I'm getting error. Thank you for reply LISP REQUEST SAMPLE.dwg LAYAREA.txt Quote
ronjonp Posted July 27, 2020 Posted July 27, 2020 8 hours ago, Jonathan Handojo said: @BIGAL (vlax-property-available-p vlaobj 'Area) is a stronger check, so that it would work on all object that you selected having the "Area" property. I use vlax-curve-getarea since it can cover more object types and it can be passed an ename (defun _getarea (e / a) (if (vl-catch-all-error-p (setq a (vl-catch-all-apply 'vlax-curve-getarea (list e)))) 0. a ) ) ;; (_getarea (car (entsel))) 1 Quote
BIGAL Posted July 28, 2020 Posted July 28, 2020 Ronjonp & Johnathon I just looked at (setq ss (ssget ":L" '((0 . "LINE,POLYLINE,LWPOLYLINE,ARC,CIRCLE,ELLIPSE,SPLINE")))) in code the line is only one with no area. But for reliability a check for area property is worthwhile. 1 Quote
Loidy Posted July 28, 2020 Author Posted July 28, 2020 I appreciates everyone's feedback, however, I don't know what to do or where should I input those codes/syntax you guys gave me. I found this SAL.LISP which gives me the area (even the region what I wanted) however, the inputing of scale factor and copying the data into excel, i need to separate each layer and numbers in excel (too many things to do), unlike the automatic table like LAYLENGTH. Thanks again everyone. SAL.LISP.txt 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.