C# Class Revit.SDK.Samples.Truss.CS.TrussForm

window form contains one three picture box to show the profile of truss geometry and profile and tabControl. User can create truss, edit profile of truss and change type of truss members.
Inheritance: System.Windows.Forms.Form
Exibir arquivo Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
CreateTruss ( ) : Autodesk.Revit.DB.Structure.Truss

create truss in Revit

DataInitialize ( ) : void

get all the beam types, truss types and all the view plans from the active document

TrussForm ( ExternalCommandData commandData ) : System

constructor

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
BeamTypeComboBox_SelectedIndexChanged ( object sender, EventArgs e ) : void

change selected beam type

BottomChordButton_Click ( object sender, EventArgs e ) : void

begin to draw bottom chord

ChangeBeamTypeButton_Click ( object sender, EventArgs e ) : void

change type of selected beam

CleanChordbutton_Click ( object sender, EventArgs e ) : void

clear points of top and bottom chord line

CloseButton_Click ( object sender, EventArgs e ) : void

Close dialogue box

CreateButton_Click ( object sender, EventArgs e ) : void

create new truss

GetBeamTypes ( ) : void

get all the beam types

GetSelectTrussOrColumns ( ) : bool

Get 1 truss or 2 columns from selection

InitializeComponent ( ) : void

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

ProfileEditPictureBox_MouseClick ( object sender, MouseEventArgs e ) : void

add point to top chord and bottom chord

ProfileEditPictureBox_MouseMove ( object sender, MouseEventArgs e ) : void

change move point of top chord lineTool and bottom chord lineTool

ProfileEditPictureBox_Paint ( object sender, PaintEventArgs e ) : void

draw profile, top chord and bottom of truss

RestoreButton_Click ( object sender, EventArgs e ) : void

restore profile of truss

TopChordButton_Click ( object sender, EventArgs e ) : void

begin to draw top chord

TrussForm_Load ( object sender, EventArgs e ) : void

initialize the UI ComboBox's appearance

TrussGeometryPictureBox_MouseClick ( object sender, MouseEventArgs e ) : void

select truss member (beam)

TrussGeometryPictureBox_MouseMove ( object sender, MouseEventArgs e ) : void

get selected truss member (Beam)

TrussGeometryPictureBox_Paint ( object sender, PaintEventArgs e ) : void

draw geometry of truss, and draw selected line red

TrussGraphicsTabControl_KeyPress ( object sender, KeyPressEventArgs e ) : void

quit the "top chord" or "bottom chord" drawing operation by pressing the "ESC" key

TrussGraphicsTabControl_Selecting ( object sender, System.Windows.Forms.TabControlCancelEventArgs e ) : void

won't let open truss member tab until truss create successfully

TrussTypeComboBox_SelectedIndexChanged ( object sender, EventArgs e ) : void

get selected truss type, this data will be used in truss creation

UpdateButton_Click ( object sender, EventArgs e ) : void

update the truss according to the top chord line and the bottom chord line

ViewComboBox_SelectedIndexChanged ( object sender, EventArgs e ) : void

change selected ViewPlan

Method Details

CreateTruss() public method

create truss in Revit
public CreateTruss ( ) : Autodesk.Revit.DB.Structure.Truss
return Autodesk.Revit.DB.Structure.Truss

DataInitialize() public method

get all the beam types, truss types and all the view plans from the active document
public DataInitialize ( ) : void
return void

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

TrussForm() public method

constructor
public TrussForm ( ExternalCommandData commandData ) : System
commandData ExternalCommandData object which contains reference of Revit Application
return System