【问题标题】:Revit API. ReferenceIntersector with TopografySurfacesRevit API。 ReferenceIntersector 与 TopografySurfaces
【发布时间】:2019-01-01 01:41:36
【问题描述】:

有谁知道 ReferenceIntersector 是否适用于 TopografySurfaces?不能让它工作。我需要根据与线的交点在曲面上找到一个点。

【问题讨论】:

    标签: revit-api revit bim


    【解决方案1】:

    你解决了吗?如果没有,我试一试,对我来说,这里的代码可以正常工作:

        public XYZ ProjectPointOnTopographySurface(XYZ point, int direction)
        {
            // For getting the 3D view
            View3D view3D = new FilteredElementCollector(Document)
                .OfClass(typeof(View3D))
                .Cast<View3D>()
                .Where(v => v.Name == "{3D}")
                .FirstOrDefault();
    
            XYZ vectorDirection = new XYZ(0, 0, direction);
            ElementClassFilter intersectionFilter = new ElementClassFilter(typeof(TopographySurface));
    
            ReferenceIntersector referenceIntersector = new ReferenceIntersector(intersectionFilter, FindReferenceTarget.All, view3D);
            ReferenceWithContext referenceWithContext = referenceIntersector.FindNearest(point, vectorDirection);
    
            return referenceWithContext.GetReference().GlobalPoint;
        }
    

    【讨论】:

      【解决方案2】:

      无论ReferenceIntersector 是否适用于地形表面,您都可以使用其他方式轻松解决您描述的问题。只需向表面询问其镶嵌表示。这将返回一堆三角形。然后,实现你自己的algorithm to intersect a triangle with the line。那应该给你所有你需要的,真的。

      【讨论】:

      • 谢谢杰里米,我会试试的。
      猜你喜欢
      • 2020-04-20
      • 1970-01-01
      • 2016-10-24
      • 2019-08-06
      • 1970-01-01
      • 2020-03-31
      • 2019-09-21
      • 2017-01-14
      • 2019-08-27
      相关资源
      最近更新 更多