C# Class Revit.SDK.Samples.ShaftHolePuncher.CS.Profile

base class of ProfileFloor, ProfileWall and ProfileNull. contains the profile information and can calculate matrix to transform point to 2D plane
显示文件 Open project: AMEE/revit Class Usage Examples

Protected Properties

Property Type Description
m_appCreator Autodesk.Revit.Creation.Application
m_commandData Autodesk.Revit.UI.ExternalCommandData
m_docCreator Autodesk.Revit.Creation.Document
m_moveToCenterMatrix Matrix4
m_points List>
m_restoreMatrix Matrix4
m_scaleMatrix Matrix4
m_sizePictureBox System.Drawing.Size
m_to2DMatrix Matrix4
m_transformMatrix Matrix4

Public Methods

Method Description
Compute3DTo2DMatrix ( ) : Matrix4

calculate the matrix used to transform 3D to 2D

ComputeScaleMatrix ( Size size ) : Matrix4

calculate the matrix use to scale

CreateOpening ( List points ) : Opening

abstract method to create Opening

Draw2D ( Graphics graphics, Pen pen, Matrix4 matrix4 ) : void

draw profile of wall or floor in 2D

GetFaceBounds ( ) : System.Drawing.PointF[]

Get the bound of a face

GetFaceNormal ( List face ) : Vector4

Get normal of face

GetFaces ( Autodesk elem ) : List>

Get edges of element's profile

GetNeedPoints ( List faces ) : List>

Get points in first face

GetTo2DMatrix ( ) : Matrix4

Get a matrix which can transform points to 2D

ToCenterMatrix ( ) : Matrix4

Get a matrix which can move points to center

Transform2DTo3D ( Point ps ) : List

transform the point on Form to 3d world coordinate of revit

Protected Methods

Method Description
Profile ( ExternalCommandData commandData ) : System

constructor

Private Methods

Method Description
TransformPoints ( Point pts ) : void

use matrix to transform point

Method Details

Compute3DTo2DMatrix() public method

calculate the matrix used to transform 3D to 2D
public Compute3DTo2DMatrix ( ) : Matrix4
return Matrix4

ComputeScaleMatrix() public method

calculate the matrix use to scale
public ComputeScaleMatrix ( Size size ) : Matrix4
size System.Drawing.Size pictureBox size
return Matrix4

CreateOpening() public abstract method

abstract method to create Opening
public abstract CreateOpening ( List points ) : Opening
points List points used to create Opening
return Opening

Draw2D() public method

draw profile of wall or floor in 2D
public Draw2D ( Graphics graphics, Pen pen, Matrix4 matrix4 ) : void
graphics System.Drawing.Graphics form graphic
pen System.Drawing.Pen pen used to draw line in pictureBox
matrix4 Matrix4 Matrix used to transform 3d to 2d /// and make picture in right scale
return void

GetFaceBounds() public method

Get the bound of a face
public GetFaceBounds ( ) : System.Drawing.PointF[]
return System.Drawing.PointF[]

GetFaceNormal() public method

Get normal of face
public GetFaceNormal ( List face ) : Vector4
face List edges in a face
return Vector4

GetFaces() public method

Get edges of element's profile
public GetFaces ( Autodesk elem ) : List>
elem Autodesk selected element
return List>

GetNeedPoints() public method

Get points in first face
public GetNeedPoints ( List faces ) : List>
faces List edges in all faces
return List>

GetTo2DMatrix() public method

Get a matrix which can transform points to 2D
public GetTo2DMatrix ( ) : Matrix4
return Matrix4

Profile() protected method

constructor
protected Profile ( ExternalCommandData commandData ) : System
commandData ExternalCommandData object which contains reference to Revit Application
return System

ToCenterMatrix() public method

Get a matrix which can move points to center
public ToCenterMatrix ( ) : Matrix4
return Matrix4

Transform2DTo3D() public method

transform the point on Form to 3d world coordinate of revit
public Transform2DTo3D ( Point ps ) : List
ps System.Drawing.Point contain the points to be transformed
return List

Property Details

m_appCreator protected_oe property

protected Autodesk.Revit.Creation.Application m_appCreator
return Autodesk.Revit.Creation.Application

m_commandData protected_oe property

protected ExternalCommandData,Autodesk.Revit.UI m_commandData
return Autodesk.Revit.UI.ExternalCommandData

m_docCreator protected_oe property

protected Autodesk.Revit.Creation.Document m_docCreator
return Autodesk.Revit.Creation.Document

m_moveToCenterMatrix protected_oe property

protected Matrix4,Revit.SDK.Samples.ShaftHolePuncher.CS m_moveToCenterMatrix
return Matrix4

m_points protected_oe property

protected List> m_points
return List>

m_restoreMatrix protected_oe property

protected Matrix4,Revit.SDK.Samples.ShaftHolePuncher.CS m_restoreMatrix
return Matrix4

m_scaleMatrix protected_oe property

protected Matrix4,Revit.SDK.Samples.ShaftHolePuncher.CS m_scaleMatrix
return Matrix4

m_sizePictureBox protected_oe property

protected Size,System.Drawing m_sizePictureBox
return System.Drawing.Size

m_to2DMatrix protected_oe property

protected Matrix4,Revit.SDK.Samples.ShaftHolePuncher.CS m_to2DMatrix
return Matrix4

m_transformMatrix protected_oe property

protected Matrix4,Revit.SDK.Samples.ShaftHolePuncher.CS m_transformMatrix
return Matrix4