<?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: Need AutoLISP to Insert Block Based on Area of Polyline..? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152406#M141364</link>
    <description>&lt;P&gt;That did the trick. All sorted out! Thank you again for all the help over the history of this.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Mar 2021 18:24:35 GMT</pubDate>
    <dc:creator>CBHANAN</dc:creator>
    <dc:date>2021-03-12T18:24:35Z</dc:date>
    <item>
      <title>Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5652075#M141343</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I work with structural foundation plans and need to insert certain blocks depending on what the area of each foundation is. For example, if the footing is 49 square feet, I center a 3-probe block on that foundation. Ultimately, I would love a lisp that would run through the closed polylines, find the centroid of each foundation, and then insert a block centered on the foundation. I have attached a Lisp I found online but need the conditional block insert based on the area. Any feedback is highly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 16:12:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5652075#M141343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-26T16:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5652331#M141344</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I work with structural foundation plans and need to insert certain blocks depending on what the area of each foundation is. For example, if the footing is 49 square feet, I center a 3-probe block on that foundation. Ultimately, I would love a lisp that would run through the closed polylines, find the centroid of each foundation, and then insert a block centered on the foundation. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If I may assume that your footings are all rectangular/square [as they always are in my experience], that looks a little more complicated than necessary [for instance, you don't need to create two temporary things that then need to be deleted when it's done&amp;nbsp;--&amp;nbsp;there are simpler ways to find the midpoint of a rectangular Polyline than through a Region's centroid]. &amp;nbsp;I would go about it something like this way [&lt;EM&gt;untested&lt;/EM&gt; -- I didn't create various Blocks, etc.]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:APF (/ ftgss ftgobj ftgarea); = Add Pile blocks to Footings&lt;BR /&gt;&amp;nbsp; (prompt "\nTo add piling Blocks to foundations,")&lt;BR /&gt;&amp;nbsp; (if (setq ftgss (ssget "_X" '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&amp;amp;") (70 . 1))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ; closed 4-vertex Polylines only&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (repeat (setq n (sslength ftgss)); then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (setq ftgobj (vlax-ename-&amp;gt;vla-object (ssname ftgss (setq n (1- n)))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (vla-getboundingbox ftgobj 'minpt 'maxpt)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (setq ftgarea (/ (vla-get-area ftgobj) 144)); area in square feet&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (command "_.insert"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (cond ; Block name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea &lt;FONT color="#FF0000"&gt;64&lt;/FONT&gt;) "&lt;EM&gt;&lt;FONT color="#00CCFF"&gt;Your&lt;STRONG&gt;4&lt;/STRONG&gt;PileBlockName&lt;/FONT&gt;&lt;/EM&gt;"); anything over &lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;' square&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea &lt;FONT color="#FF0000"&gt;36&lt;/FONT&gt;) "&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;3&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;"); over &lt;FONT color="#FF0000"&gt;6&lt;/FONT&gt;' square up to &lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea &lt;FONT color="#FF0000"&gt;9&lt;/FONT&gt;) "&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;2&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;"); over &lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;' square up to &lt;FONT color="#FF0000"&gt;6&lt;/FONT&gt;'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ("&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;1&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;"); anything no larger than &lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;' square&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ); cond&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "_none" (mapcar '/ (mapcar '+ (vlax-safearray-&amp;gt;list minpt) (vlax-safearray-&amp;gt;list maxpt)) '(2 2 2)); midpoint&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "" "" "" ; default scales of 1, rotation of 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ); command&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ); repeat [then]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (prompt "\nNo 4-sided closed Polyline(s) selected."); else&lt;BR /&gt;&amp;nbsp; ); if&lt;BR /&gt;&amp;nbsp; (princ) &lt;BR /&gt;); defun&lt;BR /&gt;(vl-load-com)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit the &lt;EM&gt;&lt;FONT color="#00CCFF"&gt;bluish&lt;/FONT&gt;&lt;/EM&gt; parts for your actual Block names, and the &lt;FONT color="#FF0000"&gt;red&lt;/FONT&gt; parts for your actual break-point size categories [add more categories if needed]. &amp;nbsp;It could also do other things, such as put them on a specified Layer, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If they might not always be rectangular, something involving a centroid might be appropriate for finding the insertion point, but the (cond) function selecting the Block name based on the area would still apply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also assume you are using Architectural Units [a drawing unit = an inch], and that you always want the Blocks at scales of 1 and rotation of 0, and that they don't have Attributes -- adjust accordingly for any incorrect assumptions.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 19:06:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5652331#M141344</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-05-26T19:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5652393#M141345</link>
      <description>&lt;P&gt;Kent,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;This is spot on what I was looking for! THANK YOU! Your assumptions were&amp;nbsp;correct and this saves me hours of work.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 19:47:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5652393#M141345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-26T19:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5679173#M141346</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; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;....&amp;nbsp;&lt;/P&gt;&lt;P&gt;I work with structural foundation plans and need to insert certain blocks depending on what the area of each foundation is. For example, if the footing is 49 square feet, I center a 3-probe block on that foundation. Ultimately, I would love a lisp that would run through the closed polylines, find the centroid of each foundation, and then insert a block centered on the foundation. ....&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I may assume that your footings are all rectangular/square [as they always are in my experience], that looks a little more complicated than necessary [for instance, you don't need to create two temporary things that then need to be deleted when it's done&amp;nbsp;--&amp;nbsp;there are simpler ways to find the midpoint of a rectangular Polyline than through a Region's centroid]. &amp;nbsp;I would go about it something like this way [&lt;EM&gt;untested&lt;/EM&gt; -- I didn't create various Blocks, etc.]:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:APF (/ ftgss ftgobj ftgarea); = Add Pile blocks to Footings&lt;BR /&gt;&amp;nbsp; (prompt "\nTo add piling Blocks to foundations,")&lt;BR /&gt;&amp;nbsp; (if (setq ftgss (ssget "_X" '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&amp;amp;") (70 . 1))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ; closed 4-vertex Polylines only&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (repeat (setq n (sslength ftgss)); then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (setq ftgobj (vlax-ename-&amp;gt;vla-object (ssname ftgss (setq n (1- n)))))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (vla-getboundingbox ftgobj 'minpt 'maxpt)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (setq ftgarea (/ (vla-get-area ftgobj) 144)); area in square feet&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (command "_.insert"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (cond ; Block name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea &lt;FONT color="#FF0000"&gt;64&lt;/FONT&gt;) "&lt;EM&gt;&lt;FONT color="#00CCFF"&gt;Your&lt;STRONG&gt;4&lt;/STRONG&gt;PileBlockName&lt;/FONT&gt;&lt;/EM&gt;"); anything over &lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;' square&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea &lt;FONT color="#FF0000"&gt;36&lt;/FONT&gt;) "&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;3&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;"); over &lt;FONT color="#FF0000"&gt;6&lt;/FONT&gt;' square up to &lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea &lt;FONT color="#FF0000"&gt;9&lt;/FONT&gt;) "&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;2&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;"); over &lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;' square up to &lt;FONT color="#FF0000"&gt;6&lt;/FONT&gt;'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ("&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;1&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;"); anything no larger than &lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;' square&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ); cond&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "_none" (mapcar '/ (mapcar '+ (vlax-safearray-&amp;gt;list minpt) (vlax-safearray-&amp;gt;list maxpt)) '(2 2 2)); midpoint&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "" "" "" ; default scales of 1, rotation of 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ); command&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ); repeat [then]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (prompt "\nNo 4-sided closed Polyline(s) selected."); else&lt;BR /&gt;&amp;nbsp; ); if&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;); defun&lt;BR /&gt;(vl-load-com)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit the &lt;EM&gt;&lt;FONT color="#00CCFF"&gt;bluish&lt;/FONT&gt;&lt;/EM&gt; parts for your actual Block names, and the &lt;FONT color="#FF0000"&gt;red&lt;/FONT&gt; parts for your actual break-point size categories [add more categories if needed]. &amp;nbsp;It could also do other things, such as put them on a specified Layer, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If they might not always be rectangular, something involving a centroid might be appropriate for finding the insertion point, but the (cond) function selecting the Block name based on the area would still apply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also assume you are using Architectural Units [a drawing unit = an inch], and that you always want the Blocks at scales of 1 and rotation of 0, and that they don't have Attributes -- adjust accordingly for any incorrect assumptions.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Good morning Kent,&lt;/P&gt;&lt;P&gt;I have been using the Lisp you helped me out with. I am wondering if it can be tweaked to match the rotation of the footing it is be dropped into? Many thanks in advance for any input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-CBHanan&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 13:46:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5679173#M141346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-16T13:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5679225#M141347</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;.... I am wondering if it can be tweaked to match the rotation of the footing it is be dropped into? Many thanks in advance for any input.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, if I may again make some assumptions.&amp;nbsp; If the footing Polyline is square or rectangular [all edges either parallel or perpendicular to each other], and if it doesn't matter which of the two perpendicular directions is used for the rotation angle of the piling Block [because you can't see in looking at a Polyline which corner is the start and in which direction it was drawn], try changing this part:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "" "" "" ; default scales of 1, rotation of 0&lt;BR /&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;"" ""&lt;/STRONG&gt; ; default scales of 1 &lt;FONT color="#00ccff"&gt;[only &lt;EM&gt;two&lt;/EM&gt; Enters]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;(* (/ (angle (vlax-curve-getStartPoint ftgobj) (vlax-curve-getPointAtParam ftgobj 1)) pi) 180)&lt;/FONT&gt;;&amp;nbsp;rotation &lt;FONT color="#00ccff"&gt;[converted to degrees]&lt;/FONT&gt;&lt;BR /&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or even just this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;"" ""&lt;/STRONG&gt; ; default scales of 1 &lt;FONT color="#00ccff"&gt;[only &lt;EM&gt;two&lt;/EM&gt; Enters]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;"_none" (vlax-curve-getPointAtParam ftgobj 0.5)&lt;/FONT&gt;;&amp;nbsp;rotation &lt;FONT color="#00ccff"&gt;[midpoint of first segment]&lt;/FONT&gt;&lt;BR /&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Someone may point out that both are subject to the&amp;nbsp;possibility that the parameter values of a Polyline &lt;EM&gt;can&lt;/EM&gt; rarely get out of whack, so that the vertices are not at whole-number parameter values.&amp;nbsp;&amp;nbsp;But it takes weird circumstances to get that to happen, and I've never had a problem with it.&amp;nbsp; If you find it's a problem, it could be done using the vertex locations out of the Polyline's entity data instead of VLA parameters, which would mean adding a variable&amp;nbsp;to get the entity data list for the Polyline.&amp;nbsp; I used the approaches above because there's already a variable holding something that parameters can be drawn from.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 14:12:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/5679225#M141347</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-06-16T14:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/6905791#M141348</link>
      <description>&lt;P&gt;hi. could you build something similar. I need a lisp that inserts at the cog of polylines with far more vertexes.&lt;/P&gt;&lt;P&gt;Purpose would be roomtags.&lt;/P&gt;&lt;P&gt;thankyou&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 13:04:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/6905791#M141348</guid>
      <dc:creator>ahuygen</dc:creator>
      <dc:date>2017-02-27T13:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/6905930#M141349</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3486971"&gt;@ahuygen&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;.... I need a lisp that inserts at the cog of polylines with far more vertexes. &amp;nbsp;Purpose would be roomtags.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Search this Forum [and the broader Community, and other websites] for things like "label areas" and "text in polyline" and similar wordings, and I think you'll find &lt;EM&gt;numerous&lt;/EM&gt; threads about just this kind of thing. &amp;nbsp;If you don't, start a new one -- your request is different enough from the Subject of this thread that if you get a good solution, someone else with&amp;nbsp;the same need may not be able to find it here.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 13:58:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/6905930#M141349</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-02-27T13:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10134119#M141350</link>
      <description>&lt;P&gt;Hello...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick question, is it possible to include all closed polylines (not just four sided polylines)? Also, explode blocks after insert.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;OM&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 20:05:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10134119#M141350</guid>
      <dc:creator>OM805</dc:creator>
      <dc:date>2021-03-05T20:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10134215#M141351</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9493205"&gt;@OM805&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;.... is it possible to include all closed polylines (not just four sided polylines)? Also, explode blocks after insert.&amp;nbsp;&lt;/SPAN&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try this [untested]:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(defun C:APF (/ ftgss ftgobj ftgarea); = Add Pile blocks to Footings&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; (prompt "\nTo add piling Blocks to foundations,")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; (if (setq ftgss (ssget "_X" '((0 . "LWPOLYLINE") (-4 . "&amp;amp;") (70 . 1))))&lt;EM&gt;&lt;FONT color="#FF0000"&gt;; took out the limit to 4 vertices&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ; closed Polylines only&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (repeat (setq n (sslength ftgss)); then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (setq ftgobj (vlax-ename-&amp;gt;vla-object (ssname ftgss (setq n (1- n)))))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (vla-getboundingbox ftgobj 'minpt 'maxpt)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (setq ftgarea (/ (vla-get-area ftgobj) 144)); area in square feet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (command "_.insert"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;(strcat "*"&amp;nbsp;&lt;/STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt; ; asterisk prefix Inserts already&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;exploded&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (cond ; Block name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;64&lt;/FONT&gt;&lt;SPAN&gt;) "&lt;/SPAN&gt;&lt;EM&gt;&lt;FONT color="#00CCFF"&gt;Your&lt;STRONG&gt;4&lt;/STRONG&gt;PileBlockName&lt;/FONT&gt;&lt;/EM&gt;&lt;SPAN&gt;"); anything over&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;&lt;SPAN&gt;' square&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;36&lt;/FONT&gt;&lt;SPAN&gt;) "&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;3&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;"); over&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;6&lt;/FONT&gt;&lt;SPAN&gt;' square up to&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ((&amp;gt; ftgarea&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;9&lt;/FONT&gt;&lt;SPAN&gt;) "&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;2&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;"); over&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;&lt;SPAN&gt;' square up to&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;6&lt;/FONT&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ("&lt;/SPAN&gt;&lt;FONT color="#00CCFF"&gt;&lt;EM&gt;Your&lt;STRONG&gt;1&lt;/STRONG&gt;PileBlockName&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;"); anything no larger than&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;&lt;SPAN&gt;' square&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ); cond&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;; strcat&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "_none" (mapcar '/ (mapcar '+ (vlax-safearray-&amp;gt;list minpt) (vlax-safearray-&amp;gt;list maxpt)) '(2 2 2)); midpoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "" "" ; default scale of 1, rotation of 0 &lt;EM&gt;&lt;FONT color="#FF0000"&gt;; took out one "" [for pre-exploded, asks for only one scale]&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ); command&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ); repeat [then]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; (prompt "\nNo closed Polyline(s) selected."); else &lt;FONT color="#FF0000"&gt;&lt;EM&gt;; took out mention of 4-sided&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ); if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; (princ)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;); defun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(vl-load-com)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 20:52:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10134215#M141351</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-05T20:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10134660#M141352</link>
      <description>&lt;P&gt;Nice code Kent when shape is not rectang more than 4 points mid of bounding box may place text outside the pline shape.&amp;nbsp; Thinking about a "L" I dont think there is a quick solution for odd shapes. Just a side comment, different method I use for 4 sides, use 2 diag pts add together, divide 2, using mapcar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two other solutions using points is area, and centroid, Mathematical solutions, but get area is much easier.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 03:15:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10134660#M141352</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-03-06T03:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10135185#M141353</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp; Thinking about a "L" I dont think there is a quick solution for odd shapes. Just a side comment, different method I use for 4 sides, use 2 diag pts add together, divide 2, using mapcar.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, there's no quick solution for odd shapes, but I think there may be some threads in this Forum about finding a place that "in the middle" in a way but forced to be actually inside, for just this kind of purpose [probably area labeling].&amp;nbsp; I'll let others Search for that if they need such a thing.&lt;/P&gt;
&lt;P&gt;My version finds the middle of a quadrilateral in exactly that way -- my "2 diag pts" are opposite corners of the &lt;EM&gt;bounding box&lt;/EM&gt;, whereas I assume you're talking about 2 &lt;EM&gt;opposite vertex locations&lt;/EM&gt;.&amp;nbsp; Those locations are the same as mine for an orthogonal rectangle [spread footings are usually like that], and the &lt;EM&gt;end result&lt;/EM&gt; would be the same for a rectangle at &lt;EM&gt;any&lt;/EM&gt; rotation, or for any &lt;EM&gt;parallelogram&lt;/EM&gt;, but the end result would vary with other quadrilateral shapes, such as a kite or trapezoid.&amp;nbsp; And for those, the result would be different for one pair of opposite vertices than for the other pair.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 12:54:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10135185#M141353</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-06T12:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10139406#M141354</link>
      <description>&lt;P&gt;Kent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the LISP code edit.&amp;nbsp; In short, it does the job and works. Much appreciated...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OM&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 16:53:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10139406#M141354</guid>
      <dc:creator>OM805</dc:creator>
      <dc:date>2021-03-08T16:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10150026#M141355</link>
      <description>&lt;P&gt;Kent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, the code inserts the block into all present polylines (turned off or not). Possible, to have it either select objects or select based on a layer name? Either or would work...&amp;nbsp; I did try to apply your lisp tip&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-objects-based-on-layer-name/m-p/9017917#M389749" target="_blank" rel="noopener"&gt;Select Object by Layer&lt;/A&gt;&amp;nbsp;without success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OM&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 22:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10150026#M141355</guid>
      <dc:creator>OM805</dc:creator>
      <dc:date>2021-03-11T22:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10150118#M141356</link>
      <description>&lt;P&gt;It's all in this line [from the &lt;EM&gt;first&lt;/EM&gt; version -- similar adjustments if you mean later code]:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;FONT color="#000000"&gt;(if (setq ftgss (ssget "_X" '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&amp;amp;") (70 . 1))))&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to select yourself, rather than having it find all of them, remove the "_X":&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;FONT color="#000000"&gt;(if (setq ftgss (ssget '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&amp;amp;") (70 . 1))))&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want it to find all of them on a particular Layer, keep that but add a &lt;FONT color="#0000FF"&gt;Layer filter&lt;/FONT&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;FONT color="#000000"&gt;(if (setq ftgss (ssget "_X" '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&amp;amp;") (70 . 1)&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(8 . "YourLayerName")&lt;/FONT&gt;&lt;/STRONG&gt;)))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to select yourself, but have it only "find" those on a particular Layer, do both:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;FONT color="#000000"&gt;(if (setq ftgss (ssget '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&amp;amp;") (70 . 1)&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(8 . "YourLayerName")&lt;/FONT&gt;&lt;/STRONG&gt;)))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 23:25:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10150118#M141356</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-11T23:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10150397#M141357</link>
      <description>&lt;P&gt;Kent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Noted, edited and tested with success... Thanks for the valuable help.&amp;nbsp; Like always, much appreciated...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OM&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 02:43:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10150397#M141357</guid>
      <dc:creator>OM805</dc:creator>
      <dc:date>2021-03-12T02:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10151861#M141358</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hello again Kent! Hope all is well. Been a few years since you helped me out with this issue and I've since received new computers etc. thus losing the lisps I had. I have recreated what you gave me but have been unable to get the rotation portion of the lisp to work. In reference to:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;the piling Block [because you can't see in looking at a Polyline which corner is the start and in which direction it was drawn], try changing this part:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "" "" "" ; default scales of 1, rotation of 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;to this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"" ""&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;; default scales of 1&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00ccff"&gt;[only&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;two&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Enters]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;(* (/ (angle (vlax-curve-getStartPoint ftgobj) (vlax-curve-getPointAtParam ftgobj 1)) pi) 180)&lt;/FONT&gt;;&amp;nbsp;rotation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00ccff"&gt;[converted to degrees]&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;or even just this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"" ""&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;; default scales of 1&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00ccff"&gt;[only&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;two&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Enters]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;"_none" (vlax-curve-getPointAtParam ftgobj 0.5)&lt;/FONT&gt;;&amp;nbsp;rotation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#00ccff"&gt;[midpoint of first segment]&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;How does this need to appear exactly in the lips code? I've cut/pasted it in all combinations but the block still inserts a rotation of 0 even though the poly lines are at an angle. Any insight from you is appreciated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 15:18:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10151861#M141358</guid>
      <dc:creator>CBHANAN</dc:creator>
      <dc:date>2021-03-12T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10151946#M141359</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8566741"&gt;@CBHANAN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;.... the block still inserts a rotation of 0 even though the poly lines are at an angle. Any insight from you is appreciated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The first thing that comes to mind is that maybe the Polylines &lt;EM&gt;start with two coincident vertices and a zero-length first segment&lt;/EM&gt;.&amp;nbsp; That would make your (angle) function take the angle between two instances of the same location, which always returns 0.&amp;nbsp; Or your midpoint of the first segment would be at the same location as the start point [though that could result in a non-zero rotation, depending on the orientation].&amp;nbsp; Is that a possibility?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, could the Blocks be defined for uniform scaling, in which case it won't as for both X and Y scale factors?&amp;nbsp; If so, I would expect some error message from feeding in the angle when it's finished with the command.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 15:49:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10151946#M141359</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-12T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152003#M141360</link>
      <description>&lt;P&gt;Kent,&lt;/P&gt;&lt;P&gt;Please see attached screen shot and sample file to see if it helps communicate idea across.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LISP SHOT.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/892450i5DF46E4266D3BEE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="LISP SHOT.png" alt="LISP SHOT.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 16:01:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152003#M141360</guid>
      <dc:creator>CBHANAN</dc:creator>
      <dc:date>2021-03-12T16:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152117#M141361</link>
      <description>&lt;P&gt;So it's not a coincident-vertices problem.&amp;nbsp; What does the command-line history show when you run it?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 16:32:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152117#M141361</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-12T16:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need AutoLISP to Insert Block Based on Area of Polyline..?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152147#M141362</link>
      <description>&lt;P&gt;Please see ee attached with screenshot with lisp&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SCRNSHT LISP.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/892482i55A06CB2526D7C47/image-size/large?v=v2&amp;amp;px=999" role="button" title="SCRNSHT LISP.png" alt="SCRNSHT LISP.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 16:43:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-autolisp-to-insert-block-based-on-area-of-polyline/m-p/10152147#M141362</guid>
      <dc:creator>CBHANAN</dc:creator>
      <dc:date>2021-03-12T16:43:30Z</dc:date>
    </item>
  </channel>
</rss>

