描述:Autodesk.Revit.DB.BoxPlacement类表示一个有向边界框,并在三维空间中定义了其位置和方向。
BoxPlacement (Transform transform, XYZ minimumXYZ, XYZ maximumXYZ)
- 使用由给定变换指定的位置和方向创建一个BoxPlacement类。Transform
- 获取或设置BoxPlacement相对于项目坐标系的基本变换。MinimumPoint
- 获取或设置BoxPlacement的最小边界点。MaximumPoint
- 获取或设置BoxPlacement的最大边界点。IsAlmostEqualTo(BoxPlacement otherBoxPlacement, double tolerance)
- 检测此BoxPlacement是否几乎等于另一个BoxPlacement,误差在给定的公差内。// 创建一个新的BoxPlacement
var transform = Transform.Identity;
var minimumPoint = new XYZ(0, 0, 0);
var maximumPoint = new XYZ(5,5,5);
var boxPlacement = new BoxPlacement(transform, minimumPoint, maximumPoint);
// 获取和设置最小和最大的边界点
var newMinimum = new XYZ(1,1,1);
var newMaximum = new XYZ(6,6,6);
boxPlacement.MinimumPoint = newMinimum;
boxPlacement.MaximumPoint = newMaximum;
// 检测两个BoxPlacement是否几乎相同
var otherBoxPlacement = new BoxPlacement(transform, minimumPoint, maximumPoint);
var isAlmostEqual = boxPlacement.IsAlmostEqualTo(otherBoxPlacement, 0.1);