Help me find WINFORM Examples!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys, I really need help to search for materials regarding this. There are not many resources that I was able to find that clearly explains how to reuse a list formed by code from c# project, to winform as a useroption. I have already created a list based on all the worksets being used inside the revit project in a separate cs project and hope to use this list as part of the listbox tool inside winforms. Are there any examples that you could give me to tackle this problem?
This is what winforms provide:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Organize
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
The code
IList<Workset> worksetList = new FilteredWorksetCollector(doc).OfKind(WorksetKind.UserWorkset).ToWorksets();
string test = "";
foreach (Workset Workset in worksetList)
{
test += Workset.Name + ": " + Workset.Id + "\n" ;
}
The picture below is what I would like to show when user select the plugin on revit.
If it is still not clear maybe this might help give a clearer view of the situation i am in.
1. User Selects plugin on revit
2. Winforms is shown.
3. User selects the workset to move elements that are in the wrong workset to this selected workset. User also selects the elements to be filtered and moved to this workset accordingly.
4. User selects okay/continue.
5. Code runs based on user options and organize the elements accordingly.
6. Taskdialog shows elements that were moved.
I already have the code to run the filter for one element to one workset. However, I would like to create a winform to expand this capability for all worksets and elements available in the project however, I do not know how to use it.