C# Class Revit.SDK.Samples.NewRebar.CS.GeomUtil

The class which gives the base geometry operation, it is a static class.
Show file Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
AddXYZ ( Autodesk p1, Autodesk p2 ) : Autodesk.Revit.DB.XYZ

Add of two points(or vectors), get a new point(vector)

GetLength ( Autodesk vector ) : double

Calculate the distance from grid origin to the XYZ(vector length)

IsEqual ( Autodesk first, Autodesk second ) : bool

Judge whether the two Autodesk.Revit.DB.XYZ point are equal

IsEqual ( double d1, double d2 ) : bool

Judge whether the two double data are equal

IsOppositeDirection ( Autodesk firstVec, Autodesk secondVec ) : bool

Judge whether the two vectors have the opposite direction

IsSameDirection ( Autodesk firstVec, Autodesk secondVec ) : bool

Judge whether the two vectors have the same direction

IsVertical ( Face face, System.Line line, Transform faceTrans, Transform lineTrans ) : bool

Judge whether the line is perpendicular to the face

MultiplyVector ( Autodesk vector, double rate ) : Autodesk.Revit.DB.XYZ

Multiply a vector with a number

OffsetPoint ( Autodesk point, Autodesk direction, double offset ) : Autodesk.Revit.DB.XYZ

Move a point a give offset along a given direction

SubXYZ ( Autodesk p1, Autodesk p2 ) : Autodesk.Revit.DB.XYZ

Subtraction of two points(or vectors), get a new vector

TransformPoint ( Autodesk point, Transform transform ) : Autodesk.Revit.DB.XYZ

Transform old coordinate system in the new coordinate system

UnitVector ( Autodesk vector ) : Autodesk.Revit.DB.XYZ

Set the vector into unit length

Private Methods

Method Description
DotMatrix ( Autodesk p1, Autodesk p2 ) : double

Dot product of two Autodesk.Revit.DB.XYZ as Matrix

Method Details

AddXYZ() public static method

Add of two points(or vectors), get a new point(vector)
public static AddXYZ ( Autodesk p1, Autodesk p2 ) : Autodesk.Revit.DB.XYZ
p1 Autodesk The first point(vector)
p2 Autodesk The first point(vector)
return Autodesk.Revit.DB.XYZ

GetLength() public static method

Calculate the distance from grid origin to the XYZ(vector length)
public static GetLength ( Autodesk vector ) : double
vector Autodesk The input vector
return double

IsEqual() public static method

Judge whether the two Autodesk.Revit.DB.XYZ point are equal
public static IsEqual ( Autodesk first, Autodesk second ) : bool
first Autodesk The first Autodesk.Revit.DB.XYZ point
second Autodesk The second Autodesk.Revit.DB.XYZ point
return bool

IsEqual() public static method

Judge whether the two double data are equal
public static IsEqual ( double d1, double d2 ) : bool
d1 double The first double data
d2 double The second double data
return bool

IsOppositeDirection() public static method

Judge whether the two vectors have the opposite direction
public static IsOppositeDirection ( Autodesk firstVec, Autodesk secondVec ) : bool
firstVec Autodesk The first vector
secondVec Autodesk The second vector
return bool

IsSameDirection() public static method

Judge whether the two vectors have the same direction
public static IsSameDirection ( Autodesk firstVec, Autodesk secondVec ) : bool
firstVec Autodesk The first vector
secondVec Autodesk The second vector
return bool

IsVertical() public static method

Judge whether the line is perpendicular to the face
public static IsVertical ( Face face, System.Line line, Transform faceTrans, Transform lineTrans ) : bool
face Face The face reference
line System.Line The line reference
faceTrans Transform The transform for the face
lineTrans Transform The transform for the line
return bool

MultiplyVector() public static method

Multiply a vector with a number
public static MultiplyVector ( Autodesk vector, double rate ) : Autodesk.Revit.DB.XYZ
vector Autodesk A vector
rate double The rate number
return Autodesk.Revit.DB.XYZ

OffsetPoint() public static method

Move a point a give offset along a given direction
public static OffsetPoint ( Autodesk point, Autodesk direction, double offset ) : Autodesk.Revit.DB.XYZ
point Autodesk The point need to move
direction Autodesk The direction the point move to
offset double Tndicate how long to move
return Autodesk.Revit.DB.XYZ

SubXYZ() public static method

Subtraction of two points(or vectors), get a new vector
public static SubXYZ ( Autodesk p1, Autodesk p2 ) : Autodesk.Revit.DB.XYZ
p1 Autodesk The first point(vector)
p2 Autodesk The second point(vector)
return Autodesk.Revit.DB.XYZ

TransformPoint() public static method

Transform old coordinate system in the new coordinate system
public static TransformPoint ( Autodesk point, Transform transform ) : Autodesk.Revit.DB.XYZ
point Autodesk The Autodesk.Revit.DB.XYZ which need to be transformed
transform Transform The value of the coordinate system to be transformed
return Autodesk.Revit.DB.XYZ

UnitVector() public static method

Set the vector into unit length
public static UnitVector ( Autodesk vector ) : Autodesk.Revit.DB.XYZ
vector Autodesk The input vector
return Autodesk.Revit.DB.XYZ