Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sum of Hatch Areas - Lisp Routine Modification.

27 REPLIES 27
Reply
Message 1 of 28
cad77
18309 Views, 27 Replies

Sum of Hatch Areas - Lisp Routine Modification.

Hello,

Can someone help me modify this lisp routine to sum the hatch areas it calculates?

I would like to be able to select the hatches one at a time or with a window and have the sum of the areas displayed.

Thanks to Daniel J. Altamura for the following routine: (discovered at http://discussion.autodesk.com/thread.jspa?messageID=5536798 )



(defun c:HatchArea (/ ENT)
(if (>= (atof (substr (getvar "acadver") 1 4)) 16.2)
(progn
(while (not (setq ENT (entsel "\nSelect hatch: ")))
(prompt "\nNo object selected.")
)
(setq ENT (entget (car ENT)))
(if (= (cdr (assoc 0 ENT)) "HATCH")
(progn
(setq ENT (vlax-ename->vla-object (cdr (assoc -1 ENT))))
(alert
(strcat
"\nArea = "
(if (or (= (getvar "lunits") 3) (= (getvar "lunits") 4))
(strcat
(rtos (vla-get-area ENT) 2)
" sq. in. ("
(rtos (/ (vla-get-area ENT) 144) 2)
" sq. ft.)"
)
(rtos (vla-get-area ENT))
)
)
)
)
(prompt "\nThis is not a hatch object.")
)
)
)
(princ)
)
27 REPLIES 27
Message 2 of 28
Tom Smith
in reply to: cad77

(defun c:HatchAreas (/ sset i area obj)
(if (>= (atof (substr (getvar "acadver") 1 4)) 16.2)
(progn
(prompt "\nSelect hatches: ")
(if (setq sset (ssget '((0 . "hatch"))))
(progn
(setq
i (1- (sslength sset))
area 0)
(while (>= i 0)
(setq
obj (vlax-ename->vla-object (ssname sset i))
area (+ area (vla-get-area obj)))
(setq i (1- i)))
(alert
(strcat
"\nTotal area = "
(if (or (= (getvar "lunits") 3) (= (getvar "lunits") 4))
(strcat
(rtos area 2)
" sq. in. ("
(rtos (/ area 144) 2)
" sq. ft.)")
(rtos area))))))))
(princ))
Message 3 of 28
cad77
in reply to: cad77

Thank you very much, Tom. I appreciate your time.

Works great!
Message 4 of 28
Tom Smith
in reply to: cad77

You'e welcome. It was really an easy adaptation of Daniel's routine. You can see the differences in working with selection sets versus single objects. You can use an ssget filter list to avoid having to check the entity type, but then you have to use some kind of loop to cycle through the selection set.
Message 5 of 28
jbechard
in reply to: cad77

Can someone please tell me what I am doing wrong with trying to add this sum of hatch areas lisp routine.  I have copied the routine directly from here and brought it into notepad.  I saved it as a .lsp.  I used the appload function to load the new lisp routine and it says it was successful.  But when I type the command hatchareas, there is nothing.  No error, no unknown command.  It just goes back to command without doing anything or asking for any options.  I am using Acad 2004.

 

Thanks,

Jeff

Tags (1)
Message 6 of 28
Kent1Cooper
in reply to: jbechard


@jbechard wrote:

....when I type the command hatchareas, there is nothing.  No error, no unknown command.  It just goes back to command without doing anything or asking for any options.  I am using Acad 2004.

....


I'm in ADT2004, and it does the same for me.  It's the (if) test at the top.  My ACADVER is 16.0, and that's earlier than what it's testing for.  If I take out the test, I get an "unknown name: Area" message.  The Area property of Hatch patterns was apparently added to a later version, but isn't available for me -- hence the (if) test.  In earlier versions that don't recognize that property of Hatch patterns, it would need to be done differently, if it's even possible.  You might try Searching the discussion group for some other way of calculating such areas, if there is one.

Kent Cooper, AIA
Message 7 of 28
jbechard
in reply to: cad77

Thank you for your quick response.

 

That's unfortunate that it doesn't work with the earlier versions.  Hopefully there's another way that it can be done out there. 

 

Thank you for the explanation.  It makes sense why it does what it does once I tried it.

 

Jeff

Message 8 of 28
stevor
in reply to: jbechard

Message 9 of 28
jbechard
in reply to: stevor

I just tried that routine and all it seems to do is recreate my boundaries.  The problem is that when I have 2 items, for example, one circle inside of another, I need to know the area of what the hatching would be in between them.  Like a thick line.  But with using the boundaries to get my sum of the areas, it doesn't factor in that I am hatching in between two objects, as opposed to fully hatching both objects.  So I have a zone lisp routine that gives me the sum of all boundaries, but again, it doesn't factor in the actual area that is hatched.  That's why I need something that actually recognizes the hatch itself.

Message 10 of 28
ramtin6276
in reply to: jbechard

Can someone help me :

I draw Several hatches in separate layers and  I need a lisp that calculate cumulative area of they hatches in separate layers and print the results to an excel table. similar this :

 

cumulative area

Name of Layer

 ..........................................................................................

Layer1

  ..........................................................................................

Layer2

 

.

.

.

  ..........................................................................................

Layer n

 

Message 11 of 28
lehaoxdbk
in reply to: Tom Smith

I has lost all this morning ! when i see your information, i verryhappy. thank you so much. i love you . ^^

Message 12 of 28
jayplac
in reply to: jbechard

Have you found an answer to the area by layer problem.  I too need a lisp routine for that.

Message 13 of 28
ВeekeeCZ
in reply to: jayplac

There are many routines on web do this task. Here is the one quite old... modified for HATCH selection only (originally supported polylines, circles..).
If is a dialog for export to file popped up, you may give a cancel... I'll be shown on screen anyway.

Remember that some complicated hatches has no area available (routine highlight them).

Message 14 of 28
jayplac
in reply to: ВeekeeCZ

I search all over for something like this. I'm so happy you found it.  I'm always quite amazed at how helpful people are on these forums. Thanks.

Message 15 of 28
damian.wrobel
in reply to: ВeekeeCZ

Your lisp is great!

I made my three lisps on ground of yours.

They calculate total area of selected Objects. The only difference is, what type of Objects there are used to calculate total area.

In lisp number 1, there are used Polylines, CIrcles, etc, plus Hatches

In lisp number 2, there are used Polylines, CIrcles, etc, but WITHOUT OF Hatches

In lisp number 3, there are used ONLY Hatches



Lisp number 1

 

I tried also to change this blue part for the red part, but the red part doesn't work properly.

I wanted to display the results in COmmand Line just like that:

"Layer L-1 ---> Area 123.45

Layer 0 ---? Area 12.34"

 

; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2

;Edit 2015 Objects, also HATCHES
;Secte plochy vsech vybranych objektu (s vlastnosti Area)
;12/2005 - prvni
;(C) 2005 AAC Solutions - www.aac-solutions.cz


(defun aSUMIT (pl / aso)
  (setq SumPl (+ SumPl pl))
  (if (not (setq aso (assoc e_lay LAYLIST)))
	(setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina
	(setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici
  );if
)

(defun aCOUNT (ss / en ed pl)
  (while (> (sslength ss) 0)
    (setq en (ssname ss 0))
    (setq ed (entget en))
;    (setq e_type (cdr (assoc '0 ed)))
    (setq e_lay (cdr (assoc '8 ed)))

 (setq Obj (vlax-ename->vla-object en))
; (PRINT Obj)
; (vlax-dump-object Obj)
 (setq pl
  (if (vlax-property-available-p Obj 'Area)
;   (vlax-get-property Obj "Area")
   (vl-catch-all-apply 'vlax-get-property (list Obj "Area"))
   0.0
  ))
; (PRINT pl)
 (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) )
; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) )
 (aSUMIT pl)
 (ssdel en ss)
 )
)

(DEFUN aFLUSH ( / f n)
 (terpri)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f))
	(write-line (strcat (car n) " " (rtos (cdr n))))
 )
 (if f (close f))
)


; ---

(DEFUN C:TOTALAREASEGREGATEDBYLAYER ( / ss fname dwgName gACADVER SumPl )

 (VL-LOAD-COM)
  (setvar "CMDECHO" 0)
  (setq SumPl 0.0)
  (setq LAYLIST '())
  (setq gACADVER (read (substr (getvar "ACADVER") 1 2)))
  (if (>= gACADVER 14)
    (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME"))  dwgName (substr dwgName 1 (- (strlen dwgName) 4)) )
    (setq dwgName (getvar "DWGNAME"))
  )
  (prompt "\nSelect Objects (also Hatches) for area count: ")
  (setq ss 
	(ssget
               '(   (0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE,HATCH")
                    (-4 . "<NOT")
                        (-4 . "<AND")
                            (0 . "POLYLINE") (-4 . "&") (70 . 80)
                        (-4 . "AND>")
                    (-4 . "NOT>")
                )
    )
  )
  ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))
  (prompt "\n\nLayer-Area:\n----------------------------------\n")

   (aCOUNT ss)
   (aFLUSH)

;Why it doesn't work?"   
;================================   
; (prompt (strcat "Layer "
;   (aCOUNT ss) " ---> Area "
;   (aFLUSH) "\n"
;		)
; )
;================================
 
  (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPl 2 2)))
(princ)
)

Lisp number 2

 

; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2

;Edit 2015 HATCH ONLY
;Secte plochy vsech vybranych objektu (s vlastnosti Area)
;12/2005 - prvni
;(C) 2005 AAC Solutions - www.aac-solutions.cz


(defun aSUMIT (pl / aso)
  (setq SumPl (+ SumPl pl))
  (if (not (setq aso (assoc e_lay LAYLIST)))
	(setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina
	(setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici
  );if
)

(defun aCOUNT (ss / en ed pl)
  (while (> (sslength ss) 0)
    (setq en (ssname ss 0))
    (setq ed (entget en))
;    (setq e_type (cdr (assoc '0 ed)))
    (setq e_lay (cdr (assoc '8 ed)))

 (setq Obj (vlax-ename->vla-object en))
; (PRINT Obj)
; (vlax-dump-object Obj)
 (setq pl
  (if (vlax-property-available-p Obj 'Area)
;   (vlax-get-property Obj "Area")
   (vl-catch-all-apply 'vlax-get-property (list Obj "Area"))
   0.0
  ))
; (PRINT pl)
 (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) )
; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) )
 (aSUMIT pl)
 (ssdel en ss)
 )
)

(DEFUN aFLUSH ( / f n)
 (terpri)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f))
	(write-line (strcat (car n) " " (rtos (cdr n))))
 )
 (if f (close f))
)


; ---

(DEFUN C:TOTALAREASEGREGATEDBYLAYERH ( / ss fname dwgName gACADVER SumPl )

 (VL-LOAD-COM)
  (setvar "CMDECHO" 0)
  (setq SumPl 0.0)
  (setq LAYLIST '())
  (setq gACADVER (read (substr (getvar "ACADVER") 1 2)))
  (if (>= gACADVER 14)
    (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME"))  dwgName (substr dwgName 1 (- (strlen dwgName) 4)) )
    (setq dwgName (getvar "DWGNAME"))
  )
  (prompt "\nSelect Hatches for area count: ")
  (setq ss (ssget '((0 . "HATCH"))))
  ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))
  (prompt "\n\nLayer-Area:\n----------------------------------\n")
  (aCOUNT ss)
  (aFLUSH)
  (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPl 2 2)))
(princ)
)

 

Lisp number 3

 

; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2

;Edit 2015 HATCH ONLY
;Secte plochy vsech vybranych objektu (s vlastnosti Area)
;12/2005 - prvni
;(C) 2005 AAC Solutions - www.aac-solutions.cz


(defun aSUMIT (pl / aso)
  (setq SumPl (+ SumPl pl))
  (if (not (setq aso (assoc e_lay LAYLIST)))
	(setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina
	(setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici
  );if
)

(defun aCOUNT (ss / en ed pl)
  (while (> (sslength ss) 0)
    (setq en (ssname ss 0))
    (setq ed (entget en))
;    (setq e_type (cdr (assoc '0 ed)))
    (setq e_lay (cdr (assoc '8 ed)))

 (setq Obj (vlax-ename->vla-object en))
; (PRINT Obj)
; (vlax-dump-object Obj)
 (setq pl
  (if (vlax-property-available-p Obj 'Area)
;   (vlax-get-property Obj "Area")
   (vl-catch-all-apply 'vlax-get-property (list Obj "Area"))
   0.0
  ))
; (PRINT pl)
 (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) )
; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) )
 (aSUMIT pl)
 (ssdel en ss)
 )
)

(DEFUN aFLUSH ( / f n)
 (terpri)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f))
	(write-line (strcat (car n) " " (rtos (cdr n))))
 )
 (if f (close f))
)


; ---

(DEFUN C:TOTALAREASEGREGATEDBYLAYERnonH ( / ss fname dwgName gACADVER SumPl )

 (VL-LOAD-COM)
  (setvar "CMDECHO" 0)
  (setq SumPl 0.0)
  (setq LAYLIST '())
  (setq gACADVER (read (substr (getvar "ACADVER") 1 2)))
  (if (>= gACADVER 14)
    (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME"))  dwgName (substr dwgName 1 (- (strlen dwgName) 4)) )
    (setq dwgName (getvar "DWGNAME"))
  )
  (prompt "\nSelect Objects (non-Lines, non-Hatches) for area count: ")
  (setq ss 
	(ssget
               '(   (0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE")
                    (-4 . "<NOT")
                        (-4 . "<AND")
                            (0 . "POLYLINE") (-4 . "&") (70 . 80)
                        (-4 . "AND>")
                    (-4 . "NOT>")
                )
    )
  )
  ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))
  (prompt "\n\nLayer-Area:\n----------------------------------\n")
  (aCOUNT ss)
  (aFLUSH)
  (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPl 2 2)))
(princ)
)

Could you help me with this blue-red problem? Greetings and thank you for your great lisp.

 

 

==============

 

End, by the way: Can you write such lisp, but for not total area, but for total length of selected Objects? Of course Hatches will not count in that case.

 

Maybe this lisp could be base for lisp which I want to achieve:

 

http://cadtips.cadalyst.com/distance/calculate-total-area-perimeter-and-length

; http://cadtips.cadalyst.com/distance/calculate-total-area-perimeter-and-length
; DuctiSoft President Andrea Andreetti is back this month with another great routine for AutoCAD. Tadd is a LISP routine that will display the total area, perimeter, and length of a selection set of objects. This can be helpful if you want to calculate the total area of multiple closed polylines, for example. Start by loading the LISP file, then type in the command Tadd. Nothing will appear to happen, but in the background a reactor has been loaded. Now when you select any number of object types — including polylines, splines, regions, arcs, and circles — a modeless dialog will appear and/or update showing you the result of the calculations. You can leave the dialog in place, close it, or move it at any time. The modeless dialog is generated using a function exposed by the AutoCAD Express Tools (ET); in the unlikely case that your ET is not installed or is otherwise not operational, this routine may not work. Thanks, Andrea.


;|                                                    ;;
;       TotalADD Total Addition v. 1.0                 ;;
;       By: Andrea Andreetti ©     2009-10-20          ;;
                                                      |;
;;

(princ
  "\nTotalADDition v.1.0 activated!   -run \"TADD\" to start or \"TADD-r\" to end."
)

(defun c:tadd (/                     itemarea              itemperimeter         itemlinelength
               itemarclength         itemsplinelength      itemregionperimeter   itemcircumference
               itemsplineperimeter   itemplineperimeter    itemplinelength       itemtracelength
               itemarclength         itemellipselength a b c d p1 p2 itemlength tarea tperim tlength
              )
  (vl-load-com)
  (defun *oo_object_modification* (objreactor objectsmodified)
    (setq selected_objects (vla-get-pickfirstselectionset
                             (vla-get-activedocument (vlax-get-acad-object))
                           )
    )
    (setq itemarea 0
          itemperimeter 0
          itemlinelength 0
          itemarclength 0
          itemsplinelength 0
          itemregionperimeter 0
          itemcircumference 0
          itemsplineperimeter 0
          itemplineperimeter 0
          itemplinelength 0
          itemtracelength 0
          itemarclength 0
          itemellipselength 0
    )
    ;AREA
    (vlax-for n selected_objects
      (if (vlax-property-available-p n 'area)
        (if (eq (vla-get-objectname n) "AcDbRegion")
          (setq itemarea (+ itemarea (vla-get-area n)))
          (if (vlax-curve-isclosed n)
            (setq itemarea (+ itemarea (vla-get-area n)))
          )
        )
      )
      ;;CIRCLE
      (if (vlax-property-available-p n 'circumference)
        (setq itemcircumference (+ itemcircumference (vla-get-circumference n)))
      )
      ;;SPLINE
      (if (eq (vla-get-objectname n) "AcDbSpline")
        (if (vlax-curve-isclosed n)
          (setq itemsplineperimeter (+ itemsplineperimeter
                                       (vlax-curve-getdistatparam n (vlax-curve-getendparam n))
                                    )
          )
          (setq itemsplinelength (+ itemsplinelength
                                    (vlax-curve-getdistatparam n (vlax-curve-getendparam n))
                                 )
          )
        )
      )
      ;;REGION
      (if (eq (vla-get-objectname n) "AcDbRegion")
        (setq itemregionperimeter (+ itemregionperimeter (vla-get-perimeter n)))
      )
      ;;PLINE
      (if (or (eq (vla-get-objectname n) "AcDb2dPolyline")
              (eq (vla-get-objectname n) "AcDbPolyline")
          )
        (if (vlax-curve-isclosed n)
          (setq itemplineperimeter (+ itemplineperimeter
                                      (vlax-curve-getdistatparam n (vlax-curve-getendparam n))
                                   )
          )
          (setq itemplinelength (+ itemplinelength
                                   (vlax-curve-getdistatparam n (vlax-curve-getendparam n))
                                )
          )
        )
      )
      ;;LINE
      (if (eq (vla-get-objectname n) "AcDbLine")
        (setq itemlinelength (+ itemlinelength (vla-get-length n)))
      )
      ;;ARC
      (if (eq (vla-get-objectname n) "AcDbArc")
        (setq itemarclength (+ itemarclength (vla-get-arclength n)))
      )
      (if (eq (vla-get-objectname n) "AcDbEllipse")
        (setq itemellipselength (+ itemellipselength
                                   (vlax-curve-getdistatparam n (vlax-curve-getendparam n))
                                )
        )
      )
      ;;TRACE
      (if (eq (vla-get-objectname n) "AcDbTrace")
        (progn (setq plist (vlax-safearray->list
                             (vlax-variant-value (vla-get-coordinates n))
                           )
               )
               (setq a (list (nth 0 plist) (nth 1 plist) (nth 2 plist)))
               (setq b (list (nth 3 plist) (nth 4 plist) (nth 5 plist)))
               (setq c (list (nth 6 plist) (nth 7 plist) (nth 8 plist)))
               (setq d (list (nth 9 plist) (nth 10 plist) (nth 11 plist)))
               (setq p1 (polar a (angle a b) (/ (distance a b) 2.0)))
               (setq p2 (polar c (angle c d) (/ (distance c d) 2.0)))
               (setq itemtracelength (+ itemtracelength (distance p1 p2)))
        )
      )
    )
    ;;_end vlax-for
    (setq itemperimeter (+ itemcircumference
                           itemsplineperimeter
                           itemregionperimeter
                           itemplineperimeter
                        )
    )
    (setq itemlength (+ itemplinelength itemsplinelength itemlinelength itemtracelength itemarclength itemellipselength)
    )
    (setq tarea (rtos itemarea 2 8))
    (setq tperim (rtos itemperimeter 2 8))
    (setq tlength (rtos itemlength 2 8))
    (acet-ui-status (strcat "Toatl Area:       " tarea "\n" "Total Perimeter:          " tperim "\n"
                            "Total Length:            " tlength)
    )
  )
  ;;OBJECT SELECTION
  (if oo_object_modification
    (progn (vlr-remove oo_object_modification)
           (setq oo_object_modification nil)
    )
  )
  (setq oo_object_modification
         (vlr-miscellaneous-reactor
           nil
           '((:vlr-pickfirstmodified . *oo_object_modification*))
         )
  )
  ;;Command ended 
  (if oo_object_modification_action
    (progn (vlr-remove oo_object_modification_action)
           (setq oo_object_modification_action nil)
    )
  )
  (setq oo_object_modification_action
         (vlr-command-reactor nil
                              '((:vlr-commandended . *oo_object_modification*)
 ;(:vlr-commandcancelled . *oo_object_modification_CANCEL*))
                               )
         )
  )
)


(defun c:TADD-r ()
 
  (if oo_object_modification_action
    (progn (vlr-remove oo_object_modification_action)
           (setq oo_object_modification_action nil)
    )
  )
  (if oo_object_modification
    (progn (vlr-remove oo_object_modification)
           (setq oo_object_modification nil)
    )
  )
)
Message 16 of 28
ВeekeeCZ
in reply to: damian.wrobel

Hi damian,

 

first of all, I need to clarify I'am not the author of the routine. As been written at the beggining of the routine, it is AAC Solutions... provider of http://www.cadforum.cz/cadforum_en/download.asp?cat=33 where you can find the other routine you're asking for... addlen.lsp ... and many others.. 🙂

I only made minor changes (such is selection filter) and also traslation to english. And since the author @vladimir_michl is sometimes flying around this forum, I hope he doesn't mind ;-).

 

To your sugestions...

 

It doesn't work like that, find the procedure "aFLUSH" and replace it with this:

 

Spoiler
(DEFUN aFLUSH ( / f n)
 (terpri)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f)) 			;line for file writing
	(write-line (strcat "Layer " (car n) " --> Area " (rtos (cdr n))))		;line for screen
 )
 (if f (close f))
)

 

This complicated filter is not necessary because the routine has its own filter for objects with area property available only.

Spoiler
  (setq ss 
	(ssget
               '(   (0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE,HATCH")
                    (-4 . "<NOT")
                        (-4 . "<AND")
                            (0 . "POLYLINE") (-4 . "&") (70 . 80)
                        (-4 . "AND>")
                    (-4 . "NOT>")
                )
    )
  )

You can keep just this, which was the original version:

(setq ss (ssget))

 

 

Filter for all BUT HATCH could look just like this

(setq ss (ssget '((0 . "~HATCH"))))

 

See attachment for addlen.lsp. This version probably  is not newest, but good enough and open.

Message 17 of 28
damian.wrobel
in reply to: ВeekeeCZ

When I typed "ADDLEN" and pressed Enter, something like that happenned...

 

addlen_EN - Effect.png

 

Does this lisp really work like that, or maybe there is an error in this lisp?

If this lisp really works like that - What I should do now?

 

________________________________________________________________________

 

I followed your advice and I changed definition of "aFLUSH".

Now this lisp works good, thank you very much.

 

Just to everybody could use this lisp, but also for myself (when I want download it in the future, just in case if something wrong could happen, for example I would for example lost this lisp from my computer), I put this lisp here:

 

; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2

;Edit 2015 Objects, also HATCHES
;Secte plochy vsech vybranych objektu (s vlastnosti Area)
;12/2005 - prvni
;(C) 2005 AAC Solutions - www.aac-solutions.cz


(defun aSUMIT (pl / aso)
  (setq SumPl (+ SumPl pl))
  (if (not (setq aso (assoc e_lay LAYLIST)))
	(setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina
	(setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici
  );if
)

(defun aCOUNT (ss / en ed pl)
  (while (> (sslength ss) 0)
    (setq en (ssname ss 0))
    (setq ed (entget en))
;    (setq e_type (cdr (assoc '0 ed)))
    (setq e_lay (cdr (assoc '8 ed)))

 (setq Obj (vlax-ename->vla-object en))
; (PRINT Obj)
; (vlax-dump-object Obj)
 (setq pl
  (if (vlax-property-available-p Obj 'Area)
;   (vlax-get-property Obj "Area")
   (vl-catch-all-apply 'vlax-get-property (list Obj "Area"))
   0.0
  ))
; (PRINT pl)
 (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) )
; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) )
 (aSUMIT pl)
 (ssdel en ss)
 )
)


;(DEFUN aFLUSH ( / f n)
; (terpri)
; (if fname (setq f (open fname "w")))
; (foreach n LAYLIST
;	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f))
;	(write-line (strcat (car n) " " (rtos (cdr n))))
; )
; (if f (close f))
;)

(DEFUN aFLUSH ( / f n)
 (terpri)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f)) 			;line for file writing
	(write-line (strcat "Layer " (car n) " --> Area " (rtos (cdr n))))		;line for screen
 )
 (if f (close f))
)


; ---

(DEFUN C:TOTALAREASEGREGATEDBYLAYER-Display ( / ss fname dwgName gACADVER SumPl )

 (VL-LOAD-COM)
  (setvar "CMDECHO" 0)
  (setq SumPl 0.0)
  (setq LAYLIST '())
  (setq gACADVER (read (substr (getvar "ACADVER") 1 2)))
  (if (>= gACADVER 14)
    (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME"))  dwgName (substr dwgName 1 (- (strlen dwgName) 4)) )
    (setq dwgName (getvar "DWGNAME"))
  )
  (prompt "\nSelect Objects (also Hatches) for area count: ")
  (setq ss 
	(ssget
               '(   (0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE,HATCH")
                    (-4 . "<NOT")
                        (-4 . "<AND")
                            (0 . "POLYLINE") (-4 . "&") (70 . 80)
                        (-4 . "AND>")
                    (-4 . "NOT>")
                )
    )
  )
  ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))
  (prompt "\n\nLayer-Area:\n----------------------------------\n")
   (aCOUNT ss)
   (aFLUSH)
  (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPl 2 2) "\n"))
(princ)
)

 

Message 18 of 28
ВeekeeCZ
in reply to: damian.wrobel

This routine allows export data to external file (as well as ADDAREA does). To disable this feature put a semicolon in front this line

 

;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))

I did a minor typo... change the word "area" to Length in this line

 

(write-line (strcat "Layer "(car n) " --> Area " (rtos (cdr n))))

 

Message 19 of 28

In Autocad, you should use milimeters as drawing units. So if I want ti get as result the Area not in mm^2, but in m^2, I have to multiply my result in mm^2 by 10^(-6).

So I modified these three lisps to get the Area in m^2.

Here they are:

 

1. 

; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2

;Edit 2015 Objects, also HATCHES
;Secte plochy vsech vybranych objektu (s vlastnosti Area)
;12/2005 - prvni
;(C) 2005 AAC Solutions - www.aac-solutions.cz


(defun aSUMIT (pl / aso)
  (setq SumPl (+ SumPl pl))
  (if (not (setq aso (assoc e_lay LAYLIST)))
	(setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina
	(setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici
  );if
)

(defun aCOUNT (ss / en ed pl)
  (while (> (sslength ss) 0)
    (setq en (ssname ss 0))
    (setq ed (entget en))
;    (setq e_type (cdr (assoc '0 ed)))
    (setq e_lay (cdr (assoc '8 ed)))

 (setq Obj (vlax-ename->vla-object en))
; (PRINT Obj)
; (vlax-dump-object Obj)
 (setq pl
  (if (vlax-property-available-p Obj 'Area)
;   (vlax-get-property Obj "Area")
   (vl-catch-all-apply 'vlax-get-property (list Obj "Area"))
   0.0
  ))
; (PRINT pl)
 (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) )
; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) )
 (aSUMIT pl)
 (ssdel en ss)
 )
)


;(DEFUN aFLUSH ( / f n)
; (terpri)
; (if fname (setq f (open fname "w")))
; (foreach n LAYLIST
;	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f))
;	(write-line (strcat (car n) " " (rtos (cdr n))))
; )
; (if f (close f))
;)

(DEFUN aFLUSH ( / f n)
 (terpri)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f)) 			;line for file writing
	(write-line (strcat "Layer " (car n) " --> Area " (rtos (cdr n))))		;line for screen
 )
 (if f (close f))
)


; ---

(DEFUN C:TOTALAREASEGREGATEDBYLAYER ( / ss fname dwgName gACADVER SumPl )

 (VL-LOAD-COM)
  (setvar "CMDECHO" 0)
  (setq SumPl 0.0)
  (setq LAYLIST '())
  (setq gACADVER (read (substr (getvar "ACADVER") 1 2)))
  (if (>= gACADVER 14)
    (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME"))  dwgName (substr dwgName 1 (- (strlen dwgName) 4)) )
    (setq dwgName (getvar "DWGNAME"))
  )
  (prompt "\nSelect Objects (also Hatches) for area count: ")
  (setq ss 
	(ssget
               '(   (0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE,HATCH")
                    (-4 . "<NOT")
                        (-4 . "<AND")
                            (0 . "POLYLINE") (-4 . "&") (70 . 80)
                        (-4 . "AND>")
                    (-4 . "NOT>")
                )
    )
  )
  ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))
  (prompt "\n\nLayer-Area:\n----------------------------------\n")
   (aCOUNT ss)
   (aFLUSH)
   (setq SumPlSQM (* SumPl 0.000001)) ; when your Unit in AutoCAD is mm and you want to get the Area in m^2 ; SQM = SQuare Meter (m^2)
  (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPlSQM 2) "\n (Precision depends on LUPREC value) \n"))
(princ)
)

2.
; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2 ;Edit 2015 HATCH ONLY ;Secte plochy vsech vybranych objektu (s vlastnosti Area) ;12/2005 - prvni ;(C) 2005 AAC Solutions - www.aac-solutions.cz (defun aSUMIT (pl / aso) (setq SumPl (+ SumPl pl)) (if (not (setq aso (assoc e_lay LAYLIST))) (setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina (setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici );if ) (defun aCOUNT (ss / en ed pl) (while (> (sslength ss) 0) (setq en (ssname ss 0)) (setq ed (entget en)) ; (setq e_type (cdr (assoc '0 ed))) (setq e_lay (cdr (assoc '8 ed))) (setq Obj (vlax-ename->vla-object en)) ; (PRINT Obj) ; (vlax-dump-object Obj) (setq pl (if (vlax-property-available-p Obj 'Area) ; (vlax-get-property Obj "Area") (vl-catch-all-apply 'vlax-get-property (list Obj "Area")) 0.0 )) ; (PRINT pl) (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) ) ; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) ) (aSUMIT pl) (ssdel en ss) ) ) (DEFUN aFLUSH ( / f n) (terpri) (if fname (setq f (open fname "w"))) (foreach n LAYLIST (if f (write-line (strcat (car n) " " (rtos (cdr n))) f)) ;line for file writing (write-line (strcat "Layer " (car n) " --> Area " (rtos (cdr n)))) ;line for screen ) (if f (close f)) ) ; --- (DEFUN C:TOTALAREASEGREGATEDBYLAYERH ( / ss fname dwgName gACADVER SumPl ) (VL-LOAD-COM) (setvar "CMDECHO" 0) (setq SumPl 0.0) (setq LAYLIST '()) (setq gACADVER (read (substr (getvar "ACADVER") 1 2))) (if (>= gACADVER 14) (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME")) dwgName (substr dwgName 1 (- (strlen dwgName) 4)) ) (setq dwgName (getvar "DWGNAME")) ) (prompt "\nSelect Hatches for area count: ") (setq ss (ssget '((0 . "HATCH")))) ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1)) (prompt "\n\nLayer-Area:\n----------------------------------\n") (aCOUNT ss) (aFLUSH) (setq SumPlSQM (* SumPl 0.000001)) ; when your Unit in AutoCAD is mm and you want to get the Area in m^2 ; SQM = SQuare Meter (m^2) (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPlSQM 2) "\n (Precision depends on LUPREC value) \n")) (princ) )

3.
; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/td-p/2071424/page/2 ;Edit 2015 HATCH ONLY ;Secte plochy vsech vybranych objektu (s vlastnosti Area) ;12/2005 - prvni ;(C) 2005 AAC Solutions - www.aac-solutions.cz (defun aSUMIT (pl / aso) (setq SumPl (+ SumPl pl)) (if (not (setq aso (assoc e_lay LAYLIST))) (setq LAYLIST (cons (cons e_lay pl) LAYLIST)) ; nova hladina (setq LAYLIST (subst (cons e_lay (+ (cdr aso) pl)) aso LAYLIST)) ;existujici );if ) (defun aCOUNT (ss / en ed pl) (while (> (sslength ss) 0) (setq en (ssname ss 0)) (setq ed (entget en)) ; (setq e_type (cdr (assoc '0 ed))) (setq e_lay (cdr (assoc '8 ed))) (setq Obj (vlax-ename->vla-object en)) ; (PRINT Obj) ; (vlax-dump-object Obj) (setq pl (if (vlax-property-available-p Obj 'Area) ; (vlax-get-property Obj "Area") (vl-catch-all-apply 'vlax-get-property (list Obj "Area")) 0.0 )) ; (PRINT pl) (if (vl-catch-all-error-p pl) (progn (PRINT "HIGHLIGHTED OBJECT HAS NO AREA!")(vlax-invoke-method Obj 'Highlight :vlax-true)(vlr-beep-reaction)(setq pl 0.0) ) ) ; (if (= (substr pl 1 1) "A") (progn (PRINT "PROBLEM-NO AREA!") (setq pl 0.0) ) ) (aSUMIT pl) (ssdel en ss) ) ) (DEFUN aFLUSH ( / f n) (terpri) (if fname (setq f (open fname "w"))) (foreach n LAYLIST (if f (write-line (strcat (car n) " " (rtos (cdr n))) f)) ;line for file writing (write-line (strcat "Layer " (car n) " --> Area " (rtos (cdr n)))) ;line for screen ) (if f (close f)) ) ; --- (DEFUN C:TOTALAREASEGREGATEDBYLAYERnonH ( / ss fname dwgName gACADVER SumPl ) (VL-LOAD-COM) (setvar "CMDECHO" 0) (setq SumPl 0.0) (setq LAYLIST '()) (setq gACADVER (read (substr (getvar "ACADVER") 1 2))) (if (>= gACADVER 14) (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME")) dwgName (substr dwgName 1 (- (strlen dwgName) 4)) ) (setq dwgName (getvar "DWGNAME")) ) (prompt "\nSelect Objects (non-Lines, non-Hatches) for area count: ") (setq ss (ssget '( (0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE") (-4 . "<NOT") (-4 . "<AND") (0 . "POLYLINE") (-4 . "&") (70 . 80) (-4 . "AND>") (-4 . "NOT>") ) ) ) ;(setq fname (getfiled "Define name of exported file" dwgName "SDF" 1)) (prompt "\n\nLayer-Area:\n----------------------------------\n") (aCOUNT ss) (aFLUSH) (setq SumPlSQM (* SumPl 0.000001)) ; when your Unit in AutoCAD is mm and you want to get the Area in m^2 ; SQM = SQuare Meter (m^2) (prompt (strcat "\n----------------------------------\nTotal area: " (rtos SumPlSQM 2) "\n (Precision depends on LUPREC value) \n")) (princ) )

 

Message 20 of 28
damian.wrobel
in reply to: ВeekeeCZ

Thank you.

I made these two changes (this and this) and now the results are displayed in CommandLine.

 

Now "ADDLEN" lisp is so:

 

; http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/sum-of-hatch-areas-lisp-routine-modification/m-p/5726227#M333693

;Secte delky vsech vybranych usecek, krivek a oblouku
;23.1.98 - pridana podpora LWPOLY pro R14
;7/2005 - pridana podpora MLINE a SPLINE
;12/2005 - pridana podpora CIRCLE
;(C) AAC Solutions - www.aac-solutions.cz

(defun REMOVE-IF-NOT (pred lst)
  (apply 'append
         (mapcar '(lambda (e)
                 (if (apply pred (list e)) (list e))) lst))
)
                 
(defun group-only (grp lst)
  (mapcar 'cdr (remove-if-not '(lambda(pair)(= grp (car pair))) lst))
)

(defun add_mlines (ss en / pt)
 (setq pto (car (group-only 11 ed)))
; (foreach pt (group-only 11 ed) (progn (setq tot_len (+ tot_len (distance pt pto)))(setq pto pt)))
 (foreach pt (group-only 11 ed) (progn (SUMIT (distance pt pto))(setq pto pt)))
 (ssdel en ss)
)

(defun add_lines (ss en)
  (setq pt1 (cdr (assoc '10 ed)))
  (setq pt2 (cdr (assoc '11 ed)))
  (setq line_len (distance pt1 pt2))
  (SUMIT line_len)
  (ssdel en ss)
)

(defun add_arcs (ss en)
  (SETQ CEN (CDR (ASSOC '10 Ed))
        RAD (CDR (ASSOC '40 Ed))
        DIA (* RAD 2.0)
        CIRCUM (* (* RAD PI) 2.0)
        S_ANG (CDR (ASSOC '50 Ed))
        E_ANG (CDR (ASSOC '51 Ed))
  )
  (IF (< E_ANG S_ANG)
    (SETQ E_ANG (+ E_ANG (* PI 2.0)))
  )
  (SETQ
        N_ANG (- E_ANG S_ANG)
        N_ANG_1 (* (/ N_ANG PI) 180.0)
        PART_CIRC (/ N_ANG_1 360.0)  
        A_LEN (* PART_CIRC CIRCUM)
  )
  (SUMIT a_len)
  (PRIN1)
  (SSDEL EN SS)
)

(defun add_poly (ss en / bux ee ssx)
  (command "_area" "_e" en)
;  (setq tot_len (+ tot_len (getvar "perimeter")))
  (SUMIT (getvar "perimeter"))

;| vyhozeno, jen pro R14:
  (command "_POINT" '(0 0)) ;aby nebyla complex
  (setq bux (entlast))
  (command "_EXPLODE" en)
  (setq ee (entnext bux))
  (if ee ;podaril se EXPLODE?
   (progn
    (setq ssx (ssadd ee))
    (while (setq ee (entnext ee))
     (setq ssx (ssadd ee ssx))
    );while
    (COUNT ssx)
    (command "_U")
   )
   (progn
    (command "");ukonci EXPLODE
    (prompt "Odemknete hladiny")
  ));if
  (command "_U")
|;


  (ssdel en ss)
)

(defun SUMIT (l / aso)
  (setq tot_len (+ tot_len l))
  (if (not (setq aso (assoc e_lay LAYLIST)))
	(setq LAYLIST (cons (cons e_lay l) LAYLIST)) ; nova hladina
	(setq LAYLIST (subst (cons e_lay (+ (cdr aso) l)) aso LAYLIST)) ;existujici
  );if
)

(defun COUNT (ss / en)
  (while (> (sslength ss) 0)
    (setq en (ssname ss 0))
    (setq ed (entget en))
    (setq e_type (cdr (assoc '0 ed)))
    (setq e_lay (cdr (assoc '8 ed)))
    (cond
      ((= e_type "LINE") (add_lines ss en))
      ((= e_type "MLINE") (add_mlines ss en))
      ((= e_type "ARC") (add_arcs ss en))
      ((= e_type "POLYLINE") (add_poly ss en))
      ((= e_type "LWPOLYLINE") (add_poly ss en))
      ((= e_type "SPLINE") (add_poly ss en))
      ((= e_type "CIRCLE") (add_poly ss en))
      ((= e_type "ELLIPSE") (add_poly ss en))
      ((or
	 (/= e_type "LINE")
	 (/= e_type "MLINE")
	 (/= e_type "ARC")
	 (/= e_type "POLYLINE")
	 (/= e_type "LWPOLYLINE")
	 (/= e_type "SPLINE")
	 (/= e_type "CIRCLE")
	 (/= e_type "ELLIPSE")
       )
       (ssdel en ss)
      )
    )
  )
)

(DEFUN FLUSH ( / f)
 (if fname (setq f (open fname "w")))
 (foreach n LAYLIST
	(setq nn (* (cdr n) 0.001))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
	(write-line (strcat "Layer "(car n) " --> Length " (rtos (cdr n))))

;	(if f (write-line (strcat (car n) " " (rtos (cdr n))) f))
;	(write-line (strcat "Layer "(car n) " --> Length " (rtos (cdr nn))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 )
 (if f (close f))
)

(DEFUN C:addlen ( / ss fname dwgName gACADVER)
  (setvar "CMDECHO" 0)
  (setq tot_len 0)  
  (setq LAYLIST '())
  (setq gACADVER (read (substr (getvar "ACADVER") 1 2)))
  (if (>= gACADVER 14)
    (setq dwgName (strcat (getvar "ACADPREFIX")(getvar "DWGNAME"))  dwgName (substr dwgName 1 (- (strlen dwgName) 4)) )
    (setq dwgName (getvar "DWGNAME"))
  )
;  (setq fname (getfiled "Define name of exported file" dwgName "SDF" 1))
  (prompt "\nSelect objects for length count: ")
  (setq ss (ssget '((0 . "LINE,MLINE,ARC,POLYLINE,LWPOLYLINE,SPLINE,CIRCLE,ELLIPSE"))))
  (prompt "\n\nLayer-Length:\n----------------------------------\n")
  (COUNT ss)
  (FLUSH)
   (setq tot_lenM (* tot_len 0.001)) ; when your Unit in AutoCAD is mm and you want to get the Length in meters ; M = Meter (m)  
  (prompt (strcat "\n----------------------------------\nTotal length: " (rtos tot_lenM 2) "\n (Precision depends on LUPREC value) \n" ))
(princ)
)

(princ "ADDLEN - length count  ^v^ AAC Solutions Rel.0512")
(princ)

 

 

But, there is something I want to improve.

I use milimeters as drawing units, and I want to get the length in meters. So I added an additional variable which is length in mm * 0.001, that means which is length in meters. And it displays the Total Length in meters. But, the lengths segregated by layers (I call them "partial lengths") are displayed in mm... - that means, the results displaed in CommandLine are as follows:

Layer-Length:
----------------------------------
Layer 0 --> Length 2104.7664
Layer L-1 --> Length 1429.9596

----------------------------------
Total length: 3.5347
 (Precision depends on LUPREC value)

I tried to modify the lisp routine (I replaced this with this) , but these changes made this lisp not working properly...

 

So how to display these partial lengths in meters? What I should type in this lisp routine to achieve this?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost