C# Class Revit.SDK.Samples.ModelLines.CS.ModelLines

The main deal class, which takes charge of showing the number of each model line type and creating one instance for each type using Revit API
Show file Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
CreateArc ( int sketchId, Autodesk startPoint, Autodesk endPoint, Autodesk thirdPoint ) : void

Create the arc(ModelArc)

CreateLine ( int sketchId, Autodesk startPoint, Autodesk endPoint ) : void

Create the line(ModelLine)

CreateOthers ( int sketchId, int elementId, Autodesk offsetPoint ) : void

Create other lines, including Ellipse, HermiteSpline and NurbSpline

CreateSketchPlane ( Autodesk normal, Autodesk origin ) : void

Create a new sketch plane which all model lines are placed on.

ModelLines ( Autodesk revit ) : System

The default constructor

RefreshInformationMap ( ) : void

Refresh the m_informationMap member, include the number of each model line type

Run ( ) : void

This is the main deal method in this example.

Private Methods

Method Description
GetElementById ( int id ) : Autodesk.Revit.DB.Element

Use Autodesk.Revit.DB.ElementId to get the corresponding element

GetModelLines ( ) : void

Get all model lines in current document of revit, and store them into the arrays

GetSketchPlane ( ) : void

Get all sketch planes in revit

GetSketchPlaneById ( int id ) : SketchPlane

Use Autodesk.Revit.DB.ElementId to get the corresponding sketch plane

InitDisplayInformation ( ) : void

Initiate the information map which will display in information DataGridView

Method Details

CreateArc() public method

Create the arc(ModelArc)
public CreateArc ( int sketchId, Autodesk startPoint, Autodesk endPoint, Autodesk thirdPoint ) : void
sketchId int the id of the sketch plane
startPoint Autodesk the start point of the arc
endPoint Autodesk the end point of the arc
thirdPoint Autodesk the third point which is on the arc
return void

CreateLine() public method

Create the line(ModelLine)
public CreateLine ( int sketchId, Autodesk startPoint, Autodesk endPoint ) : void
sketchId int the id of the sketch plane
startPoint Autodesk the start point of the line
endPoint Autodesk the end point of the line
return void

CreateOthers() public method

Create other lines, including Ellipse, HermiteSpline and NurbSpline
public CreateOthers ( int sketchId, int elementId, Autodesk offsetPoint ) : void
sketchId int the id of the sketch plane
elementId int the element id which copy the curve from
offsetPoint Autodesk the offset direction from the copied line
return void

CreateSketchPlane() public method

Create a new sketch plane which all model lines are placed on.
public CreateSketchPlane ( Autodesk normal, Autodesk origin ) : void
normal Autodesk
origin Autodesk
return void

ModelLines() public method

The default constructor
public ModelLines ( Autodesk revit ) : System
revit Autodesk The reference of the application in revit
return System

RefreshInformationMap() public method

Refresh the m_informationMap member, include the number of each model line type
public RefreshInformationMap ( ) : void
return void

Run() public method

This is the main deal method in this example.
public Run ( ) : void
return void