<?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: Revit parameter form listbox to listbox in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529058#M44924</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Benoit FAVRE,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have one question remaining about this topic. I can save the listbox 1 and 2 layout with the&amp;nbsp; "properties.settings.default" this is working well when you always have the same items in a list.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But i like to&amp;nbsp;receive custom shared parameters in the list. That's not a problem but when you have a new project without these custom shared parameters. They still got visible in the list because of they are saved to the "properties.settings"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How is this part working with Revit, like when you make a new schedule and add or delete parameters to the schedule Revit reminds your choices. But in my case i use a datagridview with listboxes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tried to find solutions on the internet but couldn't find a good example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Concept2.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/592020i15965F9ED485CDCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Concept2.gif" alt="Concept2.gif" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jan 2019 08:57:59 GMT</pubDate>
    <dc:creator>vanlion</dc:creator>
    <dc:date>2019-01-17T08:57:59Z</dc:date>
    <item>
      <title>Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8516528#M44921</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm looking for a good example how to get values from a list with parameters, from one listbox to the other (see picture. I have a working code but saving the custom settings isn't working. I first tried it with a simple list (replace it later with parameter list) to test but you get an error because of the Properties.Settings.Default part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anybody has an example or link to a site how to do this in Revit? I know it's more a C# question. But i searched a lot and no working solution found yet. To make it a little bit clearer i'm looking for the same workflow when you create a schedule in Revit so you can add or remove parameters, like the last picture.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;publicpartialclassForm1:Form
{
    List&amp;lt;string&amp;gt; l2;
    string selectedItemText;
    intSelectedIndex;  

    publicForm1()
    {
        InitializeComponent();           

        l2 =newList&amp;lt;string&amp;gt;();
        l2.Add("1");
        l2.Add("2");
        l2.Add("3");
        l2.Add("4");
        l2.Add("5");

        listBox1.DataSource= l2;
    }

    privatevoidForm1_Load(object sender,EventArgs e)
    {         
        listBox1.Items.Clear();
        foreach(object item inProperties.Settings.Default.listSave)
        {
            listBox1.Items.Add(item);
        }

        listBox2.Items.Clear();
        foreach(object item inProperties.Settings.Default.listSave2)
        {
            listBox2.Items.Add(item);
        }            
    }

    privatevoid button1_Click(object sender,EventArgs e)
    {
        this.Close();

        Properties.Settings.Default.listSave.Clear();
        Properties.Settings.Default.listSave2.Clear();

        foreach(object item in listBox1.Items)
        {
            Properties.Settings.Default.listSave.Add(item.ToString());
        }

        foreach(object item in listBox2.Items)
        {
            Properties.Settings.Default.listSave2.Add(item.ToString());
        }
        Properties.Settings.Default.Save();          

    }

    privatevoid button2_Click_1(object sender,EventArgs e)
    {
        selectedItemText = listBox1.SelectedItem.ToString();
        SelectedIndex= listBox1.SelectedIndex;

        listBox2.Items.Add(selectedItemText);

        if(l2 !=null)
        {
            l2.RemoveAt(SelectedIndex);
        }

        DataBindings();
    }

    privatevoidDataBindings()
    {
        listBox1.DataSource=null;
        listBox1.DataSource= l2;

    }

    privatevoid button4_Click(object sender,EventArgs e)
    {
        selectedItemText = listBox2.SelectedItem.ToString();
        SelectedIndex= listBox2.SelectedIndex;
        l2.Add(selectedItemText);

        listBox2.Items.RemoveAt(listBox2.Items.IndexOf(listBox2.SelectedItem));

        DataBindings();
    }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9KXHz.png" style="width: 362px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/589923i6E95119A7890ADD5/image-dimensions/362x222?v=v2" width="362" height="222" role="button" title="9KXHz.png" alt="9KXHz.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 550px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/589925i88B26F74F41A2098/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 16:17:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8516528#M44921</guid>
      <dc:creator>vanlion</dc:creator>
      <dc:date>2019-01-11T16:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8516586#M44922</link>
      <description>&lt;P&gt;Hey Vanlion,&lt;/P&gt;
&lt;P&gt;I assume you know some stuff on windows and events in C#. If not, there are some good courses about that and that would be a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You change the content of list 1 and 2 only by clicking on the &amp;gt;&amp;gt; and &amp;lt;&amp;lt; buttons. So all your code will be associated with these 2 buttons.&lt;/P&gt;
&lt;P&gt;Button &amp;gt;&amp;gt; has the following in its Click event :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;List&amp;lt;string&amp;gt; listSelected = new List&amp;lt;string&amp;gt;();&lt;/P&gt;
&lt;P&gt;foreach(string str in Lb_left.SelectedItems)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;listSelected.Add(str);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;foreach(string str in listSelected)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;this.LB_left.Items.Remove(str);&lt;/P&gt;
&lt;P&gt;this.LB_right.Items.Add(str);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do the same with the other button &amp;lt;&amp;lt; and you're done.&lt;/P&gt;
&lt;P&gt;Hope it helps&lt;/P&gt;
&lt;P&gt;Benoit&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 16:38:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8516586#M44922</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-01-11T16:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8518567#M44923</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;Benoit FAVRE&lt;/SPAN&gt;,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Thanks for taking your time to help!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;With the replacement of mine code part with yours and changing getting the listbox data from:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;listbox1.DataSource = "Your list";&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;to:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;foreach (object obj in colName)
{
       listBox1.Items.Add(obj);
}&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;it is working very nice and reminds the user settings &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; so it also went wrong with the DataSource&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; see attached GIF for the result! (Revit fragment)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So thanks again!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Concept1.gif" style="width: 911px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/590218iEC74BBFB0D115758/image-size/large?v=v2&amp;amp;px=999" role="button" title="Concept1.gif" alt="Concept1.gif" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 00:51:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8518567#M44923</guid>
      <dc:creator>vanlion</dc:creator>
      <dc:date>2019-01-13T00:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529058#M44924</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Benoit FAVRE,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have one question remaining about this topic. I can save the listbox 1 and 2 layout with the&amp;nbsp; "properties.settings.default" this is working well when you always have the same items in a list.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But i like to&amp;nbsp;receive custom shared parameters in the list. That's not a problem but when you have a new project without these custom shared parameters. They still got visible in the list because of they are saved to the "properties.settings"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How is this part working with Revit, like when you make a new schedule and add or delete parameters to the schedule Revit reminds your choices. But in my case i use a datagridview with listboxes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tried to find solutions on the internet but couldn't find a good example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Concept2.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/592020i15965F9ED485CDCF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Concept2.gif" alt="Concept2.gif" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 08:57:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529058#M44924</guid>
      <dc:creator>vanlion</dc:creator>
      <dc:date>2019-01-17T08:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529088#M44925</link>
      <description>&lt;P&gt;Hey Vanlion,&lt;/P&gt;
&lt;P&gt;I can't understand neither your problem nor the question. Can you explain ?&lt;/P&gt;
&lt;P&gt;Benoit&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:12:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529088#M44925</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-01-17T09:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529156#M44926</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your quick response. The thing i'm looking for is as you can see in the GIF image below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you add a Sheetlist for exmple you can add the available fields to a second listbox.&amp;nbsp;When you are finished and click on the edit fields tab you see the second listbox reminds the fields you have added. This is the part i can't get to work/ find how to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this more clear for you what my question is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, let me know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Concept2.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/592045i8F89D9B532637F1F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Concept2.gif" alt="Concept2.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:44:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8529156#M44926</guid>
      <dc:creator>vanlion</dc:creator>
      <dc:date>2019-01-17T09:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8539721#M44927</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;Not sure that I understand your question but I'll try.&lt;/P&gt;
&lt;P&gt;You want the information modified by user (what he puts in second listBox) to "stay" between 2 uses of your algo.&lt;/P&gt;
&lt;P&gt;This means that you have to save some informations on your memory.&lt;/P&gt;
&lt;P&gt;You have multiple ways to do this, from creating a text file somewhere to using Jeremy's Schemas.&lt;/P&gt;
&lt;P&gt;Then when your algo will be started again you have to initialize it with a part where you will load the informations of the past session.&lt;/P&gt;
&lt;P&gt;Hope it helps&lt;/P&gt;
&lt;P&gt;Benoit&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 09:34:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8539721#M44927</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-01-22T09:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Revit parameter form listbox to listbox</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8539771#M44928</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for helping me. I will try to make a text file that will store the user settings in the listboxes instead of using the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"properties.settings.default…"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was hoping that the SDK has a good simple example but couldn't find it. so I try it with a text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 10:00:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-parameter-form-listbox-to-listbox/m-p/8539771#M44928</guid>
      <dc:creator>vanlion</dc:creator>
      <dc:date>2019-01-22T10:00:14Z</dc:date>
    </item>
  </channel>
</rss>

