Skip to content

Conversation

@johnpierson
Copy link
Member

@johnpierson johnpierson commented Oct 20, 2025

Purpose

This PR introduces a test node for model element selection in Dynamo Sandbox, following the same pattern as the Revit SelectElement node. The implementation provides a foundation for testing selection-based workflows without requiring a host application like Revit.

  • Adds TestSelectModelElement node implementing the SelectionBase pattern
  • Includes supporting UI customization and localized resource strings
  • Provides a mock selection helper that generates test element IDs

20251020-selectModelElement

Since this node is not visible in the library, here is the sample DYN (rename from txt to dyn):
Test Select Model Element.dyn.txt

Declarations

Check these if you believe they are true

Release Notes

N/A

Reviewers

@DynamoDS/synapse @DynamoDS/eidos

FYIs

@QilongTang @jnealb @avidit

Copilot AI review requested due to automatic review settings October 20, 2025 17:41
@github-actions github-actions bot changed the title Dyn 9670 DYN-: Dyn 9670 Oct 20, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9670

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a test node for model element selection in Dynamo Sandbox, following the same pattern as the Revit SelectElement node. The implementation provides a foundation for testing selection-based workflows without requiring a host application like Revit.

  • Adds TestSelectModelElement node implementing the SelectionBase pattern
  • Includes supporting UI customization and localized resource strings
  • Provides a mock selection helper that generates test element IDs

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
TestSelectModelElement.cs (CoreNodeModels) Core node implementation using SelectionBase pattern with mock selection behavior
TestSelectModelElementNodeViewCustomization.cs UI customization that leverages SelectionBaseNodeViewCustomization for element selection interface
Resources.resx Adds localized description and search tags for the new test node

public IEnumerable<string> RequestSelectionOfType(string message, SelectionType selectionType, SelectionObjectType objectType)
{
// For testing purposes, generate a mock element ID
var mockElementId = $"Element_{Guid.NewGuid().ToString("N")[..8]}";
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing XML documentation comment for the mockElementId variable. According to Dynamo Coding Standards, all public members and important local variables should have XML documentation comments explaining their purpose.

Copilot generated this review using guidance from repository custom instructions.
@johnpierson johnpierson changed the title DYN-: Dyn 9670 DYN-9670 - Add Mock Selection Node for UI Testing Oct 20, 2025
@zeusongit zeusongit requested a review from a team October 22, 2025 03:23
@BogdanZavu
Copy link
Contributor

So how will this help ?

@johnpierson
Copy link
Member Author

Since there are no other nodes in sandbox with buttons (aside from file path), this allows us to run an AGT test to see if the node view is loading. I think that could be helpful?

@BogdanZavu
Copy link
Contributor

Since there are no other nodes in sandbox with buttons (aside from file path), this allows us to run an AGT test to see if the node view is loading. I think that could be helpful?

Ok, makes sense.

@BogdanZavu
Copy link
Contributor

Can all this be added under the Tests section of Dynamo solution ? In the TestUINodes project maybe ? Or those won't be visible
LGTM! Nice to have this

@johnpierson johnpierson removed the request for review from a team October 23, 2025 14:14
@QilongTang
Copy link
Contributor

A bunch of PR checks failing so I updated this with master

@QilongTang
Copy link
Contributor

@johnpierson Please take another look since these PR checks are supposed to pass before we can merge

@QilongTang
Copy link
Contributor

@johnpierson Do you get the following error locally?
TestSelectModelElement.cs(32,18): error CS0534: 'TestSelectModelElement' does not implement inherited abstract member 'SelectionBase<string, string>.GetModelObjectFromIdentifer(string)' [/home/runner/work/Dynamo/Dynamo/Dynamo/src/Libraries/CoreNodeModels/CoreNodeModels.csproj]

@zeusongit
Copy link
Contributor

is this still 4.0?

@johnpierson johnpierson removed this from the 4.0 milestone Nov 3, 2025
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.

4 participants