【问题标题】:Wall Dimensioning墙壁尺寸标注
【发布时间】:2017-03-23 16:01:50
【问题描述】:

我想将元素之间的间隙设置为某个值,以便尺寸清晰可见。请在屏幕截图下方找到。

目前看起来是这样的。

但我想实现如下。

【问题讨论】:

    标签: revit-api revit revit-2015


    【解决方案1】:

    创建维度时,您实际上是在控制线。从 Revit 中取一条线,然后对其进行变换并使其垂直于您感兴趣的线偏移:(给定一个 dbView 和一个参考数组以及一条曲线)

    //create your line along the element you want to dimension
    Line line = Line.CreateBound(locCurve.Curve.GetEndPoint(0), locCurve.Curve.GetEndPoint(1));
    
    //Compute the perpendicular of that line (I took advantage of the fact that I was working in plan:
    XYZ perpendicular = line.ComputeDerivatives(0.5, true).BasisX.CrossProduct(new XYZ(0, 0, 1));
    
    //transform the line to the new offset location:
    Line offsetline = line.CreateTransformed(Transform.CreateTranslation(perpendicular.Normalize())) as Line;
    
    //Create the dimension.
    revitDoc.Create.NewDimension(dbView, offsetline, aDimensionRefArray);
    

    【讨论】:

      猜你喜欢
      • 2020-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多