<?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: Problem with the script of a simple object (IF... THEN) in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267497#M6308</link>
    <description>Hi.&lt;BR /&gt;
Several things you need to change:&lt;BR /&gt;
&lt;BR /&gt;
1. Delete the "desk" parameter&lt;BR /&gt;
2. After the first set of hotspots, define two variables
&lt;PRE&gt;desk=0
w=0&lt;/PRE&gt;
3. In widths and flags calculations, change all "A"s after "THEN"s to "w". Example:
&lt;PRE&gt;IF A&amp;lt;1.0 THEN
w=1.0:desk=11
ENDIF
&lt;/PRE&gt;
4. Use "w" instead of "A" in RECT2 for the main desk shape.&lt;BR /&gt;
5. In your "ADD2" when drawing chairs, change "A/2" to "w/2"&lt;BR /&gt;
6. Since you have two ADD2 transformations in each IF statement, each DEL should be "DEL 2". This is why the sideboard flies away.&lt;BR /&gt;
7. Sideboard's RECT2 should also use "w" instead of "A"&lt;BR /&gt;
8. Add "DEL 1" after the sideboard's RECT2 statment.&lt;BR /&gt;
9. Consider creating a couple of line type parameters and use those in your LINE_TYPE statements, instead of declaring the line type name.&lt;BR /&gt;
&lt;BR /&gt;
Hope that helps.&lt;BR /&gt;
Best regards.</description>
    <pubDate>Fri, 10 Mar 2017 23:26:56 GMT</pubDate>
    <dc:creator>sinceV6</dc:creator>
    <dc:date>2017-03-10T23:26:56Z</dc:date>
    <item>
      <title>Problem with the script of a simple object (IF... THEN)</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267496#M6307</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hello everyone! &lt;BR /&gt;
&lt;BR /&gt;
I have a problem with the simple GDL script I wrote. I made these two objects (Table18 and Desk12) based on the same statement (IF... THEN... ENDIF) I found in the book 'Object Making with ArchiCAD- GDL for Beginners' by David Nicholson-Cole.&lt;BR /&gt;
I attach them both to my post. The Table18.gsm works perfectly fine, the amount of chairs around it is in relation to the width. Desk12.gsm on the other hand doesn't work (even though they're so similar), it stretches only to a point. Also, when the 'Sideboard' parameter is on with the 'desk=11' desk type, the rectangle representing the sideboard flies off awkwardly. If one of you more experienced GDL friends had time to take a look at my makings, that would be more than awesome. &lt;BR /&gt;
&lt;BR /&gt;
Thank you!&lt;BR /&gt;
&lt;BR /&gt;
PS I work in ArchiCAD 19, full German version. &lt;BR /&gt;
iOS X El Capitan 10.11.3 &lt;BR /&gt;
iMac (Retina 5K, 27 Zoll, Ende 2015) &lt;BR /&gt;
4 GHz Intel Core i7 &lt;BR /&gt;
16 GB 1867 MHz DDR3 &lt;BR /&gt;
AMD Radeon R9 M395X 4096 MB&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Mar 2017 12:57:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267496#M6307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-10T12:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the script of a simple object (IF... THEN)</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267497#M6308</link>
      <description>Hi.&lt;BR /&gt;
Several things you need to change:&lt;BR /&gt;
&lt;BR /&gt;
1. Delete the "desk" parameter&lt;BR /&gt;
2. After the first set of hotspots, define two variables
&lt;PRE&gt;desk=0
w=0&lt;/PRE&gt;
3. In widths and flags calculations, change all "A"s after "THEN"s to "w". Example:
&lt;PRE&gt;IF A&amp;lt;1.0 THEN
w=1.0:desk=11
ENDIF
&lt;/PRE&gt;
4. Use "w" instead of "A" in RECT2 for the main desk shape.&lt;BR /&gt;
5. In your "ADD2" when drawing chairs, change "A/2" to "w/2"&lt;BR /&gt;
6. Since you have two ADD2 transformations in each IF statement, each DEL should be "DEL 2". This is why the sideboard flies away.&lt;BR /&gt;
7. Sideboard's RECT2 should also use "w" instead of "A"&lt;BR /&gt;
8. Add "DEL 1" after the sideboard's RECT2 statment.&lt;BR /&gt;
9. Consider creating a couple of line type parameters and use those in your LINE_TYPE statements, instead of declaring the line type name.&lt;BR /&gt;
&lt;BR /&gt;
Hope that helps.&lt;BR /&gt;
Best regards.</description>
      <pubDate>Fri, 10 Mar 2017 23:26:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267497#M6308</guid>
      <dc:creator>sinceV6</dc:creator>
      <dc:date>2017-03-10T23:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with the script of a simple object (IF... THEN)</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267498#M6309</link>
      <description>Thank you so much for all the suggestions, it worked! I'll take your advice and change the way I set the line types.&lt;BR /&gt;
&lt;BR /&gt;
Alles gute!</description>
      <pubDate>Mon, 13 Mar 2017 15:45:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Problem-with-the-script-of-a-simple-object-IF-THEN/m-p/267498#M6309</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-13T15:45:32Z</dc:date>
    </item>
  </channel>
</rss>

