예제 #1
0
        public static List <XYZ> GridToGridIntersections(GCGrid grid1, GCGridMulti grid2)
        {
            var ints  = new List <XYZ>();
            var doc   = GCRevitDocument.DocumentInstance(grid2.RevitElement.Document);
            var g1crv = grid1.RevitGrid.Curve;

            foreach (var gridId in grid2.RevitMultiGrid.GetGridIds())
            {
                var g2crv = (doc.GetElement(gridId) as Grid).Curve;
                ints.AddRange(GeometryUtil.IntersectionPointsOfCurves(g1crv, g2crv));
            }
            return(ints);
        }
예제 #2
0
        public static List <XYZ> GridToGridIntersections(GCGridMulti grid1, GCGridMulti grid2)
        {
            var ints = new List <XYZ>();
            var doc  = GCRevitDocument.DocumentInstance(grid1.RevitElement.Document);

            foreach (var grid1Id in grid1.RevitMultiGrid.GetGridIds())
            {
                foreach (var grid2Id in grid2.RevitMultiGrid.GetGridIds())
                {
                    if (grid1Id.IntegerValue != grid2Id.IntegerValue)
                    {
                        var g1 = doc.GetElement(grid1Id) as Grid;
                        var g2 = doc.GetElement(grid2Id) as Grid;
                        ints.AddRange(GeometryUtil.IntersectionPointsOfCurves(g1.Curve, g2.Curve));
                    }
                }
            }
            return(ints);
        }