C# Class Revit.SDK.Samples.RayTraceBounce.CS.RayTraceBounceForm

1. This form allowing entry of a coordinate location (X, Y, Z) within the model and a coordinate direction (i, j, k). 2. Launch a ray from this location in this direction to find the first intersection with a face 3. Calculate the reflection angle of the ray from the face and launch another ray to find the next intersection 4. For each ray/intersection, create a model line connecting the two points. The end result should be a series of model lines bouncing from item to item. 5. Provide a hard limit of say, 100 intersections, to prevent endless reflections within an enclosed space. 6. Write a log file of the intersection containing: the element type, id, and material of the intersected face.
Inheritance: System.Windows.Forms.Form
Datei anzeigen Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
DeleteLines ( ) : void

Delete all unnecessary lines

FindClosestReference ( IList references ) : Autodesk.Revit.DB.ReferenceWithContext

Find the first intersection with a face

MakeLine ( Autodesk startpt, Autodesk endpt, Autodesk direction, string style ) : void

Make a line from start point to end point with the direction and style

RayTraceBounceForm ( ExternalCommandData commandData, Autodesk v ) : System

Constructor

UpdateData ( bool updateControl ) : bool

Update textbox data with member variable

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

OutputInformation ( ) : void

Output the information to log file

Private Methods

Method Description
InitializeComponent ( ) : void

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

buttonCancel_Click ( object sender, EventArgs e ) : void

Cancel button click event

buttonOK_Click ( object sender, EventArgs e ) : void

OK button click event

Method Details

DeleteLines() public method

Delete all unnecessary lines
public DeleteLines ( ) : 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

FindClosestReference() public method

Find the first intersection with a face
public FindClosestReference ( IList references ) : Autodesk.Revit.DB.ReferenceWithContext
references IList
return Autodesk.Revit.DB.ReferenceWithContext

MakeLine() public method

Make a line from start point to end point with the direction and style
public MakeLine ( Autodesk startpt, Autodesk endpt, Autodesk direction, string style ) : void
startpt Autodesk start point
endpt Autodesk end point
direction Autodesk the direction which decide the plane
style string line style name
return void

OutputInformation() protected method

Output the information to log file
protected OutputInformation ( ) : void
return void

RayTraceBounceForm() public method

Constructor
public RayTraceBounceForm ( ExternalCommandData commandData, Autodesk v ) : System
commandData ExternalCommandData Revit application
v Autodesk 3D View
return System

UpdateData() public method

Update textbox data with member variable
public UpdateData ( bool updateControl ) : bool
updateControl bool if get/set date from control
return bool