<?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: Draw *line between selected blocks and nearby blocks in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393091#M97003</link>
    <description>&lt;P&gt;sorry for my bad English.&lt;BR /&gt;&lt;BR /&gt;...and yes you are right. I mean the "nearest" block.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here is imagen:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 809px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/567997i9C050A97D3C71C6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Nov 2018 01:06:22 GMT</pubDate>
    <dc:creator>jtm2020hyo</dc:creator>
    <dc:date>2018-11-10T01:06:22Z</dc:date>
    <item>
      <title>Draw *line between selected blocks and nearby blocks</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8392752#M97001</link>
      <description>&lt;P&gt;I need select multiple blocks and use a lisp to draw a line since selected blocks-base-point to their nearby block (base poin to base point).&amp;nbsp; all those&amp;nbsp;blocks to link are different.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 21:08:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8392752#M97001</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2018-11-09T21:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Draw *line between selected blocks and nearby blocks</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8392932#M97002</link>
      <description>&lt;P&gt;Post an image or sample drawing.&amp;nbsp; Even without one, questions come to mind.&amp;nbsp; What is "nearby"?&amp;nbsp; The nearest one only, no matter how far away?&amp;nbsp; More than one if they are within a certain distance?&amp;nbsp; Nearby as distance between insertion points, or distance between any parts on the Blocks?&amp;nbsp; Etc.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 22:24:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8392932#M97002</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-11-09T22:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Draw *line between selected blocks and nearby blocks</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393091#M97003</link>
      <description>&lt;P&gt;sorry for my bad English.&lt;BR /&gt;&lt;BR /&gt;...and yes you are right. I mean the "nearest" block.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here is imagen:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 809px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/567997i9C050A97D3C71C6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 01:06:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393091#M97003</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2018-11-10T01:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Draw *line between selected blocks and nearby blocks</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393781#M97004</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this........(keep it in mind the total number of selected block must be less than&amp;nbsp;&lt;SPAN&gt;the total number of nearby other blocks)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:BBL ( / )
(vl-load-com)
(setq SB_lst nil)
(setq NB_lst nil)
(princ "\nSelect a block(For Block Name) from which you want to draw line to Nearby Block (Other than Selected block)")
(Setq SB_Name (cdr (assoc 2 (entget(car(entsel)))))) 
(Setq selectionset (ssget "_A" '((0 . "INSERT"))))
(repeat (setq N (sslength selectionset))
	(setq Data (ssname selectionset (setq N (- N 1))))
	(setq EntityData (entget Data))
	(setq B_Name (cdr (assoc 2 EntityData)))
	(setq BP_Block (cdr (assoc 10 EntityData)))
	(if (= SB_Name B_Name)
		(setq SB_lst (cons BP_Block SB_lst))
		(setq NB_lst (cons BP_Block NB_lst))
	)
)
(repeat (setq N (length SB_lst))
	(setq BP_SB (nth (setq N (- N 1)) SB_lst))
	(setq DIS_lst nil)
	(repeat (setq N1 (length NB_lst))
		(setq BP_NB (nth (setq N1 (- N1 1)) NB_lst))
	    	(setq PD (distance BP_SB BP_NB))
		(setq DIS_lst (cons PD DIS_lst))
	)
(setq LDP (vl-position (apply 'min DIS_lst) DIS_lst))
(setq NP (nth LDP NB_lst))
(command "line" BP_SB NP "")
(princ)
)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 18:46:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393781#M97004</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2018-11-10T18:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Draw *line between selected blocks and nearby blocks</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393809#M97005</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5869979"&gt;@dbhunia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this........(keep it in mind the total number of selected block must be less than&amp;nbsp;&lt;SPAN&gt;the total number of nearby other blocks)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:BBL ( / )
(vl-load-com)
(setq SB_lst nil)
(setq NB_lst nil)
(princ "\nSelect a block(For Block Name) from which you want to draw line to Nearby Block (Other than Selected block)")
(Setq SB_Name (cdr (assoc 2 (entget(car(entsel)))))) 
(Setq selectionset (ssget "_A" '((0 . "INSERT"))))
(repeat (setq N (sslength selectionset))
	(setq Data (ssname selectionset (setq N (- N 1))))
	(setq EntityData (entget Data))
	(setq B_Name (cdr (assoc 2 EntityData)))
	(setq BP_Block (cdr (assoc 10 EntityData)))
	(if (= SB_Name B_Name)
		(setq SB_lst (cons BP_Block SB_lst))
		(setq NB_lst (cons BP_Block NB_lst))
	)
)
(repeat (setq N (length SB_lst))
	(setq BP_SB (nth (setq N (- N 1)) SB_lst))
	(setq DIS_lst nil)
	(repeat (setq N1 (length NB_lst))
		(setq BP_NB (nth (setq N1 (- N1 1)) NB_lst))
	    	(setq PD (distance BP_SB BP_NB))
		(setq DIS_lst (cons PD DIS_lst))
	)
(setq LDP (vl-position (apply 'min DIS_lst) DIS_lst))
(setq NP (nth LDP NB_lst))
(command "line" BP_SB NP "")
(princ)
)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;thanks. this work for me. you are pretty smart.&lt;BR /&gt;&lt;BR /&gt;Is possible to select multiple different blocks?&lt;BR /&gt;&lt;BR /&gt;and create multiple prompt with rules like:&lt;BR /&gt;&lt;BR /&gt;1 allow draw *line between block with the same name (y/n)&lt;BR /&gt;2 only draw *line between blocks same layer &lt;SPAN&gt;&amp;nbsp;(y/n)&lt;/SPAN&gt;&lt;BR /&gt;3 allow selected block with mouse&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;(y/n)&lt;BR /&gt;&lt;/SPAN&gt;4 select &lt;SPAN&gt;"&lt;/SPAN&gt;one block name&lt;SPAN&gt;"&lt;/SPAN&gt;&amp;nbsp;to link with "another&amp;nbsp;block name&lt;SPAN&gt;"&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;(y/n)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 19:22:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8393809#M97005</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2018-11-10T19:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Draw *line between selected blocks and nearby blocks</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8394041#M97006</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5869979"&gt;@dbhunia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this........(keep it in mind the total number of selected block must be less than&amp;nbsp;&lt;SPAN&gt;the total number of nearby other blocks)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:BBL ( / )
(vl-load-com)
(setq SB_lst nil)
(setq NB_lst nil)
(princ "\nSelect a block(For Block Name) from which you want to draw line to Nearby Block (Other than Selected block)")
(Setq SB_Name (cdr (assoc 2 (entget(car(entsel)))))) 
(Setq selectionset (ssget "_A" '((0 . "INSERT"))))
(repeat (setq N (sslength selectionset))
	(setq Data (ssname selectionset (setq N (- N 1))))
	(setq EntityData (entget Data))
	(setq B_Name (cdr (assoc 2 EntityData)))
	(setq BP_Block (cdr (assoc 10 EntityData)))
	(if (= SB_Name B_Name)
		(setq SB_lst (cons BP_Block SB_lst))
		(setq NB_lst (cons BP_Block NB_lst))
	)
)
(repeat (setq N (length SB_lst))
	(setq BP_SB (nth (setq N (- N 1)) SB_lst))
	(setq DIS_lst nil)
	(repeat (setq N1 (length NB_lst))
		(setq BP_NB (nth (setq N1 (- N1 1)) NB_lst))
	    	(setq PD (distance BP_SB BP_NB))
		(setq DIS_lst (cons PD DIS_lst))
	)
(setq LDP (vl-position (apply 'min DIS_lst) DIS_lst))
(setq NP (nth LDP NB_lst))
(command "line" BP_SB NP "")
(princ)
)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is possible to draw a line between the selected block-base-point with the nearest block over defined angle?&lt;BR /&gt;&lt;BR /&gt;In my example, I linked circles with the nearest block over 180 grades axis&amp;nbsp;+Y :&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="image.png" style="width: 818px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/568190iA315F8D17CF5AA91/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 23:31:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/draw-line-between-selected-blocks-and-nearby-blocks/m-p/8394041#M97006</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2018-11-10T23:31:29Z</dc:date>
    </item>
  </channel>
</rss>

