<?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: Lisp move Block HELP in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7575614#M111710</link>
    <description>&lt;P&gt;There's a relatively quick way to do it manually:&amp;nbsp; Move the Block and Text so that its [in this case] upper left corner lies anywhere along the left leg of the Polyline [in the image, I have already Moved&amp;nbsp;them [the dashed blue is the original position] to put the Block's insertion point at the far left end, but you could put that location at the MIDpoint, or with a NEArest Osnap anywhere].&amp;nbsp; Draw a temporary Line along that left leg, and Move that [maintaining its angle] so that it passes through the [in this case] upper-right corner of the Block [the green Line here, already so Moved].&amp;nbsp; Finally, Move the Block and Text between the obvious INTersection points, and Erase the temporary Line.&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="BlockPosition.PNG" style="width: 460px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/431337iA7F7930C107EFE4B/image-size/large?v=v2&amp;amp;px=999" role="button" title="BlockPosition.PNG" alt="BlockPosition.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To automate that could be very tricky.&amp;nbsp; The Block in that skewed orientation is &lt;EM&gt;at 0 rotation&lt;/EM&gt;, which makes it a lot harder to extract where that upper right corner is from its information, than it would be if the Block at 0 rotation were orthogonally oriented.&amp;nbsp; The starting vertex of the Polyline in the Block is not at the Block's insertion point, and I can't imagine you could always count on that Polyline being drawn always from the same corner and always in the same direction, nor that the white Polyline would always be drawn in the same direction.&amp;nbsp; And the Text is a separate object from the Block, so a routine would presumably also need to ask you to select that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are the "extreme" possibiliities here?&amp;nbsp; Are your examples so far "typical" in the sense that the white Polyline will always be three segments falling toward the ends, and the rectangle will always be underneath in a similar original position?&amp;nbsp; Or could there be significantly different starting conditions?&amp;nbsp; More Polyline segments?&amp;nbsp; Block above?&amp;nbsp; The whole thing rotated in some very different orientation?&amp;nbsp; Significantly different Block shape?&amp;nbsp; Etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that coming up with a foolproof way to account for all possibilities would be a lot more effort than just doing it manually, but I wouldn't claim it can't be done.&amp;nbsp; And it may be worth the effort, if you have a large enough quantity of them to process.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2017 16:13:06 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2017-11-27T16:13:06Z</dc:date>
    <item>
      <title>Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7571917#M111703</link>
      <description>&lt;P&gt;HI all, Please Help me write LISP&lt;/P&gt;&lt;P&gt;I want to move the Block &lt;SPAN&gt;&lt;SPAN&gt;Go to the middle of the polyline.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="g-section"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="g-unit"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="trans-verified-button-large"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Make the corner of the block.&lt;/SPAN&gt; &lt;SPAN&gt;Stick with&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Picture below&lt;/SPAN&gt;&lt;/SPAN&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="Untitled 1.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/430701iAA7B4CA854294F38/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled 1.png" alt="Untitled 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 10:14:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7571917#M111703</guid>
      <dc:creator>chan230984</dc:creator>
      <dc:date>2017-11-25T10:14:55Z</dc:date>
    </item>
    <item>
      <title>Betreff: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7571998#M111704</link>
      <description>&lt;P&gt;Delete&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 11:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7571998#M111704</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2017-11-25T11:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7572041#M111705</link>
      <description>&lt;P&gt;I want to click block and polyline to move block near polyline&lt;/P&gt;&lt;P&gt;Sorry I'm not good English&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 12:24:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7572041#M111705</guid>
      <dc:creator>chan230984</dc:creator>
      <dc:date>2017-11-25T12:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7572501#M111706</link>
      <description>&lt;P&gt;please, upload your sample dwg&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 21:19:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7572501#M111706</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2017-11-25T21:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7572649#M111707</link>
      <description>&lt;P&gt;Does your block actually have lines or a polyline around its boundary, or would that be derived by a boundingbox around one inserted at a 0° angle?&amp;nbsp; I do see a method for calculating the intersection points.&amp;nbsp; Of course it would probably be written assuming that the polyline always looked something like the one in your image.&amp;nbsp; Is the block allowed to be rotated a little?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2017 00:10:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7572649#M111707</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-26T00:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7573897#M111708</link>
      <description>&lt;P&gt;This is an Example&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because i have a lot to do it&lt;/P&gt;&lt;DIV class="g-section"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="g-unit"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="trans-verified-button-large"&gt;&lt;SPAN&gt;&lt;SPAN&gt;I want a quick way to do it.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-large"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&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="Untitled 1.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/431083i4F570CCF25CE24FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled 1.png" alt="Untitled 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 05:04:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7573897#M111708</guid>
      <dc:creator>chan230984</dc:creator>
      <dc:date>2017-11-27T05:04:07Z</dc:date>
    </item>
    <item>
      <title>Betreff: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7575468#M111709</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;chan230984 schrieb:&lt;BR /&gt;
&lt;P&gt;HI all, Please Help me write LISP&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sure,&lt;/P&gt;
&lt;P&gt;please write about your current problem for this Task, which way do you want to go&lt;/P&gt;
&lt;P&gt;and show your your previous result(code)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;One way should be:&lt;BR /&gt;Congruence calculate with c=Length of "Block" and angle of alpha+beta, or alpha+gamma or beta+gamma&lt;BR /&gt;&lt;BR /&gt;Congruence (geometry)&lt;BR /&gt;You can use the ASA or AAS (S= the side of your rectang/Block)&lt;BR /&gt;&lt;A href="https://www.khanacademy.org/math/geometry/hs-geo-congruence/hs-geo-triangle-congruence/a/triangle-congruence-review" target="_blank"&gt;https://www.khanacademy.org/math/geometry/hs-geo-congruence/hs-geo-triangle-congruence/a/triangle-congruence-review&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://en.wikipedia.org/wiki/Congruence_%28geometry%29#Determining_congruence" target="_blank"&gt;https://en.wikipedia.org/wiki/Congruence_%28geometry%29#Determining_congruence&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 15:35:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7575468#M111709</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2017-11-27T15:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7575614#M111710</link>
      <description>&lt;P&gt;There's a relatively quick way to do it manually:&amp;nbsp; Move the Block and Text so that its [in this case] upper left corner lies anywhere along the left leg of the Polyline [in the image, I have already Moved&amp;nbsp;them [the dashed blue is the original position] to put the Block's insertion point at the far left end, but you could put that location at the MIDpoint, or with a NEArest Osnap anywhere].&amp;nbsp; Draw a temporary Line along that left leg, and Move that [maintaining its angle] so that it passes through the [in this case] upper-right corner of the Block [the green Line here, already so Moved].&amp;nbsp; Finally, Move the Block and Text between the obvious INTersection points, and Erase the temporary Line.&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="BlockPosition.PNG" style="width: 460px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/431337iA7F7930C107EFE4B/image-size/large?v=v2&amp;amp;px=999" role="button" title="BlockPosition.PNG" alt="BlockPosition.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To automate that could be very tricky.&amp;nbsp; The Block in that skewed orientation is &lt;EM&gt;at 0 rotation&lt;/EM&gt;, which makes it a lot harder to extract where that upper right corner is from its information, than it would be if the Block at 0 rotation were orthogonally oriented.&amp;nbsp; The starting vertex of the Polyline in the Block is not at the Block's insertion point, and I can't imagine you could always count on that Polyline being drawn always from the same corner and always in the same direction, nor that the white Polyline would always be drawn in the same direction.&amp;nbsp; And the Text is a separate object from the Block, so a routine would presumably also need to ask you to select that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are the "extreme" possibiliities here?&amp;nbsp; Are your examples so far "typical" in the sense that the white Polyline will always be three segments falling toward the ends, and the rectangle will always be underneath in a similar original position?&amp;nbsp; Or could there be significantly different starting conditions?&amp;nbsp; More Polyline segments?&amp;nbsp; Block above?&amp;nbsp; The whole thing rotated in some very different orientation?&amp;nbsp; Significantly different Block shape?&amp;nbsp; Etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that coming up with a foolproof way to account for all possibilities would be a lot more effort than just doing it manually, but I wouldn't claim it can't be done.&amp;nbsp; And it may be worth the effort, if you have a large enough quantity of them to process.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 16:13:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7575614#M111710</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-27T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7576464#M111711</link>
      <description>&lt;P&gt;Try attached code. Minimal testing&amp;nbsp;and no error trap.&lt;/P&gt;
&lt;PRE&gt;(defun c:somefunc  (/ ang ang1 dist ent1 ent2 ent3 entlst entlst2 entlst3 entmat entnew etdata found lst lst2 pt vlaobj vlaobj2)
 (and (setq ent1 (car (entsel "\nSelect polyline: "))
            ang1 (cdar
                  (vl-sort (mapcar '(lambda (x y) (cons (abs (sin (setq ang (angle x y)))) ang))
                                   (setq lst (cdr (reverse (vl-remove-if-not 'listp (mapcar 'cdr (entget ent1))))))
                                   (cdr lst))
                           '(lambda (x y) (&amp;lt; (car x) (car y)))))
            ent2 (car (setq entlst (nentsel "\nSelect rectangle in block: ")))
            ent3 (car (last entlst))
            lst  (vl-sort (cdr (reverse (vl-remove-if-not 'listp (mapcar 'cdr (entget ent1)))))
                          '(lambda (x y) (&amp;gt; (cadr x) (cadr y))))
            lst  (cons (car lst) (list (cadr lst)))
            lst2 (apply 'append
                        (mapcar '(lambda (x)
                                  (if (or (= 10 (car x)) (= 11 (car x)))
                                   (list
                                    (append (list (+ (* (car (nth 0 (setq entmat (caddr entlst)))) (cadr x))
                                                     (* (car (nth 1 entmat)) (caddr x))
                                                     (car (nth 3 entmat))))
                                            (list
                                             (+ (* (cadr (nth 0 entmat)) (cadr x)) (* (cadr (nth 1 entmat)) (caddr x)) (cadr (nth 3 entmat))))))))
                                (if (= "POLYLINE" (cdr (assoc 0 (entget (setq entlst2 (cdr (assoc 330 (entget ent2))))))))
                                 (progn (setq entnew entlst2)
                                        (while (/= "SEQEND" (cdr (assoc 0 (entget entnew))))
                                         (setq entnew (entnext entnew))
                                         (setq entlst3 (cons (reverse (cdr (reverse (assoc 10 (entget entnew))))) entlst3))))
                                 (entget ent2))))
            lst2 (vl-sort (mapcar '(lambda (x y) (cons (abs (- ang1 (abs (sin (angle x y))))) (list x y)))
                                  (setq lst2 (append lst2 (list (car lst2))))
                                  (cdr lst2))
                          '(lambda (x y) (&amp;gt; (car x) (car y))))
            lst2 (list (cdar lst2) (cdadr lst2))
            lst2 (car (vl-sort (mapcar '(lambda (x) (vl-sort x '(lambda (x y) (&amp;gt; (cadr x) (cadr y))))) lst2)
                               '(lambda (x y) (&amp;gt; (cadar x) (cadar y))))))
      (while (not found)
       (vla-move (setq vlaobj2 (vlax-ename-&amp;gt;vla-object ent3))
                 (vlax-3d-point (car lst2))
                 (vlax-3d-point (car lst)))
       (setq dist (distance (car lst2) (car lst))
             ang  (angle (car lst2) (car lst)))
       (setq lst2 (mapcar '(lambda (x) (polar x ang dist)) lst2))
       (vla-move (vla-copy (setq vlaobj (vlax-ename-&amp;gt;vla-object ent1)))
                 (vlax-3d-point (car lst))
                 (vlax-3d-point (cadr lst2)))
       (if (setq pt (vlax-invoke vlaobj 'intersectwith (vlax-ename-&amp;gt;vla-object (entlast)) 0))
        (setq found t))
       (entdel (entlast))
       (setq lst (cdr lst)))
      pt
      (vla-move vlaobj2 (vlax-3d-point (cadr lst2)) (vlax-3d-point pt)))
 (princ))&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="culvert_embankment.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/431448i53575BCA8F13279A/image-size/large?v=v2&amp;amp;px=999" role="button" title="culvert_embankment.gif" alt="culvert_embankment.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 20:56:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7576464#M111711</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-11-27T20:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp move Block HELP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7577101#M111712</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555"&gt;@Ranjit_Singh&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 02:46:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-move-block-help/m-p/7577101#M111712</guid>
      <dc:creator>chan230984</dc:creator>
      <dc:date>2017-11-28T02:46:21Z</dc:date>
    </item>
  </channel>
</rss>

