<?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 number of beamsegments in value array in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/643226#M7247</link>
    <description>&lt;P&gt;Hi all&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For a label linked to a segmented beam I want to chose a segment in the label settings so the label can give the settings from that segment.&lt;BR /&gt;Works perfect except for one part; i can't define the value range for how many segments there are in the beam.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Parameters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    I_segment (integer)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the Master script;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;    I_maxSegments = 0
    For i = 1 to 7 ! 7 is just a random number to prevent crashes
        IF HASKEY(BEAM_SEGMENT_INFO.segments[i].crossSection.startWidth) then
            I_maxSegments = I_maxSegments+1
        ENDIF
    next i
   PRINT I_maxSegments ! this works perfect&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;In the Parameter script;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;    VALUES "I_segment" RANGE[1, I_maxSegments]&lt;/LI-CODE&gt;&lt;SPAN&gt;&lt;BR /&gt;Values given in the label settings "1 &amp;lt; = value &amp;lt; = 0"&lt;BR /&gt;&lt;BR /&gt;Any Ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 12 Dec 2024 15:46:26 GMT</pubDate>
    <dc:creator>DNU</dc:creator>
    <dc:date>2024-12-12T15:46:26Z</dc:date>
    <item>
      <title>number of beamsegments in value array</title>
      <link>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/643226#M7247</link>
      <description>&lt;P&gt;Hi all&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For a label linked to a segmented beam I want to chose a segment in the label settings so the label can give the settings from that segment.&lt;BR /&gt;Works perfect except for one part; i can't define the value range for how many segments there are in the beam.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Parameters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    I_segment (integer)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the Master script;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;    I_maxSegments = 0
    For i = 1 to 7 ! 7 is just a random number to prevent crashes
        IF HASKEY(BEAM_SEGMENT_INFO.segments[i].crossSection.startWidth) then
            I_maxSegments = I_maxSegments+1
        ENDIF
    next i
   PRINT I_maxSegments ! this works perfect&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;In the Parameter script;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;    VALUES "I_segment" RANGE[1, I_maxSegments]&lt;/LI-CODE&gt;&lt;SPAN&gt;&lt;BR /&gt;Values given in the label settings "1 &amp;lt; = value &amp;lt; = 0"&lt;BR /&gt;&lt;BR /&gt;Any Ideas?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Dec 2024 15:46:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/643226#M7247</guid>
      <dc:creator>DNU</dc:creator>
      <dc:date>2024-12-12T15:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: number of beamsegments in value array</title>
      <link>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/643709#M7255</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BEAM_SEGMENT_INFO is not available in parameter script context, but is in UI context.&lt;/P&gt;
&lt;P&gt;parameter script:&lt;/P&gt;
&lt;DIV style="color: #3d3d3d; background-color: #fafafa; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 16px; white-space: pre;"&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;for i = 1 to 100 ! a reasonably large number of segments
    put i
next i
values "n" get(nsp) ! range [1, ) doesn't work with ui_infield&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;UI script:&lt;/P&gt;
&lt;DIV style="color: #3d3d3d; background-color: #fafafa; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 16px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;dim pic[], val[], choice[]
for i = 1 to  vardim1(BEAM_SEGMENT_INFO.segments)
    pic[i] = 0
    choice[i] = str(i, 1, 0)
    val[i] = i
next i

ui_infield{4} "n", 0, 0, 100, 20,
    8, "", 0, 0,
    0, 0, 0, 0,
    pic, choice, val&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 2d script has to handle that the number of segments can decrease below the selected value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw. if you need to label only one of the segments, before label placement you can switch between labeling the whole beam or the segment only by pressing tab when the mouse is on the beam but not on the axis.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 15:55:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/643709#M7255</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2024-12-17T15:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: number of beamsegments in value array</title>
      <link>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/644011#M7257</link>
      <description>&lt;P&gt;Thanks, Péter!&lt;/P&gt;&lt;P&gt;This works perfect.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The reason I can't link the label to the segment is that the label provides other information, such as properties that are either unavailable or not filled in for the segment.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 11:08:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/number-of-beamsegments-in-value-array/m-p/644011#M7257</guid>
      <dc:creator>DNU</dc:creator>
      <dc:date>2024-12-18T11:08:41Z</dc:date>
    </item>
  </channel>
</rss>

