Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added specific components for Boundary Conditions #1272

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/pages/_en/1.0/reference/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ group: Deployment & Configs
### WIP

- Added 'Reference Point' parameter.
- Added 'Query Analytical Elements'
- Added 'Analytical Element Identity'
- Added 'Cluster Analytical Elements (Role)'
- Added 'Add Analytical Element'
- Added 'Add Model Element'
- Added 'Add Boundary Conditions (Point)'
- Added 'Add Boundary Conditions (Line)'
- Added 'Add Boundary Conditions (Area)'
- Added 'Boundary Conditions Settings'
- Added 'Query Boundary Conditions'
- Added 'Add Analytical Element'
- Added 'Add Model Element'
- Added 'Analytical Element Identity'
- Added 'Cluster Analytical Elements (Role)'
- Added 'Query Analytical Elements'

### RC

Expand Down
10 changes: 0 additions & 10 deletions src/RhinoInside.Revit.External/DB/BoundaryConditionsState.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/RhinoInside.Revit.GH/Components/Element/Parameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ internal static IGH_Goo AsGoo(this ARDB.Parameter parameter)
#if REVIT_2023
case ARDB.BuiltInParameter.ANALYTICAL_ELEMENT_STRUCTURAL_ROLE: return new Types.AnalyticalStructuralRole((ARDB.Structure.AnalyticalStructuralRole) integer);
#endif
case ARDB.BuiltInParameter.BOUNDARY_PARAM_PRESET: return new Types.BoundaryConditionsState((ARDB.Structure.BoundaryConditionsState) integer);
}

if (builtInParameter.IsColor())
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@ public AddAnalyticalMember() : base

const string _AnalyticalMember_ = "Analytical Member";

// static readonly ARDB.BuiltInParameter[] ExcludeUniqueProperties =
// {
//#if REVIT_2023
// ARDB.BuiltInParameter.STRUCTURAL_SECTION_SHAPE,
// ARDB.BuiltInParameter.STRUCTURAL_ANALYZES_AS,
// ARDB.BuiltInParameter.ANALYTICAL_ELEMENT_STRUCTURAL_ROLE,
// ARDB.BuiltInParameter.ANALYTICAL_MEMBER_ROTATION,
// ARDB.BuiltInParameter.ANALYTICAL_MEMBER_SECTION_TYPE
//#endif
// };

protected override void TrySolveInstance(IGH_DataAccess DA)
{
#if REVIT_2023
Expand Down Expand Up @@ -113,52 +102,5 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
);
#endif
}

//#if REVIT_2023
// bool Reuse
// (
// ARDB_AnalyticalMember analyticalMember,
// ARDB.Curve curve
// )
// {
// if (analyticalMember is null) return false;

// using (var loc = analyticalMember.GetCurve())
// {
// if (!loc.IsSameKindAs(curve))
// return false;

// if (!loc.AlmostEquals(curve, analyticalMember.Document.Application.VertexTolerance))
// analyticalMember.SetCurve(curve);
// }

// return true;
// }

// ARDB_AnalyticalMember Create(ARDB.Document doc, ARDB.Curve curve)
// {
// return ARDB_AnalyticalMember.Create(doc, curve);
// }

// protected ARDB_AnalyticalMember Reconstruct
// (
// ARDB_AnalyticalMember analyticalMember,
// ARDB.Document doc,
// ARDB.Curve curve
// )
// {
// if (!Reuse(analyticalMember, curve))
// {
// analyticalMember = analyticalMember.ReplaceElement
// (
// Create(doc, curve),
// ExcludeUniqueProperties
// );
// analyticalMember.Document.Regenerate();
// }

// return analyticalMember;
// }
//#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
face
);

DA.SetData(_BoundaryConditions_, boundaryConditions);
//DA.SetData(_BoundaryConditions_, new AreaBoundaryConditions(boundaryConditions));
DA.SetData(_BoundaryConditions_, new AreaBoundaryConditions(boundaryConditions));
return boundaryConditions;
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
curve
);

DA.SetData(_BoundaryConditions_, boundaryConditions);
//DA.SetData(_BoundaryConditions_, new LineBoundaryConditions(boundaryConditions));
DA.SetData(_BoundaryConditions_, new LineBoundaryConditions(boundaryConditions));
return boundaryConditions;
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
point
);

DA.SetData(_BoundaryConditions_, boundaryConditions);
//DA.SetData(_BoundaryConditions_, new PointBoundaryConditions(boundaryConditions));
DA.SetData(_BoundaryConditions_, new PointBoundaryConditions(boundaryConditions));
return boundaryConditions;
}
);
Expand Down
12 changes: 9 additions & 3 deletions src/RhinoInside.Revit.GH/Types/Element.Activator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ public static Element FromElement(ARDB.Element element)
}

break;

case ARDB.Structure.BoundaryConditions bConditions:
switch (bConditions.GetBoundaryConditionsType())
{
case ARDB.Structure.BoundaryConditionsType.Point: return new PointBoundaryConditions(bConditions);
case ARDB.Structure.BoundaryConditionsType.Line: return new LineBoundaryConditions(bConditions);
case ARDB.Structure.BoundaryConditionsType.Area: return new AreaBoundaryConditions(bConditions);
}
break;
}

// By Type
Expand Down Expand Up @@ -388,9 +397,6 @@ public static Element FromReference(ARDB.Document doc, ARDB.Reference reference)
{ typeof(ARDB.Structure.LineLoad), (element)=> new LineLoad (element as ARDB.Structure.LineLoad) },
{ typeof(ARDB.Structure.AreaLoad), (element)=> new AreaLoad (element as ARDB.Structure.AreaLoad) },
{ typeof(ARDB.Structure.BoundaryConditions), (element)=> new BoundaryConditions (element as ARDB.Structure.BoundaryConditions) },
//{ typeof(PointBoundaryConditions), (element)=> new PointBoundaryConditions (element as ARDB.Structure.BoundaryConditions) },
//{ typeof(LineBoundaryConditions), (element)=> new LineBoundaryConditions (element as ARDB.Structure.BoundaryConditions) },
//{ typeof(AreaBoundaryConditions), (element)=> new AreaBoundaryConditions (element as ARDB.Structure.BoundaryConditions) },
};
}
}
19 changes: 0 additions & 19 deletions src/RhinoInside.Revit.GH/Types/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -795,23 +795,4 @@ public BoundaryConditionsType(ARDB.Structure.BoundaryConditionsType value) : bas
{ (int) ARDB.Structure.BoundaryConditionsType.Area, "Area" },
};
}

[
ComponentVersion(introduced: "1.28"),
ComponentGuid("4244E344-8F5F-4DE7-9ED2-3F031EA91405"),
Name("Boundary Conditions State"),
Description("Represents boundary conditions state"),
]
public class BoundaryConditionsState : GH_Enum<ARDB.Structure.BoundaryConditionsState>
{
public BoundaryConditionsState() : base() { }
public BoundaryConditionsState(ARDB.Structure.BoundaryConditionsState value) : base(value) { }
public static new IReadOnlyDictionary<int, string> NamedValues { get; } = new Dictionary<int, string>
{
{ (int) ARDB.Structure.BoundaryConditionsState.Fixed, "Fixed" },
{ (int) ARDB.Structure.BoundaryConditionsState.Pinned, "Pinned" },
{ (int) ARDB.Structure.BoundaryConditionsState.Roller, "Roller" },
{ (int) ARDB.Structure.BoundaryConditionsState.User, "User" },
};
}
}
Loading
Loading