<?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: Counting Blocks and Polyline Length Inside a Block Boundary in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007507#M169889</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote &lt;FONT color="#999999"&gt;[in Message 2]&lt;/FONT&gt;:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In 056 [and maybe also elsewhere], there's a little &lt;EM&gt;loop&lt;/EM&gt; in the Polyline path.&amp;nbsp; The length of that loop would be included.&amp;nbsp; If it's just a graphic representation, and not of "real" size or shape, would that throw off your results to a meaningful degree?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5830512"&gt;@adaptacad&lt;/a&gt;&amp;nbsp;, that's an as-yet-unanswered question, and a situation also noticed by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8575899"&gt;@daniel_cadext&lt;/a&gt;&amp;nbsp;in Message 11.&amp;nbsp; And in further looking into it, I find that there are &lt;EM&gt;very many&lt;/EM&gt; VIEW Blocks with those inside, and also that &lt;STRONG&gt;&lt;EM&gt;all of those I checked&lt;/EM&gt;&lt;/STRONG&gt; [which was far from all of them] &lt;EM&gt;&lt;STRONG&gt;loop around 5 times over top of themselves!&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; They are of 10-unit circumference, which adds &lt;STRONG&gt;&lt;EM&gt;50 drawing units&lt;/EM&gt;&lt;/STRONG&gt; of Polyline length for every one of them.&amp;nbsp; Within [randomly-selected] Block 009, the total length of Polyline is about 763 drawing units, as opposed to about 713 units omitting the loops -- about a &lt;EM&gt;&lt;STRONG&gt;7% increase&lt;/STRONG&gt;&lt;/EM&gt; in length.&amp;nbsp; Does that matter?&lt;/P&gt;
&lt;P&gt;If the Polylines are all always made up of &lt;EM&gt;only line segments&lt;/EM&gt; apart from those overlapping loops, it may be possible to find a way to discount the length of the loopings, if that's appropriate.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Feb 2026 14:21:24 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2026-02-06T14:21:24Z</dc:date>
    <item>
      <title>Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006235#M169870</link>
      <description>&lt;P&gt;Good afternoon, I hope this post finds you well.&lt;/P&gt;&lt;P&gt;I have already tried to solve this with the help of AI, but I was not able to achieve the expected result, so I would like to ask for some guidance.&lt;/P&gt;&lt;P&gt;I have a block called &lt;STRONG&gt;VIEW&lt;/STRONG&gt;. Inside this block, there are other blocks as well as some polylines.&lt;/P&gt;&lt;P&gt;My goal is to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Count how many blocks exist &lt;STRONG&gt;inside the VIEW block&lt;/STRONG&gt;;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Calculate the &lt;STRONG&gt;total length of polylines only within the internal area of the VIEW block&lt;/STRONG&gt;;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Store these values in the &lt;STRONG&gt;attributes of the VIEW block itself&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Counting the blocks is not the main issue. The main challenge is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Splitting the polylines exactly at the intersection points with the VIEW block boundary;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Correctly summing the length of all polyline segments that lie inside this boundary;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Restoring the polylines to their original state&lt;/STRONG&gt;, so they are not left broken after the calculation.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I am attaching the &lt;STRONG&gt;DWG file&lt;/STRONG&gt; to make the scenario easier to understand.&lt;/P&gt;&lt;P&gt;Has anyone dealt with a similar situation or could point me in the right direction to solve this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adaptacad_0-1770312127043.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1616522i0D0D4B41CE21FEC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="adaptacad_0-1770312127043.png" alt="adaptacad_0-1770312127043.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 17:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006235#M169870</guid>
      <dc:creator>adaptacad</dc:creator>
      <dc:date>2026-02-05T17:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006315#M169871</link>
      <description>&lt;P&gt;I can imagine an approach, at least:&lt;/P&gt;
&lt;P&gt;Select a VIEW Block, or select them all and apply what follows to each.&lt;/P&gt;
&lt;P&gt;Given the plain rectangular shape and orthogonal orientation of it, using its bounding box, draw a temporary Polyline rectangle over its boundary.&lt;/P&gt;
&lt;P&gt;Using its opposite corners for a Crossing window, find all Polylines within or crossing it.&lt;/P&gt;
&lt;P&gt;Using the same for a Window [not Crossing] window, find all the BLK_COUNT Blocks inside it.&lt;/P&gt;
&lt;P&gt;Using the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (intersectwith)&lt;/STRONG&gt; &lt;/FONT&gt;method, find the intersections between the Polyline(s) and the VIEW Block boundary.&lt;/P&gt;
&lt;P&gt;If there are 2 intersections of the &lt;EM&gt;same&lt;/EM&gt; Polyline, find the distances along that at each intersection with&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (vlax-curve-getDistAtPoint)&lt;/STRONG&gt;&lt;/FONT&gt; , and from those calculate the length along the Polyline inside.&amp;nbsp; [There should be no need to Break the Polyline.]&lt;/P&gt;
&lt;P&gt;If there are 2 Polylines with 1 intersection of each with the boundary:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Determine whether the end of each Polyline that's inside is its start or its end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Calculate the distances of each portion from that end to its intersection with the boundary;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Add the distances for a total length.&lt;/P&gt;
&lt;P&gt;Delete the temporary rectangle.&lt;/P&gt;
&lt;P&gt;Use&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; (setpropertyvalue)&lt;/STRONG&gt; &lt;/FONT&gt;to put the appropriate values [converted to Text strings] into the appropriate Attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Potential complications:&lt;/P&gt;
&lt;P&gt;If a BLK_COUNT Block straddles the boundary between two VIEW Blocks [for example, one between 001 &amp;amp; 002], it will &lt;EM&gt;not&lt;/EM&gt; be seen by a Window selection for &lt;EM&gt;either&lt;/EM&gt; VIEW Block.&amp;nbsp; But it &lt;EM&gt;would&lt;/EM&gt; be seen by Crossing selections for &lt;EM&gt;both&lt;/EM&gt; VIEW Blocks.&amp;nbsp; Maybe it should be done by Crossing, so that all are seen, and every BLK_COUNT Block checked for which VIEW Block it should be credited to.&amp;nbsp; But that check would logically be for whether its insertion point is inside.&amp;nbsp; Unfortunately, the BLK_COUNT insertion point is &lt;EM&gt;not in the middle&lt;/EM&gt;.&amp;nbsp; That one that straddles 001 &amp;amp; 002 has its insertion point inside 001, but more of itself inside 002.&amp;nbsp; And the one just to its right is fully [in extents and insertion point] inside 001, but the Polyline path near it is inside 002, if the location along the path is what matters -- it would &lt;EM&gt;not&lt;/EM&gt; be seen by either variety of window in selection for 002.&amp;nbsp; How should those be assigned?&lt;/P&gt;
&lt;P&gt;Could there ever be &lt;EM&gt;more than two&lt;/EM&gt; Polylines associated with a given VIEW Block?&amp;nbsp; [I don't see any like that in the sample drawing, but....]&lt;/P&gt;
&lt;P&gt;Could the VIEW Blocks ever be at some non-orthogonal rotation?&lt;/P&gt;
&lt;P&gt;Would a Polyline ever exit a VIEW Block boundary &lt;EM&gt;and then come back inside&lt;/EM&gt; before exiting again?&amp;nbsp; [That very nearly happens between 001 &amp;amp; 002.]&amp;nbsp; That would greatly complicate what I'm picturing.&lt;/P&gt;
&lt;P&gt;Also:&lt;/P&gt;
&lt;P&gt;There are at least 3 places where the Polylines go &lt;EM&gt;entirely outside&lt;/EM&gt; of any VIEW Block.&amp;nbsp; This approach would not see the lengths of those bits.&amp;nbsp; You would presumably need to check for that yourself and shift VIEW Blocks to "catch" all of the lengths of all Polylines.&lt;/P&gt;
&lt;P&gt;In 056 [and maybe also elsewhere], there's a little &lt;EM&gt;loop&lt;/EM&gt; in the Polyline path.&amp;nbsp; The length of that loop would be included.&amp;nbsp; If it's just a graphic representation, and not of "real" size or shape, would that throw off your results to a meaningful degree?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 18:37:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006315#M169871</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2026-02-05T18:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006423#M169872</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;I'll try to do as your way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for&amp;nbsp; it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 19:19:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006423#M169872</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2026-02-05T19:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006718#M169879</link>
      <description>&lt;P&gt;Just an idea you can select block X ie 001 and use a cutter lisp to cut around the block then look for plines inside that block and sub blocks, get pline length, matches your sample dwg, so you say but stuff is gone ! With lisp a variable is still saved even after doing undo so the cut step is undone, go to next block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have to go now will try later to do something later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 00:06:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14006718#M169879</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2026-02-06T00:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007033#M169881</link>
      <description>&lt;P&gt;had a go with Python.&amp;nbsp; &amp;nbsp;&lt;A href="https://gist.github.com/CEXT-Dan/d802bf84977ecf16c98a102c40bc1c0d" target="_blank"&gt;https://gist.github.com/CEXT-Dan/d802bf84977ecf16c98a102c40bc1c0d&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 20:58:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007033#M169881</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T20:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007041#M169882</link>
      <description>&lt;P&gt;I had written pl_clip to test intersections, AI said, nah bruh, let’s roll a Cohen-Sutherland algo&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 08:23:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007041#M169882</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T08:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007085#M169883</link>
      <description>&lt;P&gt;this fills out the attributes. code is here&amp;nbsp;&lt;A title="gist " href="https://gist.github.com/CEXT-Dan/d802bf84977ecf16c98a102c40bc1c0d" target="_blank" rel="noopener"&gt;gist&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clipper.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1616688iAACD07E6291796E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="clipper.png" alt="clipper.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 20:57:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007085#M169883</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T20:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007139#M169884</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;Thank you for the considerations raised — they help clarify the rules and remove ambiguity. Below are the answers point by point, based on the intended behavior of the process:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;BLK_COUNT blocks on the boundary between VIEWs&lt;/STRONG&gt;&lt;BR /&gt;A BLK_COUNT block must be counted in the VIEW where its &lt;STRONG&gt;insertion / intersection point&lt;/STRONG&gt; is located.&lt;BR /&gt;If a block happens to lie &lt;STRONG&gt;exactly on the boundary between two VIEWs&lt;/STRONG&gt;, it should be counted &lt;STRONG&gt;only once&lt;/STRONG&gt;, and it may be assigned to either VIEW.&lt;BR /&gt;In practice, this situation is rare, since blocks are unlikely to be placed exactly on a VIEW boundary.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Polylines entering and exiting a VIEW multiple times&lt;/STRONG&gt;&lt;BR /&gt;Yes, a polyline may enter and exit the same VIEW more than once.&lt;BR /&gt;Although this is uncommon, it can occur and must be handled correctly by summing &lt;STRONG&gt;all polyline segments that lie within the VIEW&lt;/STRONG&gt;, regardless of how many intersections exist.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;More than two polylines per VIEW&lt;/STRONG&gt;&lt;BR /&gt;Yes, a single VIEW may contain &lt;STRONG&gt;more than two polylines&lt;/STRONG&gt;.&lt;BR /&gt;The calculation should include all polylines that intersect or cross the VIEW, adding together the internal lengths of each one.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;VIEW rotation&lt;/STRONG&gt;&lt;BR /&gt;VIEW blocks will &lt;STRONG&gt;never be rotated&lt;/STRONG&gt;.&lt;BR /&gt;They will always be orthogonal and aligned exactly as shown, which removes the need to handle rotation or complex transformations.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Polyline segments outside any VIEW&lt;/STRONG&gt;&lt;BR /&gt;Polyline segments that fall &lt;STRONG&gt;outside of all VIEWs must not be counted&lt;/STRONG&gt;.&lt;BR /&gt;Only the portions of polylines that lie within a VIEW boundary are relevant and should be included in the total.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 06 Feb 2026 10:02:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007139#M169884</guid>
      <dc:creator>adaptacad</dc:creator>
      <dc:date>2026-02-06T10:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007141#M169885</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8575899"&gt;@daniel_cadext&lt;/a&gt;&amp;nbsp;Thanks for the reply, but I have no idea how to run Python in AutoCAD!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 10:03:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007141#M169885</guid>
      <dc:creator>adaptacad</dc:creator>
      <dc:date>2026-02-06T10:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007197#M169886</link>
      <description>&lt;P&gt;Ah sorry, &amp;nbsp;it’s all the same API under the hood, so whom ever you recruit to write the final version can use this as inspiration. The clipping algorithm should handle items 2-5, since it works on segments, see &lt;A href="https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm" target="_blank"&gt;https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn’t handle item 1, though it should be fairly trivial to mark the BLK_COUNTs that intersect with multiple VIEWs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers : )&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 10:54:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007197#M169886</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T10:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007288#M169888</link>
      <description>&lt;P&gt;Side note, I updated my routine to account for BLK_COUNTs that overlap VIEWs. And I spotted this part of the polyline. So mine won’t work after all, since I split the polyline into segments.. oops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: i added&amp;nbsp;&lt;/P&gt;&lt;P&gt;def pl_clip_arc_seg(self, _arc: Ge.CircArc2d):&lt;/P&gt;&lt;P&gt;assumes the curve never actually intersects the view. the results seem correct in that the circumference&lt;/P&gt;&lt;P&gt;is included in the polyline length&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oh no.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1616727iA86635F641C74827/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oh no.png" alt="oh no.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 13:37:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007288#M169888</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T13:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007507#M169889</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote &lt;FONT color="#999999"&gt;[in Message 2]&lt;/FONT&gt;:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In 056 [and maybe also elsewhere], there's a little &lt;EM&gt;loop&lt;/EM&gt; in the Polyline path.&amp;nbsp; The length of that loop would be included.&amp;nbsp; If it's just a graphic representation, and not of "real" size or shape, would that throw off your results to a meaningful degree?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5830512"&gt;@adaptacad&lt;/a&gt;&amp;nbsp;, that's an as-yet-unanswered question, and a situation also noticed by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8575899"&gt;@daniel_cadext&lt;/a&gt;&amp;nbsp;in Message 11.&amp;nbsp; And in further looking into it, I find that there are &lt;EM&gt;very many&lt;/EM&gt; VIEW Blocks with those inside, and also that &lt;STRONG&gt;&lt;EM&gt;all of those I checked&lt;/EM&gt;&lt;/STRONG&gt; [which was far from all of them] &lt;EM&gt;&lt;STRONG&gt;loop around 5 times over top of themselves!&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; They are of 10-unit circumference, which adds &lt;STRONG&gt;&lt;EM&gt;50 drawing units&lt;/EM&gt;&lt;/STRONG&gt; of Polyline length for every one of them.&amp;nbsp; Within [randomly-selected] Block 009, the total length of Polyline is about 763 drawing units, as opposed to about 713 units omitting the loops -- about a &lt;EM&gt;&lt;STRONG&gt;7% increase&lt;/STRONG&gt;&lt;/EM&gt; in length.&amp;nbsp; Does that matter?&lt;/P&gt;
&lt;P&gt;If the Polylines are all always made up of &lt;EM&gt;only line segments&lt;/EM&gt; apart from those overlapping loops, it may be possible to find a way to discount the length of the loopings, if that's appropriate.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 14:21:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007507#M169889</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2026-02-06T14:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007712#M169893</link>
      <description>&lt;P&gt;I hadn’t noticed that detail, but it makes no difference. The polyline can be counted, ignoring that “leftover.”&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 16:43:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14007712#M169893</guid>
      <dc:creator>adaptacad</dc:creator>
      <dc:date>2026-02-06T16:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008064#M169896</link>
      <description>&lt;P&gt;- I moved the code to a &lt;A title="gist" href="https://gist.github.com/CEXT-Dan/d802bf84977ecf16c98a102c40bc1c0d" target="_blank" rel="noopener"&gt;gist&lt;/A&gt; as not to spam the forum.&lt;/P&gt;&lt;P&gt;- I removed counting the loops, just uncomment the code if you need it&lt;/P&gt;&lt;P&gt;- I added output to pandas - &amp;gt; Excel, adjust the path.&lt;/P&gt;&lt;P&gt;- attached the drawing and excel if someone wants to validate&lt;/P&gt;&lt;P&gt;Sorry for spamming the lisp forum with python, seemed like a fun test, maybe the code can be useful&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 21:14:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008064#M169896</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T21:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008117#M169899</link>
      <description>&lt;P&gt;This is indeed the expected result. However, the solution is written in Python, and as far as I know, Python is not commonly used in AutoCAD — at least I don’t use it, and I’m not even sure how to load or run it (is there something like a pyload command?).&lt;/P&gt;&lt;P&gt;Thank you very much for taking the time to help. I’ll try to convert the logic to AutoLISP with the help of AI on my side. Much appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 21:56:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008117#M169899</guid>
      <dc:creator>adaptacad</dc:creator>
      <dc:date>2026-02-06T21:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008171#M169900</link>
      <description>&lt;P&gt;Yes, there’s pyload / pyreload commands. There’s a link in my signature; look for the YouTube video on how-to install. You can think of it as a “Scripting ObjectARX”&lt;/P&gt;&lt;P&gt;AI should be able to generate a Cohen-Sutherland routine in Lisp. Just feed it the polyline segments and block extents. I’m sure there lisp samples to set attributes&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 22:50:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008171#M169900</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-06T22:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008175#M169901</link>
      <description>&lt;P&gt;It works great! Thank you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 22:53:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008175#M169901</guid>
      <dc:creator>adaptacad</dc:creator>
      <dc:date>2026-02-06T22:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008216#M169902</link>
      <description>&lt;P&gt;Something I am playing with is use Bounding box make a pline around the block. I am trying Extrim and Coookie Cutter to trim any lines or plines that cross the block. Yes then will look at counting blocks inside. Again whilst using a cut method Undo puts the trimmed objects back but lisp has already saved the values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to find time.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 23:56:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008216#M169902</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2026-02-06T23:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Blocks and Polyline Length Inside a Block Boundary</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008245#M169904</link>
      <description>&lt;P&gt;I just noticed that there’s already a AcGeClipBoundary2d::clipPolyline in ARX that I must have missed wrapping. I’ve been adding my own methods to enhance some of the existing classes.&lt;/P&gt;&lt;P&gt;Extents2d.intersectsWith(other Extents2d)&lt;BR /&gt;Extents2d.intersectsWith(other LinearEnt2d)&lt;BR /&gt;Extents2d.contains (other Extents2d)&lt;BR /&gt;Extents2d.contains (other Point2d)&lt;/P&gt;&lt;P&gt;Maybe I should add Extents2d.clip(AcGeLinearEnt2d), and try LinearEnt2d.clip(AcGeCircArc2d), or the inverse AcGeLinearEnt2d.clip..&lt;/P&gt;</description>
      <pubDate>Sat, 07 Feb 2026 00:59:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/counting-blocks-and-polyline-length-inside-a-block-boundary/m-p/14008245#M169904</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2026-02-07T00:59:31Z</dc:date>
    </item>
  </channel>
</rss>

