Conversation
| // Placing the new node to the left of initial node | ||
| var adjustedX = initialNode.X - 200; | ||
| dynamoViewModel.ExecuteCommand(new DynamoModel.CreateAndConnectNodeCommand(id, portModel.Owner.GUID, | ||
| nodeCreationName, 0, portModel.Index, adjustedX, adjustedY, false, false)); |
There was a problem hiding this comment.
Can we split this step into a CreateNodeCommand step and then add a new command called something like PlaceAndConnectCommand? That way we can first create the new node, get its height and width, and use the height and width to place it relative to the original node. In other words, the PlaceAndConnectCommand
will be a combination of 2 steps: 1) place the node based on a calculated X and Y position, and 2) call the
MakeConnectionCommand. This way we might be able to do away with these hard-coded values.
There was a problem hiding this comment.
@aparajit-pratap I did thought about that before implementation but the height and width for the new nodes are always default to 100 for node model so not really useful to get the actual height and width
There was a problem hiding this comment.

@aparajit-pratap This is what I am referring to. I already considered this solution before finalizing the PR. For now there isn't a way I can see we can get the actual height and width for the newly placed node.
There was a problem hiding this comment.
Another slightly less important reason is about undo/redo, the current implementation only requires one undo to get back to the previous state versus the split way will need to be done by two undos.
There was a problem hiding this comment.
I'm trying something else, will get back to you on this PR, I may commit directly to this PR if I can get something working.
There was a problem hiding this comment.
Indeed, placing any slider or any giant node will result in such problem but I dont see a way to be smarter yet..

Please Note:
DynamoRevitrepo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTMlabel is added to the PR.Purpose
Auto layout the newly created node from node auto complete.
Instead of the existing auto layout algorithm we are using for clean up layout which makes the initial node jumpy, I am simply putting the new node right next to the input port and arrange some Y offset based on inputport index.
Declarations
Check these if you believe they are true
*.resxfilesReviewers
@DynamoDS/dynamo
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of