<?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: Page Sizing Logic in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/571103#M5733</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/16334"&gt;@Eric B&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is simple, it's a unit problem. Your code checks values in meters and you thought it was checking them in millimeters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the GDL script, I always keep in mind that length values are in meters. I don't know if this can be changed somewhere but that's my rule when it comes to those. The reason the last condition is true, it's because an A2 sheet size is indeed inferior to 420 meters &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have your constants in meters and this should work. Also, I would have nested ifs preferably, it looks cleaner and prevent unnecessary tests.&lt;/P&gt;&lt;LI-CODE lang="php"&gt;sheetSize = ""

if AC_LayoutRect[3] &amp;lt; 0.420 then
	sheetSize = "A3"
else
	if AC_LayoutRect[3] &amp;lt; 0.594 then
		sheetSize = "A2"
	else	
		sheetSize = "A1"    ! default
	endif
endif&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 19:46:55 GMT</pubDate>
    <dc:creator>MF BIM</dc:creator>
    <dc:date>2023-10-16T19:46:55Z</dc:date>
    <item>
      <title>Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401930#M5723</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following code to determine the size of the page so I can show the page size along with the scale in our drawing title&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;sheetSize = "A1"

if AC_LayoutRect[3] &amp;lt; 841 then
	sheetSize = "A1"
endif

if AC_LayoutRect[3] &amp;lt; 594 then
	sheetSize = "A2"
endif

if AC_LayoutRect[3] &amp;lt; 420 then
	sheetSize = "A3"
endif&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For some reason if the sheet size is A2 and AC_LayoutRect[3] = 562.5 the sheet size will still drop though all the if statements to the last if statement and set it to A3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a specific way to read the value out of the array so that it can be used as a comparison be?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot figure out why the last statement is reading true&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreicated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Eric&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 11:48:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401930#M5723</guid>
      <dc:creator>Eric B</dc:creator>
      <dc:date>2024-09-26T11:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401931#M5724</link>
      <description>&lt;P&gt;Can you not just:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;TEXT2 0, 0, AC_LayoutRect[3]&lt;/LI-CODE&gt;
&lt;P&gt;or does that not work for some weird odd reason?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 01:08:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401931#M5724</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-10-12T01:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401939#M5725</link>
      <description>&lt;P&gt;That will output the right hand bottom corner of the sheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use that to create a crude switch statement so it will output A1, A2 or A3 as the sheet size&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 02:21:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401939#M5725</guid>
      <dc:creator>Eric B</dc:creator>
      <dc:date>2023-10-12T02:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401946#M5726</link>
      <description>&lt;P&gt;I mean so that you can see what it is returning since you said your output is coming up as A3 even though your sheet size is greater than 420. Print out the variables in question to check that they are returning the expected values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lingwisyer_0-1697083913405.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/47204i2EDA9893BC401089/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lingwisyer_0-1697083913405.png" alt="Lingwisyer_0-1697083913405.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have a list of 47 different calculated variables in one of my objects that I have printed out at one point or another. Lots and lots of trig...&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 04:18:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401946#M5726</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-10-12T04:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401957#M5727</link>
      <description>&lt;P&gt;Apologies - yes I've done that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An A2 returns 562.5 which is why I am stumped as to why it still enters the third if statement&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 06:20:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/401957#M5727</guid>
      <dc:creator>Eric B</dc:creator>
      <dc:date>2023-10-12T06:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/570941#M5729</link>
      <description>&lt;P&gt;&amp;nbsp;I have looked into this further&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I just output the contents of AC_LayoutRect[3] of an A2 sheet of paper I get a value of 567.2&lt;BR /&gt;&lt;BR /&gt;All the if statements will be evaluated but it will still enter the A3 if statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the coding and hard code the value 567.2 instead of AC_LayoutRect[3] then it goes as far as the A2 statement and will display the correct paper size&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something specific I should be doing to read this value or is there a specific place that this array is being populated and therefore I am trying to read it too soon? I am kind of at a loss as to why it won't run correctly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Eric&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 05:52:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/570941#M5729</guid>
      <dc:creator>Eric B</dc:creator>
      <dc:date>2023-10-16T05:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/571103#M5733</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/16334"&gt;@Eric B&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is simple, it's a unit problem. Your code checks values in meters and you thought it was checking them in millimeters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the GDL script, I always keep in mind that length values are in meters. I don't know if this can be changed somewhere but that's my rule when it comes to those. The reason the last condition is true, it's because an A2 sheet size is indeed inferior to 420 meters &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have your constants in meters and this should work. Also, I would have nested ifs preferably, it looks cleaner and prevent unnecessary tests.&lt;/P&gt;&lt;LI-CODE lang="php"&gt;sheetSize = ""

if AC_LayoutRect[3] &amp;lt; 0.420 then
	sheetSize = "A3"
else
	if AC_LayoutRect[3] &amp;lt; 0.594 then
		sheetSize = "A2"
	else	
		sheetSize = "A1"    ! default
	endif
endif&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 19:46:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/571103#M5733</guid>
      <dc:creator>MF BIM</dc:creator>
      <dc:date>2023-10-16T19:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/571307#M5744</link>
      <description>&lt;P&gt;You are 100% correct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a mul2 to convert all the code to mm but it was after the if statements and of course because the array was storing the dimensions in mm I didn't give it another thought&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you help with this as I had been looking at the code trying to figure out what I had done wrong&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 08:58:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/571307#M5744</guid>
      <dc:creator>Eric B</dc:creator>
      <dc:date>2023-10-18T08:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Page Sizing Logic</title>
      <link>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/573191#M5784</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Parameters are never affected by transformations. Length parameters are always stored as meters - work environment has an effect on how they are shown on the UI, and you can use imperial numbers in code, but the parameter actual values will still be meters. Angles are always degrees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another thing to know is that the data is two diagonal points of the printable area (blue border) relative to the drawing title's coordinate system, plus the rotation of the drawing title relative to the layout. The length of one side has to be calculated from these.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 11:39:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Page-Sizing-Logic/m-p/573191#M5784</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-10-30T11:39:44Z</dc:date>
    </item>
  </channel>
</rss>

