<?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 Repeat 2d Object in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Repeat-2d-Object/m-p/128630#M16146</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I have attached a screenshot of a 2d symbol which, when I draw it beyond its length, I would like it to repeat (like the 2d insulation object in archicad.)&lt;BR /&gt;
&lt;BR /&gt;
As you can probably guess, the 2d script so far is a cleaned up automated script straight out of archicad. Would anyone be able to give me some guidance on how to go about scripting the object to loop? &lt;BR /&gt;
&lt;BR /&gt;
My understanding is that I would FOR... NEXT loop and get the object to repeat if I set it out longer than its length but, after studying other objects and looking around online, I still don't really know where to start!&lt;BR /&gt;
&lt;BR /&gt;
Ive posted the basic code below:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
mul2     A/0.107482, B/0.019122&lt;BR /&gt;
add2     -59.16268087103, 96.73000278751&lt;BR /&gt;
pen          6&lt;BR /&gt;
set fill "Solid Fil1"&lt;BR /&gt;
poly2_b{5}       5,      3,      0,      3,    120,      0, &lt;BR /&gt;
                   0,            0,            1,            0,            0,            1,            0, &lt;BR /&gt;
        59.16268087103, -96.71088119978,      1, &lt;BR /&gt;
        59.2155617965, -96.71088119978,      1, &lt;BR /&gt;
        59.2155617965, -96.73000278751,      1, &lt;BR /&gt;
        59.16268087103, -96.73000278751,      1, &lt;BR /&gt;
        59.16268087103, -96.71088119978,      1&lt;BR /&gt;
set fill "Solid Fil1"&lt;BR /&gt;
poly2_b{5}       5,      3,      0,      3,     81,      0, &lt;BR /&gt;
                   0,            0,            1,            0,            0,            1,            0, &lt;BR /&gt;
        59.2155617965, -96.71088119978,      1, &lt;BR /&gt;
        59.27016330366, -96.71088119978,      1, &lt;BR /&gt;
        59.27016330366, -96.73000278751,      1, &lt;BR /&gt;
        59.2155617965, -96.73000278751,      1, &lt;BR /&gt;
        59.2155617965, -96.71088119978,      1&lt;BR /&gt;
set fill "Solid Fil1"&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Richard&lt;/T&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/16734i2D19A6B7BA983F43/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Screen Shot 2012-03-12 at 16.41.07.png" title="Screen Shot 2012-03-12 at 16.41.07.png" /&gt;</description>
    <pubDate>Mon, 12 Mar 2012 16:47:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-03-12T16:47:30Z</dc:date>
    <item>
      <title>Repeat 2d Object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Repeat-2d-Object/m-p/128630#M16146</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I have attached a screenshot of a 2d symbol which, when I draw it beyond its length, I would like it to repeat (like the 2d insulation object in archicad.)&lt;BR /&gt;
&lt;BR /&gt;
As you can probably guess, the 2d script so far is a cleaned up automated script straight out of archicad. Would anyone be able to give me some guidance on how to go about scripting the object to loop? &lt;BR /&gt;
&lt;BR /&gt;
My understanding is that I would FOR... NEXT loop and get the object to repeat if I set it out longer than its length but, after studying other objects and looking around online, I still don't really know where to start!&lt;BR /&gt;
&lt;BR /&gt;
Ive posted the basic code below:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
mul2     A/0.107482, B/0.019122&lt;BR /&gt;
add2     -59.16268087103, 96.73000278751&lt;BR /&gt;
pen          6&lt;BR /&gt;
set fill "Solid Fil1"&lt;BR /&gt;
poly2_b{5}       5,      3,      0,      3,    120,      0, &lt;BR /&gt;
                   0,            0,            1,            0,            0,            1,            0, &lt;BR /&gt;
        59.16268087103, -96.71088119978,      1, &lt;BR /&gt;
        59.2155617965, -96.71088119978,      1, &lt;BR /&gt;
        59.2155617965, -96.73000278751,      1, &lt;BR /&gt;
        59.16268087103, -96.73000278751,      1, &lt;BR /&gt;
        59.16268087103, -96.71088119978,      1&lt;BR /&gt;
set fill "Solid Fil1"&lt;BR /&gt;
poly2_b{5}       5,      3,      0,      3,     81,      0, &lt;BR /&gt;
                   0,            0,            1,            0,            0,            1,            0, &lt;BR /&gt;
        59.2155617965, -96.71088119978,      1, &lt;BR /&gt;
        59.27016330366, -96.71088119978,      1, &lt;BR /&gt;
        59.27016330366, -96.73000278751,      1, &lt;BR /&gt;
        59.2155617965, -96.73000278751,      1, &lt;BR /&gt;
        59.2155617965, -96.71088119978,      1&lt;BR /&gt;
set fill "Solid Fil1"&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Richard&lt;/T&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/16734i2D19A6B7BA983F43/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Screen Shot 2012-03-12 at 16.41.07.png" title="Screen Shot 2012-03-12 at 16.41.07.png" /&gt;</description>
      <pubDate>Mon, 12 Mar 2012 16:47:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Repeat-2d-Object/m-p/128630#M16146</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-12T16:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Repeat 2d Object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Repeat-2d-Object/m-p/128631#M16147</link>
      <description>Hello, &lt;BR /&gt;
 &lt;BR /&gt;
Here is one piece of code that should work. You can put it  &lt;BR /&gt;
all in the master script - alternatively could be splitted between  &lt;BR /&gt;
value and 2D scripts. &lt;BR /&gt;
 &lt;BR /&gt;
Hope this makes sense, example object attached. &lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt; 
!--needed new parameters are present in the example object

!--master or value script 
values "grid" 1, range[0.1, ] 
values "a" grid, range[grid, ] step grid, grid 
values "b" 0.1 
!-- 
 
 
!--master or 2D script 
eps= 0.0001 
 
pen L_ 
 
parts= int((a+eps)/grid) 
for xx=1 to parts 
	if fra(xx/2) then	!--odd round 
		fillpen= pen_1 
		fill fill_1 
	else				!--even round 
		fillpen= pen_2 
		fill fill_2 
	endif 
	 
	poly2_a 4, 1+2+4, fillpen, 
		0,	0,	1, 
		grid,	0,	1, 
		grid,	b,	1, 
		0,		b,	1 
 
	add2 grid, 0 
next xx 
del xx 
!-- 
&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
Regards, Juha</description>
      <pubDate>Tue, 13 Mar 2012 21:38:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Repeat-2d-Object/m-p/128631#M16147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-13T21:38:44Z</dc:date>
    </item>
  </channel>
</rss>

