From 51f23be2897214f011ac317d76c4f373143468d7 Mon Sep 17 00:00:00 2001 From: kike-garbo Date: Tue, 2 Jul 2024 18:29:33 +0200 Subject: [PATCH 1/3] Fix `Reference.GetElement`. --- src/RhinoInside.Revit.GH/Types/Reference.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RhinoInside.Revit.GH/Types/Reference.cs b/src/RhinoInside.Revit.GH/Types/Reference.cs index 1c565a556..03aba6c48 100755 --- a/src/RhinoInside.Revit.GH/Types/Reference.cs +++ b/src/RhinoInside.Revit.GH/Types/Reference.cs @@ -266,7 +266,7 @@ protected internal T GetElement(T element) where T : Element if (IsLinked && Document.IsEquivalent(element.Document)) return (T) Element.FromLinkElement(ReferenceDocument.GetElement(ReferenceId) as ARDB.RevitLinkInstance, element); - if (!ReferenceDocument.IsEquivalent(element.Document)) + if (element.Document is object && !ReferenceDocument.IsEquivalent(element.Document)) throw new Exceptions.RuntimeArgumentException(nameof(element), $"Invalid Document"); return element; From beab31f9ba5f01f3daa6f6f8769dfdd00edc6508 Mon Sep 17 00:00:00 2001 From: kike-garbo Date: Wed, 3 Jul 2024 18:30:07 +0200 Subject: [PATCH 2/3] Fixes #1132 --- .../Components/Element/Ceiling/ByOutline.cs | 2 +- src/RhinoInside.Revit.GH/Components/Element/Floor/AddFloor.cs | 2 +- src/RhinoInside.Revit.GH/Components/Element/Railing/ByCurve.cs | 2 +- src/RhinoInside.Revit.GH/Components/Element/Roof/ByOutline.cs | 2 +- src/RhinoInside.Revit.GH/Components/Element/Wall/ByProfile.cs | 2 +- src/RhinoInside.Revit.GH/Components/Site/AddToposolid.cs | 2 +- .../Components/Site/AddToposolidSubDivision.cs | 2 +- .../Components/Structure/AddFoundation-Slab.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RhinoInside.Revit.GH/Components/Element/Ceiling/ByOutline.cs b/src/RhinoInside.Revit.GH/Components/Element/Ceiling/ByOutline.cs index f264b6380..1a6b33f55 100755 --- a/src/RhinoInside.Revit.GH/Components/Element/Ceiling/ByOutline.cs +++ b/src/RhinoInside.Revit.GH/Components/Element/Ceiling/ByOutline.cs @@ -85,7 +85,7 @@ void ReconstructCeilingByOutline ) ThrowArgumentException(nameof(boundary), "Boundary loop curves should be a set of valid horizontal, coplanar and closed curves."); - boundary[index] = loop.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? loop; + boundary[index] = loop.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? loop; using (var properties = AreaMassProperties.Compute(loop, tol.VertexTolerance)) { diff --git a/src/RhinoInside.Revit.GH/Components/Element/Floor/AddFloor.cs b/src/RhinoInside.Revit.GH/Components/Element/Floor/AddFloor.cs index 8cdc4f37c..9969bce85 100644 --- a/src/RhinoInside.Revit.GH/Components/Element/Floor/AddFloor.cs +++ b/src/RhinoInside.Revit.GH/Components/Element/Floor/AddFloor.cs @@ -136,7 +136,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA) ) throw new RuntimeArgumentException(nameof(boundary), "Boundary loop curves should be a set of valid horizontal, coplanar and closed curves.", boundary); - boundary[index] = loop.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? loop; + boundary[index] = loop.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? loop; using (var properties = AreaMassProperties.Compute(loop, tol.VertexTolerance)) { diff --git a/src/RhinoInside.Revit.GH/Components/Element/Railing/ByCurve.cs b/src/RhinoInside.Revit.GH/Components/Element/Railing/ByCurve.cs index 262c38a97..5ff4681fc 100644 --- a/src/RhinoInside.Revit.GH/Components/Element/Railing/ByCurve.cs +++ b/src/RhinoInside.Revit.GH/Components/Element/Railing/ByCurve.cs @@ -51,7 +51,7 @@ [Optional] bool flipped Vector3d.ZAxis ); curve = Curve.ProjectToPlane(curve, levelPlane); - curve = curve.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? curve; + curve = curve.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? curve; // Type ChangeElementTypeId(ref railing, type.Value.Id); diff --git a/src/RhinoInside.Revit.GH/Components/Element/Roof/ByOutline.cs b/src/RhinoInside.Revit.GH/Components/Element/Roof/ByOutline.cs index 3f9f9132d..70365cc24 100644 --- a/src/RhinoInside.Revit.GH/Components/Element/Roof/ByOutline.cs +++ b/src/RhinoInside.Revit.GH/Components/Element/Roof/ByOutline.cs @@ -83,7 +83,7 @@ boundary is null || SolveOptionalLevel(document, boundary, ref level, out var bbox); - boundary = boundary.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? boundary; + boundary = boundary.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? boundary; var orientation = boundary.ClosedCurveOrientation(Plane.WorldXY); if (orientation == CurveOrientation.CounterClockwise) diff --git a/src/RhinoInside.Revit.GH/Components/Element/Wall/ByProfile.cs b/src/RhinoInside.Revit.GH/Components/Element/Wall/ByProfile.cs index 2e50c7378..bf6a59a28 100755 --- a/src/RhinoInside.Revit.GH/Components/Element/Wall/ByProfile.cs +++ b/src/RhinoInside.Revit.GH/Components/Element/Wall/ByProfile.cs @@ -199,7 +199,7 @@ loop is null || ThrowArgumentException(nameof(profile), "Profile should be a list of planar vertical surfaces.", loop); #endif - loops[index] = loop.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? loop; + loops[index] = loop.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? loop; using (var properties = AreaMassProperties.Compute(loop, tol.VertexTolerance)) { diff --git a/src/RhinoInside.Revit.GH/Components/Site/AddToposolid.cs b/src/RhinoInside.Revit.GH/Components/Site/AddToposolid.cs index 372859a1a..39b2087fb 100644 --- a/src/RhinoInside.Revit.GH/Components/Site/AddToposolid.cs +++ b/src/RhinoInside.Revit.GH/Components/Site/AddToposolid.cs @@ -131,7 +131,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA) throw new RuntimeArgumentException(nameof(boundary), "Boundary loop curves should be a set of valid horizontal, coplanar and closed curves.", boundary); boundaryElevation = Interval.FromUnion(boundaryElevation, new Interval(plane.OriginZ, plane.OriginZ)); - boundary[index] = loop.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? loop; + boundary[index] = loop.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? loop; using (var properties = AreaMassProperties.Compute(loop, tol.VertexTolerance)) { diff --git a/src/RhinoInside.Revit.GH/Components/Site/AddToposolidSubDivision.cs b/src/RhinoInside.Revit.GH/Components/Site/AddToposolidSubDivision.cs index c27bb45e1..fb8eadbca 100644 --- a/src/RhinoInside.Revit.GH/Components/Site/AddToposolidSubDivision.cs +++ b/src/RhinoInside.Revit.GH/Components/Site/AddToposolidSubDivision.cs @@ -105,7 +105,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA) throw new RuntimeArgumentException(nameof(boundary), "Boundary loop curves should be a set of valid horizontal, coplanar and closed curves.", boundary); boundaryElevation = Interval.FromUnion(boundaryElevation, new Interval(plane.OriginZ, plane.OriginZ)); - boundary[index] = loop.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? loop; + boundary[index] = loop.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? loop; using (var properties = AreaMassProperties.Compute(loop, tol.VertexTolerance)) { diff --git a/src/RhinoInside.Revit.GH/Components/Structure/AddFoundation-Slab.cs b/src/RhinoInside.Revit.GH/Components/Structure/AddFoundation-Slab.cs index 90966ccdf..cc2ec77df 100644 --- a/src/RhinoInside.Revit.GH/Components/Structure/AddFoundation-Slab.cs +++ b/src/RhinoInside.Revit.GH/Components/Structure/AddFoundation-Slab.cs @@ -137,7 +137,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA) ) throw new RuntimeArgumentException(nameof(boundary), "Boundary loop curves should be a set of valid horizontal, coplanar and closed curves.", boundary); - boundary[index] = loop.Simplify(CurveSimplifyOptions.All, tol.VertexTolerance, tol.AngleTolerance) ?? loop; + boundary[index] = loop.Simplify(CurveSimplifyOptions.All & ~CurveSimplifyOptions.Merge, tol.VertexTolerance, tol.AngleTolerance) ?? loop; using (var properties = AreaMassProperties.Compute(loop, tol.VertexTolerance)) { From a547ed5f780eb0db546669013e54412bc7f29973 Mon Sep 17 00:00:00 2001 From: kike-garbo Date: Wed, 3 Jul 2024 18:31:57 +0200 Subject: [PATCH 3/3] Debug builds need to be deterministic in order to make 'Hot Reload' to work. --- src/Product.targets | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Product.targets b/src/Product.targets index f0c48c0f1..1ed124387 100644 --- a/src/Product.targets +++ b/src/Product.targets @@ -18,10 +18,8 @@ If `ReleaseVersion` contains "wip" the product expires. 1 22 - + 0 + 0