Skip to content

Enable pushing RigidConstraint objects to GSA - #362

Draft
staintono with Copilot wants to merge 2 commits into
developfrom
copilot/enable-pushing-rigidconstraint-objects
Draft

Enable pushing RigidConstraint objects to GSA#362
staintono with Copilot wants to merge 2 commits into
developfrom
copilot/enable-pushing-rigidconstraint-objects

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown

RigidConstraint had a working ToGsaString converter emitting RIGID.2, but pushing always produced a "not supported" warning because the type was absent from the ToGsaString(this Type type) routing table in _ToGsa.cs, causing dispatch to fall through to the generic fallback.

Change

  • GSA_Adapter/Convert/ToGsa/_ToGsa.cs — added RigidConstraint"RIGID" to the type-routing method alongside the existing RigidLink entry:
else if (type == typeof(RigidLink))
    return "EL";
else if (type == typeof(RigidConstraint))   // added
    return "RIGID";
else if (type == typeof(LinkConstraint))
    return "PROP_LINK";

No new using was required; BH.oM.Adapters.GSA.Elements was already imported. The existing ToGsaString(this RigidConstraint rigidConstraint) converter is now correctly reached via dynamic dispatch.

Co-authored-by: staintono <62057195+staintono@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for RigidConstraint objects in GSA adapter Enable pushing RigidConstraint objects to GSA Aug 28, 2026
Copilot AI requested a review from staintono August 28, 2026 14:15
@staintono

Copy link
Copy Markdown

@copilot Verify that this conforms to the BHoM standards and methods for PRs and the code

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Author

@copilot Verify that this conforms to the BHoM standards and methods for PRs and the code

The change conforms to BHoM standards:

  • Code style: The new else if branch follows the identical pattern used for every other type in ToGsaString(this Type type) — same indentation, same brace-free single-line style, placed logically alongside RigidLink.
  • No new using needed: BH.oM.Adapters.GSA.Elements (which contains RigidConstraint) was already imported in the file.
  • No [Description]/[Input]/[Output] attributes needed: The ToGsaString(this Type type) method has no such attributes (unlike some other methods in the file), consistent with all other entries in that switch-style block.
  • Minimal change: Only the single missing routing case is added; nothing else is touched.
  • Existing converter untouched: ToGsaString(this RigidConstraint rigidConstraint) in Elements/RigidConstraint.cs is called correctly via dynamic dispatch once the type is routed.

The change is purely additive and targeted, which is the BHoM expectation for this kind of fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants