<?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 gdl scripting problem in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157974#M21992</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;hi,am a gdl newbie and i am currently working on creating a parametric gdl chair,the one which is instructed inside the gdl guide of archicad 12.Everything went just fine so far, the guide is pretty helpful. My problem is that I 've reached to a point where i am trying to create an "O brace" option for my chair, but i can't seem to move the 3D cursor correctly.&lt;BR /&gt;
Each ADD or ROT command i use to create the last 2 braces ends up moving or rotating the whole chair! What am i going to do!?!?&lt;/T&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/67613i173C28D1900C6E42/image-size/large?v=v2&amp;amp;px=999" border="0" alt="parametric_chair.jpg" title="parametric_chair.jpg" /&gt;</description>
    <pubDate>Tue, 15 Dec 2009 17:59:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-12-15T17:59:22Z</dc:date>
    <item>
      <title>gdl scripting problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157974#M21992</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;hi,am a gdl newbie and i am currently working on creating a parametric gdl chair,the one which is instructed inside the gdl guide of archicad 12.Everything went just fine so far, the guide is pretty helpful. My problem is that I 've reached to a point where i am trying to create an "O brace" option for my chair, but i can't seem to move the 3D cursor correctly.&lt;BR /&gt;
Each ADD or ROT command i use to create the last 2 braces ends up moving or rotating the whole chair! What am i going to do!?!?&lt;/T&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/67613i173C28D1900C6E42/image-size/large?v=v2&amp;amp;px=999" border="0" alt="parametric_chair.jpg" title="parametric_chair.jpg" /&gt;</description>
      <pubDate>Tue, 15 Dec 2009 17:59:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157974#M21992</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-15T17:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: gdl scripting problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157975#M21993</link>
      <description>Nice looking chair! &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Firstly I'd check to see if you have too many (or not enough!) DEL's in the script. Carefully count the transformations and compare to the number of DELs.&lt;BR /&gt;
&lt;BR /&gt;
If you're still having problems, post up part of the script or attach the object (you will need to zip it first) and someone will be able to give you more accurate advice.&lt;BR /&gt;
&lt;BR /&gt;
Hope that helps.</description>
      <pubDate>Tue, 15 Dec 2009 18:45:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157975#M21993</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-15T18:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: gdl scripting problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157976#M21994</link>
      <description>here is the master script&lt;BR /&gt;
&lt;BR /&gt;
!Add to the Master Script&lt;BR /&gt;
!Pop down Menu&lt;BR /&gt;
bv0="No leg braces"&lt;BR /&gt;
bv1="O brace"&lt;BR /&gt;
bv2="H brace"&lt;BR /&gt;
VALUES "bracetype", bv0, bv1, bv2&lt;BR /&gt;
IF bracetype=bv0 THEN&lt;BR /&gt;
brace=0&lt;BR /&gt;
ELSE&lt;BR /&gt;
brace=1&lt;BR /&gt;
ENDIF&lt;BR /&gt;
MATERIAL lmat&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!Braces front to rear&lt;BR /&gt;
IF bracetype=bv2 THEN     !H Brace&lt;BR /&gt;
ADDz lgheight/3&lt;BR /&gt;
ADDx lsec/8&lt;BR /&gt;
ROTx -90&lt;BR /&gt;
CONE 0.5/2,lsec/4,lsec/3,90,90&lt;BR /&gt;
ADDz 0.5/2&lt;BR /&gt;
CONE 0.5/2,lsec/3,lsec/4,90,90&lt;BR /&gt;
DEL 4&lt;BR /&gt;
ADD stlgth,lsec/8,lgheight/3&lt;BR /&gt;
ROTx -90&lt;BR /&gt;
CONE lgheight/2,lsec/4,lsec/3,90,90&lt;BR /&gt;
ADDz lgheight/2&lt;BR /&gt;
CONE lgheight/2,lsec/3,lsec/4,90,90&lt;BR /&gt;
DEL 3&lt;BR /&gt;
ADD 0,0.25,lgheight/3&lt;BR /&gt;
ROTz -90&lt;BR /&gt;
ROTx -90&lt;BR /&gt;
CONE stlgth/2,lsec/4,lsec/3,90,90&lt;BR /&gt;
ADDz stlgth/2&lt;BR /&gt;
CONE stlgth/2,lsec/3,lsec/4,90,90&lt;BR /&gt;
DEL 4&lt;BR /&gt;
ENDIF !brace=bv2&lt;BR /&gt;
&lt;BR /&gt;
IF bracetype=bv1 THEN    !O Brace&lt;BR /&gt;
 ADD 0,0,stheight/3&lt;BR /&gt;
 ROTz -90&lt;BR /&gt;
 ROTx -90&lt;BR /&gt;
 CONE stlgth/2,lsec/4,lsec/3,90,90&lt;BR /&gt;
 ADDz stlgth/2&lt;BR /&gt;
 CONE stlgth/2,lsec/3,lsec/4,90,90&lt;BR /&gt;
 DEL 4&lt;BR /&gt;
 ADD 0,stwidth,stheight/3&lt;BR /&gt;
 ROTz -90&lt;BR /&gt;
 ROTx -90 &lt;BR /&gt;
 CONE stlgth/2,lsec/4,lsec/3,90,90&lt;BR /&gt;
 ADDz stlgth/2&lt;BR /&gt;
 CONE stlgth/2,lsec/3,lsec/4,90,90&lt;BR /&gt;
 DEL 4&lt;BR /&gt;
ENDIF&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
and the 3d script&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PEN 1&lt;BR /&gt;
RESOL 12&lt;BR /&gt;
!All the legs&lt;BR /&gt;
MATERIAL lmat&lt;BR /&gt;
!lsec/3 is the down leg diameter&lt;BR /&gt;
RESOL resol1&lt;BR /&gt;
TOLER toler1&lt;BR /&gt;
CONE lgheight, lsec/3, lsec/2, 90,90&lt;BR /&gt;
ADDx 0.45&lt;BR /&gt;
CONE lgheight, lsec/3, lsec/2, 90,90&lt;BR /&gt;
ADDy 0.55&lt;BR /&gt;
CONE lgheight, lsec/3, lsec/2, 90,90&lt;BR /&gt;
ADDx -0.45&lt;BR /&gt;
CONE lgheight, lsec/3, lsec/2, 90,90&lt;BR /&gt;
DEL 3&lt;BR /&gt;
&lt;BR /&gt;
!seat and upholstery&lt;BR /&gt;
&lt;BR /&gt;
ADDz stheight&lt;BR /&gt;
BLOCK stlgth,stwidth,stthick&lt;BR /&gt;
MATERIAL stmat&lt;BR /&gt;
ADD 0.025,0.025,0.045&lt;BR /&gt;
BLOCK stmatlth,stmatwdth,stmatthick&lt;BR /&gt;
DEL 2&lt;BR /&gt;
&lt;BR /&gt;
!Back Legs, panel and upholstery&lt;BR /&gt;
IF bakon THEN&lt;BR /&gt;
MATERIAL framat&lt;BR /&gt;
ADD 0,0.55,0.5&lt;BR /&gt;
CONE 0.6,0.03,0.02, 90,90&lt;BR /&gt;
ADDx 0.45&lt;BR /&gt;
CONE 0.6,0.03,0.02, 90,90&lt;BR /&gt;
DEL 2&lt;BR /&gt;
ADD 0,0.54,0.70&lt;BR /&gt;
BLOCK 0.45,0.025,0.35&lt;BR /&gt;
MATERIAL backmat&lt;BR /&gt;
ADD 0.05,-0.01,0.02&lt;BR /&gt;
BLOCK 0.35,0.01,0.30&lt;BR /&gt;
DEL 2&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
and the 2d script&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!Simple Chair, Parametric 2D Script&lt;BR /&gt;
HOTSPOT2 0,0 !corner spots&lt;BR /&gt;
HOTSPOT2 stwidth,0&lt;BR /&gt;
HOTSPOT2 stwidth,stlgth&lt;BR /&gt;
HOTSPOT2 0,stlgth&lt;BR /&gt;
HOTSPOT2 stwidth/2,stlgth/2 !pickup spot&lt;BR /&gt;
!PROJECT2 3,270,2 !now disabled&lt;BR /&gt;
s4=lsec/4 !Quarter of diameter&lt;BR /&gt;
s2=lsec/2 !Half of diameter&lt;BR /&gt;
PEN 3&lt;BR /&gt;
CIRCLE2 0,0,s2&lt;BR /&gt;
CIRCLE2 stwidth,stlgth,s2&lt;BR /&gt;
CIRCLE2 0,stlgth,s2&lt;BR /&gt;
CIRCLE2 stwidth,0,s2&lt;BR /&gt;
LINE2 s2,stlgth-s4, stwidth-s2,stlgth-s4 !back&lt;BR /&gt;
LINE2 s2,stlgth+s4, stwidth-s2,stlgth+s4 !back&lt;BR /&gt;
LINE2 0,stlgth-s2,0,s2 !side&lt;BR /&gt;
LINE2 stwidth,s2,stwidth,stlgth-s2 !side&lt;BR /&gt;
LINE2 s2,0,stwidth-s2,0 !front&lt;BR /&gt;
&lt;BR /&gt;
thank you in advance for your time</description>
      <pubDate>Wed, 16 Dec 2009 13:22:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157976#M21994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-16T13:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: gdl scripting problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157977#M21995</link>
      <description>deinan:&lt;BR /&gt;
&lt;BR /&gt;
The brace code should be in the 3D Script, not the Master Script. The Master Script is run first, so the braces are being created before the rest of the chair, this could be your problem. Move the brace code to the end of the 3D Script and you should be in a better position to understand where the problem is.&lt;BR /&gt;
&lt;BR /&gt;
As a side note, it would be better to just post the library part, as anyone wanting to run and examine this object would have to replicate all the variables in the Main Library Part Window.&lt;BR /&gt;
&lt;BR /&gt;
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Wed, 16 Dec 2009 14:07:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157977#M21995</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2009-12-16T14:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: gdl scripting problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157978#M21996</link>
      <description>Hi Deinan,&lt;BR /&gt;
&lt;BR /&gt;
As David suggests, move the brace code into the 3d script. Cutting and pasting it just below the code for the legs will work fine.&lt;BR /&gt;
&lt;BR /&gt;
This code for the O brace works for me -&lt;BR /&gt;

&lt;PRE&gt;IF bracetype=bv1 THEN !O Brace 

ADD 0,0,stheight/3 
ROTz -90 
ROTx -90 
CONE stlgth/2,lsec/4,lsec/3,90,90 
ADDz stlgth/2 
CONE stlgth/2,lsec/3,lsec/4,90,90 
DEL 4 

ADD 0,stwidth,stheight/3 
ROTz -90 
ROTx -90 
CONE stlgth/2,lsec/4,lsec/3,90,90 
ADDz stlgth/2 
CONE stlgth/2,lsec/3,lsec/4,90,90 
DEL 4 

ADD 0,0,stheight/3  
ROTx -90 
CONE stwidth/2,lsec/4,lsec/3,90,90 
ADDz stwidth/2 
CONE stwidth/2,lsec/3,lsec/4,90,90 
DEL 3 

ADD stlgth,0,stheight/3 
ROTx -90 
CONE stwidth/2,lsec/4,lsec/3,90,90 
ADDz stwidth/2 
CONE stwidth/2,lsec/3,lsec/4,90,90 
DEL 3 

ENDIF&lt;/PRE&gt;

There are things you could do to simplify this code, but I have left it as it is for the moment.&lt;BR /&gt;
&lt;BR /&gt;
A few general comments on the object that also may help you -&lt;BR /&gt;
&lt;BR /&gt;
- Make the leg height related to the seat height, not a separate parameters eg stheight + 0.02. They will self-adjust automatically if you change the seat height in future.&lt;BR /&gt;
&lt;BR /&gt;
- The leg positions are hard coded. Make them relate to the seat width eg  ADDx stlgth, ADDy stwidth etc.&lt;BR /&gt;
&lt;BR /&gt;
- stlgth adjusts the seat width. stwidth adjusts the seat depth. This should probably be the other way round to avoid confusion!&lt;BR /&gt;
&lt;BR /&gt;
- The upholstery is positioned by relating it to just one corner. If the chair size is changed, the upholstery doesn't adjust to compensate correctly. Try starting at the centre of the chair and move it back half the seat width minus 25mm. Don't use separate parameters to control it's size. Use the seat width and length minus 2 x 25mm. &lt;BR /&gt;
&lt;BR /&gt;
- You don't need both TOLER and RESOL to control smoothness. Stick with just one RESOL at the top of the 3d script for now.&lt;BR /&gt;
&lt;BR /&gt;
- The back panel dimensions are hard-coded. Try to use existing parameters like the seat width, and leg thickness. You could even create a new backheight parameter.&lt;BR /&gt;
&lt;BR /&gt;
- Space your code out more to aid clarity. &lt;BR /&gt;
&lt;BR /&gt;
Hope that helps.</description>
      <pubDate>Wed, 16 Dec 2009 16:41:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157978#M21996</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-16T16:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: gdl scripting problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157979#M21997</link>
      <description>Thank you a lot,everything works just fine now.Thanks for the advice!</description>
      <pubDate>Wed, 16 Dec 2009 22:11:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/gdl-scripting-problem/m-p/157979#M21997</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-16T22:11:25Z</dc:date>
    </item>
  </channel>
</rss>

