<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get total length of multiple dynamic blocks? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/11179674#M132632</link>
    <description>made a new post:&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks-with/m-p/11179642" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks-with/m-p/11179642&lt;/A&gt;</description>
    <pubDate>Thu, 19 May 2022 12:10:55 GMT</pubDate>
    <dc:creator>georg_holter</dc:creator>
    <dc:date>2022-05-19T12:10:55Z</dc:date>
    <item>
      <title>How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290097#M132622</link>
      <description>&lt;P&gt;I got a lisp for counting total length of dynamic block (Distance1). But it is working only in horizontal type blocks not for vertical type. I want to quantify total length of the pipes in a drawing, all pipes are stretchable type dynamic block. Any body know how to get total Distance1 value of multiple dynamic blocks (stretchable type block) which is any rotation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the lisp..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:Test&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (/ total selectionset count intger selectionsetname a b)&lt;BR /&gt;&amp;nbsp; (vl-load-com)&lt;BR /&gt;;;; Tharwat 02 . April . 2012 ;;;&lt;BR /&gt;&amp;nbsp; ;; Count number of selected Dynamic blocks and length of selected dynamic blocks&lt;BR /&gt;&amp;nbsp; (if (setq total 0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectionset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ssget '((0 . "INSERT")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (-4 . "&amp;lt;or")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (2 . "`*U*")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (2 . "_P1000")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (-4 . "or&amp;gt;")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq count (sslength selectionset))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (repeat (setq intger (sslength selectionset))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq selectionsetname&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ssname selectionset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq intger (1- intger))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (vla-getboundingbox&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (vlax-ename-&amp;gt;vla-object selectionsetname)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq total (+ total&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (distance (list (car (vlax-safearray-&amp;gt;list b))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (cadr (vlax-safearray-&amp;gt;list a))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (vlax-safearray-&amp;gt;list a)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (alert (strcat " Total number of Dynamic Blocks :"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt; "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (itoa count)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " &amp;gt;"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\n"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " Total lengths of Dynamic Blocks :"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt; "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (rtos total 2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; " &amp;gt;"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 06:42:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290097#M132622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T06:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290148#M132623</link>
      <description>&lt;P&gt;hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;may be try DATAEXTRACTION&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 07:15:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290148#M132623</guid>
      <dc:creator>ojuris</dc:creator>
      <dc:date>2016-04-25T07:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290157#M132624</link>
      <description>&lt;P&gt;Ok, try this modification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;(defun c:Test
              (/ totalh totalv selectionset count intger selectionsetname a b)
  (vl-load-com)
;;; Tharwat 02 . April . 2012 ;;;
  ;; Count number of selected Dynamic blocks and length of selected dynamic blocks
  (if (setq totalh 0
	    totalv 0
            selectionset
             (ssget '((0 . "INSERT")
                      (-4 . "&amp;lt;or")
                      (2 . "`*U*")
                      (2 . "_P1000")
                      (-4 . "or&amp;gt;")
                     )
             )
      )
    (progn
      (setq count (sslength selectionset))
      (repeat (setq intger (sslength selectionset))
        (setq selectionsetname
               (ssname selectionset
                       (setq intger (1- intger))
               )
        )
        (vla-getboundingbox
          (vlax-ename-&amp;gt;vla-object selectionsetname)
          'a
          'b
        )
        (setq totalh (+ totalh
                       (distance (list (car (vlax-safearray-&amp;gt;list b))
                                       (cadr (vlax-safearray-&amp;gt;list a))
                                 )
                                 (vlax-safearray-&amp;gt;list a)
                       )
                    )
	      totalv (+ totalv
                       (distance (list (car (vlax-safearray-&amp;gt;list a))
                                       (cadr (vlax-safearray-&amp;gt;list b))
                                 )
                                 (vlax-safearray-&amp;gt;list a)
                       )
                    )
        )
      )
      (alert (strcat " Total number of Dynamic Blocks: "
                     "&amp;lt; "
                     (itoa count)
                     " &amp;gt;"
                     "\n"
                     " Total horizonatal lengths: "
                     "&amp;lt; "
                     (rtos totalh 2)
                     " &amp;gt;"
		     "\n"
                     " Total vertical lengths: "
                     "&amp;lt; "
                     (rtos totalv 2)
                     " &amp;gt;"
             )
      )
    )
    (princ)
  )
  (princ)
)&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 25 Apr 2016 07:21:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290157#M132624</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-04-25T07:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290392#M132625</link>
      <description>&lt;P&gt;Actually i don't need horizontal and vertical length separately. I&amp;nbsp;need total length of the pipes at any rotation. When i run this lisp in one horizontal pipe block it shows horizontal and vertical length. I have a totlen.isp that calculate total length of the selected lines, polylines, arc, spline etc. That doesn't work in dynamic blocks. (Sorry for my poor English)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see attached drawing.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 10:03:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290392#M132625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T10:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290477#M132626</link>
      <description>&lt;P&gt;Ok, maybe like this... using Lee Mac's dynamic block functions available&amp;nbsp;&lt;A href="http://www.lee-mac.com/dynamicblockfunctions.html" target="_self"&gt;here&lt;/A&gt;... Thanks Lee.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:Test
       (/ total selectionset count intger selectionsetname obj)
  
  (defun LM:getdynpropvalue ( blk prp )
    (setq prp (strcase prp))
    (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
	     (vlax-invoke blk 'getdynamicblockproperties)
	     )
    )
  
  (if (setq total 0
	    selectionset
	     (ssget '((0 . "INSERT")
		      (-4 . "&amp;lt;or")
		      (2 . "`*U*")
		      (2 . "_P1000")
		      (-4 . "or&amp;gt;")
		      )
		    )
	    )
    (progn
      (setq count (sslength selectionset))
      (repeat (setq intger (sslength selectionset))
	(setq selectionsetname
	       (ssname selectionset
		       (setq intger (1- intger))
		       )
	      obj (vlax-ename-&amp;gt;vla-object selectionsetname)
	      total (+ total
		       (LM:getdynpropvalue obj "Distance1")
		       )))
      (alert (strcat " Total number of Dynamic Blocks :"
		     "&amp;lt; "
		     (itoa count)
		     " &amp;gt;"
		     "\n"
		     " Total lengths of Dynamic Blocks :"
		     "&amp;lt; "
		     (rtos total 2)
		     " &amp;gt;"
		     )
	     )
      )
    (princ)
    )
  (princ)
)&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 25 Apr 2016 11:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290477#M132626</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-04-25T11:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290511#M132627</link>
      <description>&lt;P&gt;This is what i am looking for. Thank you very much..&lt;img id="manvery-happy" class="emoticon emoticon-manvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_man-very-happy.png" alt="Man Very Happy" title="Man Very Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 11:36:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/6290511#M132627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-25T11:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/10742958#M132628</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;, you have salvaged my dreams of a dynamic wireway calculator!&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;;This code was originally created by Z9E3zK5E. 04-25-2016
;;;Altered and commented by user BW for personal use. 11-08-2021

(vl-load-com) ;load the good stuff
(defun c:PanCalc
       (/ width total selectionset count intger selectionsetname obj)
  (setq width (getreal "\n***___Please enter the width of the wireway you plan to select. (example: for 2x4 panduit, please enter '2'): "))
  (princ ( strcat "\nPlease select all of the " (rtos width 2)  " inch wide wireway in the drawing: "))

  ; &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; Lee Mac the Man, the Myth, the Legend &amp;lt;3
  (defun LM:getdynpropvalue ( blk prp )
    (setq prp (strcase prp))
    (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
	     (vlax-invoke blk 'getdynamicblockproperties)
	     )
    ) ; Lee Mac never ends. ;)
  
  (if (setq total 0
	    selectionset
	     (ssget '((0 . "INSERT")
		      (-4 . "&amp;lt;or")
		      (2 . "`*U*")
		      (2 . "_P1000")
		      (-4 . "or&amp;gt;")
		      )
		    ) ;end creating the selection set
	    )
    (progn
      (setq count (sslength selectionset))
      (repeat (setq intger (sslength selectionset))
	(setq selectionsetname
	       (ssname selectionset
		       (setq intger (1- intger))
		       )
	      obj (vlax-ename-&amp;gt;vla-object selectionsetname)
	      total (+ total
		       (LM:getdynpropvalue obj "Length")
		       )) ;end adding up the lengths
	) ;end repeat
      (setq units (1+ (fix (* 1.25 (/ (/ total 12) 6)))))
      	(princ ( strcat "\nYou'll want to order the following number of 6 foot long by " (rtos width 2)  " units of wireway: ---&amp;gt; "))
        (princ (rtos units 2))
	  (alert (strcat "PLEASE ORDER ***___" (rtos units 2) "___*** UNIT(S) OF 6 FOOT LONG BY " (rtos width 2) " INCH WIDE PANDUIT/WIREWAY."))
      ) ;end progn
    (princ)
    ) ;end if
  (princ)
) ;end function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 15:48:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/10742958#M132628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-08T15:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/10744017#M132629</link>
      <description>&lt;P&gt;Just a dumb question do the 6' units overlap ? If so is then the total length true ? I know with pipes it may be 6' long but has a 3" socket so is actually 5' 9"&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 02:31:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/10744017#M132629</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-11-09T02:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/10745209#M132630</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;I suppose that could be an issue for piping. I'm an electrical panel guy, so my lisp only cares that I purchase the wireway in the correct number of 6 foot units that can all be cut to size.&lt;/P&gt;&lt;P&gt;I do add in an arbitrary 1.25 factor to account for wasted end-cuts that can't be reused.&lt;BR /&gt;That said, I have updated my code!&lt;BR /&gt;Now you do not need to select all the applicable blocks, just type the width in the command bar and presto! Order the number if units it spits out. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Big thanks to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;for the line of code that made my 2.0 version possible! (should be attached)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;;;WirewayCalc_2.2 by BW
(vl-load-com)
(defun c:PanCalc
       (/ realwidth width total selectionset intger selectionsetname obj)
  (setq width (getreal "\n***___Please enter the width of the wireway you plan to select. (example: for 2x4 panduit, please enter '2'): "))
  (setq realwidth (+ width 0.25))

  ; &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; Lee Mac the Man, the Myth, the Legend &amp;lt;3
  (defun LM:getdynpropvalue ( blk prp )
    (setq prp (strcase prp))
    (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
	     (vlax-invoke blk 'getdynamicblockproperties)
	     )
    ) ; Lee Mac never ends. ;)
  
  (if (setq total 0
	    selectionset
	     (ssget "x" '((2 . "`*U*"))
		    ) ;end creating the selection set
	    )
    (progn
      (repeat (setq intger (sslength selectionset))
	(setq selectionsetname
	       (ssname selectionset
		       (setq intger (1- intger))
		       )
	      obj (vlax-ename-&amp;gt;vla-object selectionsetname)
	      total (+ total
		       (cond
			 (
			  (= (LM:getdynpropvalue obj "Width") realwidth)
			  (LM:getdynpropvalue obj "Length")
			 )
			 (0)
			) ;end conditional (thanks @Z9E3zK5E for the hint!) 	
	      ) ;end totaling the lengths
	  );end setqs    
       ) ;end repeat


      
      (setq units (1+ (fix (* 1.25 (/ (/ total 12) 6)))))
      	(princ ( strcat "\nYou'll want to order the following number of 6 foot long by " (rtos width 2)  " units of wireway: ---&amp;gt; "))
        (princ (rtos units 2))
	  (alert (strcat "PLEASE ORDER ***___" (rtos units 2) "___*** UNIT(S) OF 6 FOOT LONG BY " (rtos width 2) " INCH WIDE PANDUIT/WIREWAY."))
      ) ;end progn
    (princ)
    ) ;end if
  (princ)
) ;end function&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Panel Layout" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/987539i7D2667F0D027BEBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="PanelPic.JPG" alt="Panel Layout" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Panel Layout&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 14:10:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/10745209#M132630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-09T14:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/11179440#M132631</link>
      <description>&lt;P&gt;I have a question:&lt;BR /&gt;If i have many ident dynamic blocks (with different length and width) - is there any possibility to get this:&lt;BR /&gt;" -&amp;gt; Total length of dynamic Blocks with width *width (f.example 0.3)* :&lt;BR /&gt;-&amp;gt; Total length of dynamic Blocks with width *width (f.example 0.1)* :&lt;BR /&gt;-&amp;gt; Total length of dynamic Blocks with width *width (f.example 0.4)* : " and so forth....&lt;BR /&gt;&lt;BR /&gt;that would be awesome!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;THANKS!!!&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 10:12:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/11179440#M132631</guid>
      <dc:creator>georg_holter</dc:creator>
      <dc:date>2022-05-19T10:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/11179674#M132632</link>
      <description>made a new post:&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks-with/m-p/11179642" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks-with/m-p/11179642&lt;/A&gt;</description>
      <pubDate>Thu, 19 May 2022 12:10:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/11179674#M132632</guid>
      <dc:creator>georg_holter</dc:creator>
      <dc:date>2022-05-19T12:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/12448783#M132633</link>
      <description>&lt;P&gt;my regards&lt;BR /&gt;Thank you very much for this wonderful lisp, because I benefited a lot from it&lt;BR /&gt;Is it possible to put the result in a table so that it is the sum of the lengths of each individual block?&lt;BR /&gt;I wish you more success&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 18:18:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/12448783#M132633</guid>
      <dc:creator>youssef_264U854W</dc:creator>
      <dc:date>2023-12-18T18:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/12449239#M132634</link>
      <description>&lt;P&gt;Make a new thread, post a sample file with a number of blocks and the desired shape of the table.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 22:31:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/12449239#M132634</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-12-18T22:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total length of multiple dynamic blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/12449889#M132635</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Thank you very much for your response and interest&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;This is a file containing a network of pipes like the ones we want to limit for each project&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I limited it to the code that you kindly created&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;But I added DESTANC2 to it because it only measures DESTANC1. I also added it to write the result on the screen, and I may have to choose one block at a time. I want it to calculate all the blocks at once and place each block individually with the sum of its lengths in front of it in a table like the one in this file.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Many thanks and regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 07:53:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-total-length-of-multiple-dynamic-blocks/m-p/12449889#M132635</guid>
      <dc:creator>youssef_264U854W</dc:creator>
      <dc:date>2023-12-19T07:53:35Z</dc:date>
    </item>
  </channel>
</rss>

