C# Class Revit.SDK.Samples.NewHostedSweep.CS.EdgeFetchForm

This form is intent to fetch edges for hosted sweep creation or modification. It contains a picture box for geometry preview and a tree view to list all the edges which hosted sweep can be created on. If the user mouse-over an edge where a hosted sweep can be created, the edge will be highlighted in yellow. If user clicks on the highlighted edge, the edge will be marked as selected in red color. Click it again to un-select, the color will turn back. Edge selection from preview box will be reflected in edge list and vice versa. The geometry displayed in the picture box can be rotated with left mouse or arrow keys (up, down, left and right) and zoomed with right mouse.
Inheritance: System.Windows.Forms.Form
Show file Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
EdgeFetchForm ( ) : System

Default constructor.

EdgeFetchForm ( CreationData creationData ) : System

Customize constructor.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
ActiveNode ( TreeNode node ) : void

Switch geometry displayed in the preview according to the tree node.

ClearAllHighLight ( ) : void

Clear Highlighted status of all highlighted edges.

EdgeFetch_KeyDown ( object sender, KeyEventArgs e ) : void

Use arrow keys to rotate the display of geometry.

EdgeFetch_Load ( object sender, EventArgs e ) : void

This form Load event handle, all the initializations will be in here.

ExtractCheckedEdgesAndSelectedSymbol ( ) : void

Extract the checked edges in the whole tree to CreationData.EdgesForHostedSweep.

GetEdgeTreeNode ( System.Edge edge ) : TreeNode

Get the related tree node of an edit

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InitializeElementGeometry ( ) : void

Initialize element geometry.

InitializePreview ( ) : void

Initialize something related to the geometry preview.

InitializeText ( ) : void

Initialize text properties of this form.

InitializeTree ( ) : void

Initialize the TreeView: create a tree according to geometry edges and set each node's check status to unchecked.

InitializeTreeCheckStates ( ) : void

Initialize tree check states according to edges which hosted sweep can be created on.

InitializeTypes ( ) : void

Initialize the combo box data source with Autodesk.Revit.DB. e.g. FasciaTypes, GutterTypes, SlabEdgeTypes, and so on.

UpdateChildren ( TreeNode node ) : void

Recursively update tree children's status to match its parent status.

UpdateNodeCheckStatus ( TreeNode node, CheckState state ) : void

Update tree node check status, it will impact its children and parents' status.

UpdateParent ( TreeNode node ) : void

Recursively update tree parent's status to match its children status.

buttonCancel_Click ( object sender, EventArgs e ) : void

Close this form.

buttonOK_Click ( object sender, EventArgs e ) : void

Extract checked edges and verify there are edges checked in the treeView, if there aren't edges to be checked, complain about it with a message box, otherwise close this from.

pictureBoxPreview_MouseClick ( object sender, MouseEventArgs e ) : void

Select or unselect edge

pictureBoxPreview_MouseDown ( object sender, MouseEventArgs e ) : void

Initialize the track ball.

pictureBoxPreview_MouseMove ( object sender, MouseEventArgs e ) : void

Rotate or zoom the displayed geometry, or highlight the edge under the mouse location.

pictureBoxPreview_Paint ( object sender, PaintEventArgs e ) : void

Draw the geometry.

treeViewHost_BeforeCollapse ( object sender, System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Suppress the default behaviors that double-click on a tree-node which contains children will make the tree-node collapse or expand.

treeViewHost_BeforeExpand ( object sender, System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Suppress the default behaviors that double-click on a tree-node which contains children will make the tree-node collapse or expand.

treeViewHost_KeyDown ( object sender, KeyEventArgs e ) : void

Suppress the key input.

treeViewHost_MouseDown ( object sender, MouseEventArgs e ) : void

Select or un-select the key-node if down the left mouse button in the area of check-box or label.

treeViewHost_NodeMouseHover ( object sender, System.Windows.Forms.TreeNodeMouseHoverEventArgs e ) : void

Highlight the edge in the preview if mouse-over an edge tree-node.

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

EdgeFetchForm() public method

Default constructor.
public EdgeFetchForm ( ) : System
return System

EdgeFetchForm() public method

Customize constructor.
public EdgeFetchForm ( CreationData creationData ) : System
creationData CreationData
return System