<?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 placing certain amount of blocks by predetermined value in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204385#M133972</link>
    <description>&lt;P&gt;I would suggest to use ARRAY instead of any lisp routine.&lt;/P&gt;
&lt;P&gt;Nowadays ARRAY is so smart that you can control the distance between each item and also change number of rows / columns by simply drag the grip point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2016 12:41:43 GMT</pubDate>
    <dc:creator>3wood</dc:creator>
    <dc:date>2016-03-08T12:41:43Z</dc:date>
    <item>
      <title>Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204321#M133971</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm working on a small lisp routine that places an certain amount of blocks (wtk) at a set distance between eachother.&lt;/P&gt;&lt;P&gt;I had in the past did this before but it;s sooo long ago that i forgot how to haha.&lt;/P&gt;&lt;P&gt;So if any of you could point me in the right direction that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i was thinking was to add a loop with an increment at the end to end up with the amount as the predetermined "wtk" amount.&lt;/P&gt;&lt;P&gt;then also with each increment amount add 100 to the distance "DisT" so the next block will be placed 100 apart.&lt;/P&gt;&lt;P&gt;But i forgot where to add the increment and how to add 100 to the distance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  		(setq wtk (GetCell "B2"))
		(setq DisT 0.0)&lt;BR /&gt;                (setq wtkD 0)
 		(while wtkD &amp;lt; wtk
			
 				(command "insert" "Silo Schoonwater" DisT 1 1 0 )
		  		(setq DisT +(100.0)&lt;BR /&gt;                                (setq wtkD + 1)

		  	
  
		);end while&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Mar 2016 11:50:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204321#M133971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-08T11:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204385#M133972</link>
      <description>&lt;P&gt;I would suggest to use ARRAY instead of any lisp routine.&lt;/P&gt;
&lt;P&gt;Nowadays ARRAY is so smart that you can control the distance between each item and also change number of rows / columns by simply drag the grip point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2016 12:41:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204385#M133972</guid>
      <dc:creator>3wood</dc:creator>
      <dc:date>2016-03-08T12:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204458#M133973</link>
      <description>3 wood. Yeah that would work if it's only that. But this is part of an bigger routine that does more then just that. So I can't really use array.</description>
      <pubDate>Tue, 08 Mar 2016 13:18:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204458#M133973</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-08T13:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204515#M133974</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i was thinking was to add a loop with an increment at the end to end up with the amount as the predetermined "wtk" amount.&lt;/P&gt;
&lt;P&gt;then also with each increment amount add 100 to the distance "DisT" so the next block will be placed 100 apart. ....&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Function names first, arguments follow.&amp;nbsp; And the insertion point needs to be a&lt;EM&gt; point&lt;/EM&gt; [one way of getting that is shown],&amp;nbsp;not a raw &lt;EM&gt;distance&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this [untested]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq wtk (GetCell "B2"))&lt;BR /&gt;(setq DisT 0.0)&lt;BR /&gt;(setq wtkD 0)&lt;BR /&gt; (while &lt;FONT color="#ff0000"&gt;(&lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; wtkD&amp;nbsp;wtk)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (command "insert" "Silo Schoonwater" &lt;FONT color="#ff0000"&gt;(vlax-curve-getPointAtDist &lt;FONT color="#00ccff"&gt;&lt;EM&gt;yourpathentityname&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt; DisT&lt;FONT color="#ff0000"&gt;)&lt;/FONT&gt; 1 1 0 )&lt;BR /&gt;&amp;nbsp; (setq DisT&lt;FONT color="#ff0000"&gt; (+ DisT&amp;nbsp;100.0)&lt;/FONT&gt;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (setq wtkD &lt;FONT color="#ff0000"&gt;(1+ wtkD)&lt;/FONT&gt;)&lt;BR /&gt;);end while&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need:&lt;BR /&gt;(vl-load-com)&lt;/P&gt;
&lt;P&gt;loaded first, and should either turn Object Snap off [if not already part of the larger routine] or use "_none" Osnap before the insertion point.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2016 13:49:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6204515#M133974</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-03-08T13:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6206412#M133975</link>
      <description>&lt;P&gt;Thanks Kent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been working with the code, but i can't seem to get it to work with the vlax command.&lt;/P&gt;&lt;P&gt;Could you explain what entity path it's looking for, i tried to just enter the block name tried it with blockObj and block-obj.&lt;/P&gt;&lt;P&gt;but i keep getting errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 13:36:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6206412#M133975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-09T13:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6206473#M133976</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've been working with the code, but i can't seem to get it to work with the vlax command.&lt;/P&gt;
&lt;P&gt;Could you explain what entity path it's looking for, i tried to just enter the block name tried it with blockObj and block-obj.&lt;/P&gt;
&lt;P&gt;but i keep getting errors.&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;I was thinking in terms of ["...one way of getting..."] points at distances &lt;EM&gt;along an object&lt;/EM&gt;, such as a Line/Polyline/Arc/Spline/etc. &amp;nbsp;In that kind usage, you would need to have put an object's entity name into a &lt;FONT color="#00CCFF"&gt;variable&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're talking about placing them independent of any existing object, the insertion point still needs to be a &lt;EM&gt;point&lt;/EM&gt;, not just a raw distance. &amp;nbsp;And the changes in distance need to&amp;nbsp;be in some &lt;EM&gt;direction&lt;/EM&gt; from somewhere. &amp;nbsp;One way to do that would be to establish an &lt;FONT color="#FF0000"&gt;initial point&lt;/FONT&gt; to start from, and a &lt;FONT color="#0000FF"&gt;direction&lt;/FONT&gt; to head in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq&lt;/P&gt;
&lt;P&gt;&amp;nbsp; wtk (GetCell "B2")&lt;BR /&gt;&amp;nbsp; DisT 0.0&lt;BR /&gt;&amp;nbsp; wtkD 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;FONT color="#FF0000"&gt;start (getpoint "\nInsertion point for first Block: ")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;FONT color="#0000FF"&gt;dir (getangle "\nDirection to subsequent insertions: ")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;)&lt;BR /&gt;(while &lt;FONT color="#000000"&gt;(&lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt; wtkD&amp;nbsp;wtk)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; (command "insert" "Silo Schoonwater" "_none"&amp;nbsp;&lt;FONT color="#ff0000"&gt;&lt;FONT color="#FF00FF"&gt;(polar&lt;/FONT&gt; start&lt;FONT color="#0000FF"&gt; dir&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&lt;/FONT&gt;DisT&lt;FONT color="#FF00FF"&gt;)&lt;/FONT&gt; 1 1 0 )&lt;BR /&gt;&amp;nbsp; (setq DisT&lt;FONT color="#000000"&gt; (+ DisT&amp;nbsp;100.0))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (setq wtkD (1+ wtkD))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;);end while&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Such a thing could be made to offer an initial default direction [such as 0 degrees], etc.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 14:11:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6206473#M133976</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-03-09T14:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp placing certain amount of blocks by predetermined value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6208343#M133977</link>
      <description>&lt;P&gt;Thanks alot Kent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Figured it out with that. i'll remember this one for sure.&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>Thu, 10 Mar 2016 11:00:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-placing-certain-amount-of-blocks-by-predetermined-value/m-p/6208343#M133977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-10T11:00:39Z</dc:date>
    </item>
  </channel>
</rss>

