<?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 LISP routine to automatically place &amp;quot;number&amp;quot;-blocks on convey in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309801#M78627</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I don't have a time to write some code but I'll share my view on this task. I think this is solvable without writting a code. I've opened your sample drawing and as I see you've got conveyors blocks that you join to numbering.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know, maybe I'm wrong, but I would joint those two blocks into a single dynamic block with rules about how to orient numbering in regards to conveyour orijentation (outside, at midpoint ....).&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That was my initial idea, to have the numbering block as a part of the conveyor block - but when i need to mirror a group of conveyors, the text would also be mirrored. Also, the blocks need to be as simple as possible, and rotating them with a rotate parameter instead of using the rotate tool or the rotation in the Properties menu would definately confuse my coworkers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2020 11:57:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-11T11:57:35Z</dc:date>
    <item>
      <title>Need LISP routine to automatically place "number"-blocks on conveyors</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309695#M78625</link>
      <description>&lt;P&gt;Hi all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no coding experience or previous experience with LISP, so I sincerely ask for your help. I make a lot of layouts with conveyors - sometimes with several thousands of conveyors. When my layouts are done, I usually need several hours of placing a simple "numbering" block in the end-points of every conveyor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each conveyor consists of a basepoint, a length parameter and a regular "point" in the end.&lt;/P&gt;&lt;P&gt;The numbering block, consists of a basepoint and a strech-point to move the text back and forth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a LISP routine that automatically takes the basepoint of the numbering block, and places it on top of the "point" in each conveyor in the layout, so that the only thing I have to do by myself, is move the text on the numbering block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached an example DWG that explains what I need, and what it is supposed to look like when the LISP has done its job - I really hope that you can help me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anything is unclear, please just ask &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 11:04:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309695#M78625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-11T11:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309788#M78626</link>
      <description>&lt;P&gt;I don't have a time to write some code but I'll share my view on this task. I think this is solvable without writting a code. I've opened your sample drawing and as I see you've got conveyors blocks that you join to numbering.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know, maybe I'm wrong, but I would joint those two blocks into a single dynamic block with rules about how to orient numbering in regards to conveyour orijentation (outside, at midpoint ....).&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 11:48:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309788#M78626</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2020-02-11T11:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309801#M78627</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I don't have a time to write some code but I'll share my view on this task. I think this is solvable without writting a code. I've opened your sample drawing and as I see you've got conveyors blocks that you join to numbering.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know, maybe I'm wrong, but I would joint those two blocks into a single dynamic block with rules about how to orient numbering in regards to conveyour orijentation (outside, at midpoint ....).&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That was my initial idea, to have the numbering block as a part of the conveyor block - but when i need to mirror a group of conveyors, the text would also be mirrored. Also, the blocks need to be as simple as possible, and rotating them with a rotate parameter instead of using the rotate tool or the rotation in the Properties menu would definately confuse my coworkers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 11:57:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9309801#M78627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-11T11:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9310924#M78628</link>
      <description>&lt;P&gt;Speaking of rotation, there's one odd block in that drawing at position X 10000, the rotation is 90 deg, while similar block definition with thb w&amp;nbsp; same rotation is at either 0 or 180, cant wrap my ahead around it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are the conveyors rotation is either 0 or 90 and never at an odd angle?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 18:15:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9310924#M78628</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-02-11T18:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9311061#M78629</link>
      <description>&lt;P&gt;Q&amp;amp;D : You can build off this code..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:NOC (/  valid_blocks f ss i e data dpp len)
;;	pBe 2019	;;
  
(setq valid_blocks '("CONV-400x200" "CONV-600x400"));; Add more block names here with
(setq f (lambda (p) (vlax-get e p)))

(if 
      (setq ss (ssget '((0 . "INSERT")(2 . "`*U*,CONV-*"))))
      
  	(repeat (setq i (sslength ss))
          (setq e (vlax-ename-&amp;gt;vla-object (ssname ss (Setq i (1- i)))))
          (setq data (mapcar 'f  '("Insertionpoint" "Rotation" "EffectiveName" "XScaleFactor")))

          (if (and
                (member (caddr data) valid_blocks)
                (setq dpp (mapcar '(lambda (e) (mapcar 'f
                                      '("PropertyName" "Value" )))
                                    (vlax-invoke e 'GetDynamicBlockProperties)))
                (&amp;gt; (setq len (cadr (Assoc "Length" dpp))) 0)
                )
		(vlax-invoke
		  (vlax-get (vla-get-ActiveLayout
		              (vla-get-activedocument
		                (vlax-get-acad-object)
		              )
		            )
		            'Block
		  )
		  'InsertBlock
		  (polar (car data)
                         (+ (if (minusp (last data)) pi 0.0) (Cadr data))
                         len)
		  "UnitNumber"	;; make sure this block exists in the drawing
		  1 1 1 0) ;; &amp;lt;-- block rotation at 0, Zero, cero, Null, bokya, nialas ....
		)
            )
          )
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 19:06:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9311061#M78629</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-02-11T19:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312112#M78630</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Q&amp;amp;D : You can build off this code..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&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;Code did EXACTLY what it was supposed to do - thank you so much!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Kudos!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the "weird" block you mentioned, if you orbit the drawing, you'll see that the block was 3d rotated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 07:21:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312112#M78630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-12T07:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312151#M78631</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;Code did EXACTLY what it was supposed to do - thank you so much!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Kudos!&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Regarding the "weird" block you mentioned,&lt;FONT color="#0000FF"&gt; if you orbit the drawing,&lt;/FONT&gt; you'll see that the block was 3d rotated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to be of help KayChrisKAy.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;I see, now why didn't I think of&amp;nbsp; that &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Cheers&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 07:46:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312151#M78631</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-02-12T07:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312477#M78632</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;Code did EXACTLY what it was supposed to do - thank you so much!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Kudos!&lt;/BLOCKQUOTE&gt;&lt;P&gt;Regarding the "weird" block you mentioned,&lt;FONT color="#0000ff"&gt; if you orbit the drawing,&lt;/FONT&gt; you'll see that the block was 3d rotated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Glad to be of help KayChrisKAy.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;I see, now why didn't I think of&amp;nbsp; that &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Cheers&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Additional question - I apologize... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Is it somehow possible to, instead of defining all 50 blocks that I got, that start with "CONV-", to just setq valid_blocks to &lt;U&gt;all&lt;/U&gt; blocks that has a name starting with "CONV-"?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 10:40:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312477#M78632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-12T10:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312532#M78633</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;estion - I apologize... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Is it somehow possible to, instead of defining all 50 blocks that I got, that start with "CONV-", to just setq valid_blocks to &lt;U&gt;all&lt;/U&gt; blocks that has a name starting with "CONV-"?&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace&lt;/P&gt;
&lt;PRE&gt;(member (caddr data) valid_blocks)&lt;/PRE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;PRE&gt;(vl-string-search "CONV-" (caddr data))&lt;/PRE&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 11:02:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312532#M78633</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-02-12T11:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312633#M78634</link>
      <description>&lt;P&gt;I feel stupid for asking a 3rd time, I'm very sorry!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The lisp works great, but how do I add blocks to the routine that doesn't start with "CONV-"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:NOC (/  valid_blocks f ss i e data dpp len)
;;	pBe 2019	;;
  
(setq valid_blocks '("CONV-400x200" "CONV-600x400" &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;"TRANSF-400x200" "OVERH-400x200"&lt;/STRONG&gt;&lt;/FONT&gt;));; Add more block names here with
(setq f (lambda (p) (vlax-get e p)))

(if 
      (setq ss (ssget '((0 . "INSERT")(2 . "`*U*,CONV-*")))) &lt;FONT color="#ff0000"&gt;;;I assume I have to add something here&lt;/FONT&gt;
      
  	(repeat (setq i (sslength ss))
          (setq e (vlax-ename-&amp;gt;vla-object (ssname ss (Setq i (1- i)))))
          (setq data (mapcar 'f  '("Insertionpoint" "Rotation" "EffectiveName" "XScaleFactor")))

          (if (and
                ;;(member (caddr data) valid_blocks)
		(vl-string-search "CONV-" (caddr data)) &lt;FONT color="#ff0000"&gt;;;And also something here?&lt;/FONT&gt;
                (setq dpp (mapcar '(lambda (e) (mapcar 'f
                                      '("PropertyName" "Value" )))
                                    (vlax-invoke e 'GetDynamicBlockProperties)))
                (&amp;gt; (setq len (cadr (Assoc "Length" dpp))) 0)
                )
		(vlax-invoke
		  (vlax-get (vla-get-ActiveLayout
		              (vla-get-activedocument
		                (vlax-get-acad-object)
		              )
		            )
		            'Block
		  )
		  'InsertBlock
		  (polar (car data)
                         (+ (if (minusp (last data)) pi 0.0) (Cadr data))
                         len)
		  "POSITION2"	;; make sure this block exists in the drawing
		  1 1 1 0) ;; &amp;lt;-- block rotation at 0, Zero, cero, Null, bokya, nialas ....
		)
            )
          )
  (princ)
  )&lt;/PRE&gt;&lt;P&gt;This is the absolute last I need &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help - I hope it's not too much trouble&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 12:03:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312633#M78634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-12T12:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312695#M78635</link>
      <description>&lt;P&gt;ITs not too much trouble, we will target blocks with this pattern "###x###" at the end of the block name similar to any of these&amp;nbsp;"CONV-&lt;FONT color="#000080"&gt;600x400&lt;/FONT&gt;" "TRANSF-&lt;FONT color="#800080"&gt;400x200&lt;/FONT&gt;" "OVERH-&lt;FONT color="#FF0000"&gt;600x200&lt;/FONT&gt;", also it should have the &lt;FONT color="#0000FF"&gt;"LENGTH"&lt;/FONT&gt; property name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would also help if you you can define which blocks to insert in place of&amp;nbsp;"UnitNumber" or&amp;nbsp;"POSITION2" etc.. that way you dont need to change the block name to insert everytime you need to run the program. Perhaps we can just define one for each block like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(Defun c:iBlock1 nil (NOC "UnitNumber"))
(Defun c:iBlock2 nil (NOC "POSITION2"))
&lt;/PRE&gt;
&lt;P&gt;you can add as many as you&amp;nbsp; like&lt;/P&gt;
&lt;P&gt;Then we modify the main routine to accept any valid block name as an argument&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun NOC ( bname /  valid_blocks f ss i e data dpp len)
;;	pBe 2019	;;
  (setq f (lambda (p) (vlax-get e p)))

(if 
      (setq ss (ssget '((0 . "INSERT")(2 . "`*U*,&lt;FONT color="#0000FF"&gt;*###x###*&lt;/FONT&gt;"))))       
  	(repeat (setq i (sslength ss))
          (setq e (vlax-ename-&amp;gt;vla-object (ssname ss (Setq i (1- i)))))
          (setq data (mapcar 'f  '("Insertionpoint" "Rotation" "EffectiveName" "XScaleFactor")))

          (if (and
                (wcmatch (strcase (caddr data)) "&lt;FONT color="#0000FF"&gt;*###X###*&lt;/FONT&gt;")
                (setq dpp (mapcar '(lambda (e) (mapcar 'f
                                      '("PropertyName" "Value" )))
                                    (vlax-invoke e 'GetDynamicBlockProperties)))
                (&amp;gt; (setq len (cadr (Assoc "Length" dpp))) 0)
                )
		(vlax-invoke
		  (vlax-get (vla-get-ActiveLayout
		              (vla-get-activedocument
		                (vlax-get-acad-object)
		              )
		            )
		            'Block
		  )
		  'InsertBlock
		  (polar (car data)
                         (+ (if (minusp (last data)) pi 0.0) (Cadr data))
                         len)
		       &lt;FONT color="#0000FF"&gt;  bname	&lt;/FONT&gt;	
		  1 1 1 0) 
		)
            )
          )
  (princ)
  )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 12:39:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9312695#M78635</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-02-12T12:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need LISP routine to automatically place "number"-blocks on convey</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9318171#M78636</link>
      <description>&lt;P&gt;Never mind the "Position2", the block to be inserted is only called "UnitNumber".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another issue now - I want the LISP to also add the block to three different blocks that is not being defined by the "###x###", but still have the Length parameter. They are also conveyors, but their names are simply "AUFK-xxx", "BIxxA-KN2" and "REV-xxxx"&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 10:21:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-lisp-routine-to-automatically-place-quot-number-quot-blocks/m-p/9318171#M78636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-14T10:21:26Z</dc:date>
    </item>
  </channel>
</rss>

