Skip to content

Conversation

@alfarok
Copy link
Contributor

@alfarok alfarok commented Aug 28, 2017

Purpose

QNTM-1284

The purpose of this PR is to enable the serialization and deserialization of Revit element selection nodes in Json. Previously Revit/Dynamo would freeze when attempting save a graph containing Revit selection nodes and the Json file is never written. The selection node should also maintain the Revit element id that is referenced so it will automatically be recognized when reopening a graph.

Supplemental to Dynamo PR #8131

giphy

All RTF selection tests are passing including new tests:
rtf_tests_upload

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.

Reviewers

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

FYIs

"Select a face.",
"Face of Element Id") { }

[JsonConstructor]
Copy link
Member

Choose a reason for hiding this comment

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

so you'll need to add these for all derived selection types right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I believe so, I only did this first one as an example so far. I am still figuring out why I can't modify the selection once reopening the json file before I add them all.

@alfarok alfarok changed the title [WIP] Revit element selection nodes should serialize and deserialize properly in Json Revit element selection nodes should serialize and deserialize properly in Json Aug 31, 2017
@alfarok alfarok added PTAL and removed WIP labels Aug 31, 2017
[Category("SmokeTests")]
[TestModel(@".\Selection\Selection.rfa")]
public void SelectionVerifyElementID()
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test:

  • opens an xml graph w/ a model element selection node
  • verifies the selectionId and node UUID
  • saves to temporary json file
  • closes and reopens the graph
  • verifies data remains unchanged after execution
  • deletes temporary json file

@smangarole

@alfarok
Copy link
Contributor Author

alfarok commented Sep 5, 2017

LGTM from @mjkkirschner

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

Labels

LGTM Lets Get This Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants