Skip to content

Commit

Permalink
Implemented AnalyticalMember.SetCurve.
Browse files Browse the repository at this point in the history
Revit 2023 or above.
  • Loading branch information
kike-garbo committed Dec 3, 2024
1 parent 3a3e10e commit eee3a77
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RhinoInside.Revit.GH/Types/Instances/FamilyInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public override Curve Curve

public override void SetCurve(Curve curve, bool keepJoins = false)
{
if (curve is object && Value is ARDB.FamilyInstance instance && curve is object)
if (curve is object && Value is ARDB.FamilyInstance instance)
{
if (instance.Location is ARDB.LocationCurve locationCurve)
{
Expand Down
20 changes: 20 additions & 0 deletions src/RhinoInside.Revit.GH/Types/Structure/AnalyticalElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ protected override void DrawViewportWires(GH_PreviewWireArgs args)

namespace RhinoInside.Revit.GH.Types
{
using Convert.Geometry;
using External.DB.Extensions;

#if REVIT_2023
using ARDB_Structure_AnalyticalMember = ARDB.Structure.AnalyticalMember;
#else
Expand All @@ -80,6 +83,23 @@ public class AnalyticalMember : AnalyticalElement

public AnalyticalMember() { }
public AnalyticalMember(ARDB_Structure_AnalyticalMember element) : base(element) { }

#region Location
#if REVIT_2023
public override void SetCurve(Curve curve, bool keepJoins = false)
{
if (curve is object && Value is ARDB_Structure_AnalyticalMember member)
{
var newCurve = curve.ToCurve();
if (!member.GetCurve().AlmostEquals(newCurve, GeometryTolerance.Internal.VertexTolerance))
{
member.SetCurve(newCurve);
InvalidateGraphics();
}
}
}
#endif
#endregion
}
}

Expand Down

0 comments on commit eee3a77

Please sign in to comment.