Provides functions to create hosted sweep and preserves available edges and type. It is the base class of FasciaCreator, GutterCreator, and SlabEdgeCreator.
Example #1
0
        /// <summary>
        /// Initialize the TreeView: create a tree according to geometry edges
        /// and set each node's check status to unchecked.
        /// </summary>
        private void InitializeTree()
        {
            HostedSweepCreator creator = m_creationData.Creator;

            TreeNode rootNode = new TreeNode();

            rootNode.StateImageIndex = (int)CheckState.Unchecked;
            foreach (KeyValuePair <Autodesk.Revit.DB.Element, List <Edge> > pair in creator.SupportEdges)
            {
                Autodesk.Revit.DB.Element elem = pair.Key;
                TreeNode elemNode = new TreeNode("[Id:" + elem.Id.IntegerValue + "] " + elem.Name);
                elemNode.StateImageIndex = (int)CheckState.Unchecked;
                rootNode.Nodes.Add(elemNode);
                elemNode.Tag = elem;
                int i = 1;
                foreach (Edge edge in pair.Value)
                {
                    TreeNode edgeNode = new TreeNode("Edge " + i);
                    edgeNode.StateImageIndex = (int)CheckState.Unchecked;
                    edgeNode.Tag             = edge;
                    elemNode.Nodes.Add(edgeNode);
                    ++i;
                }
            }
            rootNode.Text = "Roofs";
            if (creator is SlabEdgeCreator)
            {
                rootNode.Text = "Floors";
            }
            treeViewHost.Nodes.Add(rootNode);
            treeViewHost.TopNode.Expand();
        }
Example #2
0
        /// <summary>
        /// Refresh list box data source.
        /// </summary>
        private void RefreshListBox()
        {
            HostedSweepCreator creator =
                comboBoxHostedSweepType.SelectedItem as HostedSweepCreator;

            m_binding.DataSource = creator.CreatedHostedSweeps;
            listBoxCreatedHostedSweeps.DataSource    = m_binding;
            listBoxCreatedHostedSweeps.DisplayMember = "Name";
            m_binding.ResetBindings(false);
        }
Example #3
0
        /// <summary>
        /// Show a form to fetch edges for hosted-sweep creation, and then create
        /// the hosted-sweep.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            HostedSweepCreator creator =
                comboBoxHostedSweepType.SelectedItem as HostedSweepCreator;

            CreationData creationData = new CreationData(creator);

            using (EdgeFetchForm createForm = new EdgeFetchForm(creationData))
            {
                if (createForm.ShowDialog() == DialogResult.OK)
                {
                    creator.Create(creationData);
                    RefreshListBox();
                }
            }
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="creator">HostedSweepCreator</param>
 public CreationData(HostedSweepCreator creator)
 {
     m_creator = creator;
 }
Example #5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="creator">HostedSweepCreator</param>
 public CreationData(HostedSweepCreator creator)
 {
     m_creator = creator;
 }