<?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 Select A Value By Index in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Select-A-Value-By-Index/m-p/100246#M36219</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Is there any way to set a parameter's value by using an index?  I want a default to be the second item in a value list because the first value is always `0`.&lt;BR /&gt;
&lt;BR /&gt;
VALUES Light_Frame_Qty `0`, `10`, `20`&lt;BR /&gt;
IF Selected = `-` THEN&lt;BR /&gt;
PARAMETERS Light_Frame_Qty = `0`&lt;BR /&gt;
ELSE&lt;BR /&gt;
PARAMETERS Light_Frame_Qty = [index2]&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
It's easy enough to use the value `10` in place of [index2] when there is only one of these, but if you have 20 very different parameters (and I do) it would be much quicker to code using the index.&lt;/T&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 09 Jun 2005 23:21:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-09T23:21:25Z</dc:date>
    <item>
      <title>Select A Value By Index</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Select-A-Value-By-Index/m-p/100246#M36219</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Is there any way to set a parameter's value by using an index?  I want a default to be the second item in a value list because the first value is always `0`.&lt;BR /&gt;
&lt;BR /&gt;
VALUES Light_Frame_Qty `0`, `10`, `20`&lt;BR /&gt;
IF Selected = `-` THEN&lt;BR /&gt;
PARAMETERS Light_Frame_Qty = `0`&lt;BR /&gt;
ELSE&lt;BR /&gt;
PARAMETERS Light_Frame_Qty = [index2]&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
It's easy enough to use the value `10` in place of [index2] when there is only one of these, but if you have 20 very different parameters (and I do) it would be much quicker to code using the index.&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Jun 2005 23:21:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Select-A-Value-By-Index/m-p/100246#M36219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-09T23:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select A Value By Index</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Select-A-Value-By-Index/m-p/100247#M36220</link>
      <description>Try this (from brain to keyboard, not tested):
&lt;PRE&gt;DIM QTY_val []
QTY_val[1] = `0`
QTY_val[2] = `10`
QTY_val[3] = `20`
VALUES Light_Frame_Qty  QTY_val

VALUES Selected 1,2,3

IF GLOB_MODPAR_NAME="Selected" THEN
  PARAMETERS Light_Frame_Qty = QTY_val[ MAX(1, MIN(Selected,VARDIM1(QTY_val) ) ]
  ENDIF&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jun 2005 06:47:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Select-A-Value-By-Index/m-p/100247#M36220</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2005-06-10T06:47:02Z</dc:date>
    </item>
  </channel>
</rss>

