public static AddXYZ ( Autodesk lhs, Autodesk rhs ) : Autodesk.Revit.DB.XYZ | ||
lhs | Autodesk | |
rhs | Autodesk | |
return | Autodesk.Revit.DB.XYZ |
/// <summary> /// Add 2 Transform Matrix /// </summary> /// <param name="tran1"></param> /// <param name="tran2"></param> /// <returns></returns> private Transform AddTransform(Transform tran1, Transform tran2) { Autodesk.Revit.DB.XYZ xyz = new Autodesk.Revit.DB.XYZ(0, 0, 0); Transform result = Transform.CreateTranslation(xyz); result.Origin = MathUtil.AddXYZ(tran1.Origin, tran2.Origin); Autodesk.Revit.DB.XYZ[] left = new Autodesk.Revit.DB.XYZ[3]; Autodesk.Revit.DB.XYZ[] right = new Autodesk.Revit.DB.XYZ[3]; for (int i = 0; i < 3; i++) { left[i] = tran1.get_Basis(i); right[i] = tran2.get_Basis(i); } Autodesk.Revit.DB.XYZ[] temp = MathUtil.MultiCross(left, right); for (int i = 0; i < 3; i++) { result.set_Basis(i, temp[i]); } return(result); }
/// <summary> /// find the center of the BoundingBox /// </summary> /// <param name="bbox">BoundingBox</param> /// <returns>center Point</returns> private Vector FindBBoxCenter(BoundingBoxXYZ bbox) { Autodesk.Revit.DB.XYZ center = MathUtil.DivideXYZ(MathUtil.AddXYZ(bbox.Max, bbox.Min), 2.0); return(MathUtil.XYZ2Vector(center)); }