<?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 AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644733#M148</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am developing an AutoLISP script designed to generate perpendicular construction lines along a reference curve (which may be a line, polyline, or spline), based on distance values imported from a CSV file. The CSV parsing and initial vertex marking functions are fully implemented and operational.&lt;/P&gt;&lt;P&gt;The next step is to extend the script to insert dynamic blocks between these perpendicular lines, supporting two distinct insertion strategies:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":small_blue_diamond:"&gt;🔹&lt;/span&gt; Type 1 – Single dynamic block with action parameters anchored at segment boundaries&lt;/P&gt;&lt;P&gt;In this mode, a single dynamic block is placed between two consecutive perpendicular lines. The block’s action parameters (e.g., grips or control points) must precisely coincide with the intersection points defining the start and end of the segment, ensuring accurate parametric control and alignment.&lt;/P&gt;&lt;P&gt;Example block name: "Block_With_Grips".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":small_blue_diamond:"&gt;🔹&lt;/span&gt; Type 2 – Multiple repeated dynamic blocks distributed uniformly along the segment&lt;/P&gt;&lt;P&gt;In this case, the script inserts the maximum number of identical dynamic blocks possible between two consecutive perpendicular lines, provided that each block maintains a minimum spacing of 4.5 meters.&lt;/P&gt;&lt;P&gt;The segment length is evenly divided among these blocks, guaranteeing equal spacing without residual gaps.&lt;/P&gt;&lt;P&gt;For example, for a 13-meter segment, two blocks would be inserted at intervals of 6.5 meters.&lt;/P&gt;&lt;P&gt;Each repeated block contains a centered grip (action parameter), which must be properly aligned to the block’s midpoint for user manipulation and parameter adjustment.&lt;/P&gt;&lt;P&gt;Sample CSV snippet:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;10.5,Block_single&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;23.2,Block_Repeated&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;45.0,Block_Repeated&lt;BR /&gt;&lt;BR /&gt;Hence, the script inserts a "Block_With_Grips" between the 10.5 m and 23.2 m marks, and subsequently replicates the "Block_Repeated" blocks along the following segments according to the calculated spacing.&lt;/P&gt;&lt;P&gt;Currently, I am implementing the CSV second-column parsing logic and developing the algorithm for block insertion, including calculation of insertion points, block rotation to align with the perpendicular lines, and precise positioning of action parameters to ensure dynamic behavior within AutoCAD’s block framework.&lt;/P&gt;&lt;P&gt;I welcome any suggestions or best practices regarding the efficient management of block placement&lt;/P&gt;&lt;P&gt;Thank you in advance for your insights!&lt;BR /&gt;&lt;BR /&gt;Attachments:&lt;BR /&gt;&lt;BR /&gt;corruent .LSP&lt;/P&gt;&lt;P&gt;DWG with the blocks (Far left is the one that has to repeat and can’t be less than 4.5 m spacing, middle is the one that goes only once per segment, and far right is another that has to repeat but can’t be less than 2.25 m spacing)&lt;/P&gt;</description>
    <pubDate>Thu, 22 May 2025 14:09:15 GMT</pubDate>
    <dc:creator>_Matheus_</dc:creator>
    <dc:date>2025-05-22T14:09:15Z</dc:date>
    <item>
      <title>AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644733#M148</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am developing an AutoLISP script designed to generate perpendicular construction lines along a reference curve (which may be a line, polyline, or spline), based on distance values imported from a CSV file. The CSV parsing and initial vertex marking functions are fully implemented and operational.&lt;/P&gt;&lt;P&gt;The next step is to extend the script to insert dynamic blocks between these perpendicular lines, supporting two distinct insertion strategies:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":small_blue_diamond:"&gt;🔹&lt;/span&gt; Type 1 – Single dynamic block with action parameters anchored at segment boundaries&lt;/P&gt;&lt;P&gt;In this mode, a single dynamic block is placed between two consecutive perpendicular lines. The block’s action parameters (e.g., grips or control points) must precisely coincide with the intersection points defining the start and end of the segment, ensuring accurate parametric control and alignment.&lt;/P&gt;&lt;P&gt;Example block name: "Block_With_Grips".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":small_blue_diamond:"&gt;🔹&lt;/span&gt; Type 2 – Multiple repeated dynamic blocks distributed uniformly along the segment&lt;/P&gt;&lt;P&gt;In this case, the script inserts the maximum number of identical dynamic blocks possible between two consecutive perpendicular lines, provided that each block maintains a minimum spacing of 4.5 meters.&lt;/P&gt;&lt;P&gt;The segment length is evenly divided among these blocks, guaranteeing equal spacing without residual gaps.&lt;/P&gt;&lt;P&gt;For example, for a 13-meter segment, two blocks would be inserted at intervals of 6.5 meters.&lt;/P&gt;&lt;P&gt;Each repeated block contains a centered grip (action parameter), which must be properly aligned to the block’s midpoint for user manipulation and parameter adjustment.&lt;/P&gt;&lt;P&gt;Sample CSV snippet:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;10.5,Block_single&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;23.2,Block_Repeated&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;45.0,Block_Repeated&lt;BR /&gt;&lt;BR /&gt;Hence, the script inserts a "Block_With_Grips" between the 10.5 m and 23.2 m marks, and subsequently replicates the "Block_Repeated" blocks along the following segments according to the calculated spacing.&lt;/P&gt;&lt;P&gt;Currently, I am implementing the CSV second-column parsing logic and developing the algorithm for block insertion, including calculation of insertion points, block rotation to align with the perpendicular lines, and precise positioning of action parameters to ensure dynamic behavior within AutoCAD’s block framework.&lt;/P&gt;&lt;P&gt;I welcome any suggestions or best practices regarding the efficient management of block placement&lt;/P&gt;&lt;P&gt;Thank you in advance for your insights!&lt;BR /&gt;&lt;BR /&gt;Attachments:&lt;BR /&gt;&lt;BR /&gt;corruent .LSP&lt;/P&gt;&lt;P&gt;DWG with the blocks (Far left is the one that has to repeat and can’t be less than 4.5 m spacing, middle is the one that goes only once per segment, and far right is another that has to repeat but can’t be less than 2.25 m spacing)&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 14:09:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644733#M148</guid>
      <dc:creator>_Matheus_</dc:creator>
      <dc:date>2025-05-22T14:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644757#M149</link>
      <description>&lt;P&gt;Post some DWG illustrating the desired outcome. Also post a respective csv file.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 14:21:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644757#M149</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-05-22T14:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644790#M150</link>
      <description>&lt;P&gt;the lisp i use today is just with the distances, i want to implement the names of the parking spaces&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 14:36:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644790#M150</guid>
      <dc:creator>_Matheus_</dc:creator>
      <dc:date>2025-05-22T14:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644832#M151</link>
      <description>&lt;P&gt;Post an example with a curve.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 14:55:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644832#M151</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-05-22T14:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644860#M152</link>
      <description>&lt;P&gt;sorry for the lack of information provided, DWG attached;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 15:06:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644860#M152</guid>
      <dc:creator>_Matheus_</dc:creator>
      <dc:date>2025-05-22T15:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644869#M153</link>
      <description>&lt;P&gt;if it's too difficult it could be like a straight line between the perpendicular lines, but like that would be amazing&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 15:11:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644869#M153</guid>
      <dc:creator>_Matheus_</dc:creator>
      <dc:date>2025-05-22T15:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644919#M154</link>
      <description>&lt;P&gt;Did you write the code you posted? If I give you an example of type 1, would you be able to do type 2?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:InsertParallelParkingSlot ( / e m c d i p q)

  (if (and (setq e (car (entsel "Select a polyline: ")))
	   (setq m (vlax-curve-getdistatparam e (vlax-curve-getendparam e)))
	   (setq c (fix (/ m 4.5)))
	   (setq d (/ m c))
	   (setq i 0)
	   )
    (repeat c
      (and (setq p (vlax-curve-getpointatdist e (* d i)))
	   (setq q (vlax-curve-getpointatdist e (* d (1+ i))))
	   (vl-cmdf "_.insert" "VAGA PARALELA" "_s" 1 "_r" "_non" p "_non" q "_non" p)
	   (setpropertyvalue (entlast) "AcDbDynBlockPropertyDistance1" (distance p q))
	   )
      (setq i (1+ i))))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT...&amp;nbsp;You know that this is ridiculous.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eekeeCZ_0-1747928714113.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1536226iB8EA0660FF35DA04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="eekeeCZ_0-1747928714113.png" alt="eekeeCZ_0-1747928714113.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You need to add some math around it to avoid these overlaps. I didn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 15:44:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13644919#M154</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2025-05-22T15:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP Script for Inserting Dynamic Blocks Between Perpendicular Lines Based on CSV Input</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13645047#M155</link>
      <description>&lt;P&gt;actually i didn't write it, but i think i can do it yes, and yeah, that overlap is indeed ridiculous, but in what i will be using will be very rare that it is a so closed curve, so it is fine&lt;BR /&gt;Thanks for the help o7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 16:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-script-for-inserting-dynamic-blocks-between/m-p/13645047#M155</guid>
      <dc:creator>_Matheus_</dc:creator>
      <dc:date>2025-05-22T16:59:44Z</dc:date>
    </item>
  </channel>
</rss>

