Revit二开--计算重心
Revit二开--计算重心
revit二次开发中总有千奇百怪的需求,例如有的朋友要计算物体重心。
在RevitApi里面,提供了对均质物体计算重心的方法,计算结果就是这个几何体的重心的坐标 XYZ.
- Solid 类下面有一个 ComputeCentroid 方法
-
Remarks
Calculates the centroid of the solid using an approximation, with an accuracy suitable for architectural purposes. This will correspond only with the center of gravity if the solid represents a homogeneous structure of a single material.