-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-9348 Revit Package Path Fix #16460
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
DYN-9348 Revit Package Path Fix #16460
Conversation
Considering that we are using DynamoCore 3.6.0 and DynamoRevit 3.4.0 previously when installing a package in Dynamo for Revit was installing the package in the path created using DynamoCore version (e.g. C:\Users\user\AppData\Roaming\Dynamo\Dynamo Revit\3.6) but after this change now is using the DynamoRevit version path (e.g. C:\Users\user\AppData\Roaming\Dynamo\Dynamo Revit\3.4\packages).
There was a problem hiding this 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-9348
There was a problem hiding this 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 fixes the package installation path for Dynamo Revit to use the correct DynamoRevit version instead of the DynamoCore version. The change ensures packages are installed in the appropriate version-specific directory (e.g., 3.4 instead of 3.6).
- Introduces a static
HostInfoclass to store and access the host version globally - Modifies the PathManager to use the host version for package path construction in Dynamo Revit scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/DynamoCore/Models/DynamoModel.cs | Adds static HostInfo class and populates it with host version during model initialization |
| src/DynamoCore/Configuration/PathManager.cs | Updates PathManager to use HostInfo.HostVersion for package path calculation when available |
| /// Contains the HostVersion inside a static class so that it can be accessed in other parts of the code without creating an instance. | ||
| /// </summary> | ||
| public static class HostInfo | ||
| { |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HostVersion field should have XML documentation explaining its purpose, when it's set, and what it represents in different hosting scenarios.
| { | |
| { | |
| /// <summary> | |
| /// Represents the version of the host application in which Dynamo is running. | |
| /// This field is set during Dynamo initialization by the host (e.g., Revit, Civil 3D, or standalone). | |
| /// In different hosting scenarios, this value reflects the version of the host product: | |
| /// - In Dynamo Revit, it is set to the Revit version (e.g., 2025.2.0). | |
| /// - In standalone Dynamo, it may be set to the Dynamo version itself. | |
| /// Consumers should check this value to determine host-specific behaviors or compatibility. | |
| /// </summary> |
|
|
||
| BuildHostDirectories(pathManagerParams.HostPath); | ||
|
|
||
| //In the case of Dynamo for Revit HostInfo.HostVersion will contain the DynamoRevit version so we will use this values for installing packages in the right location |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: 'this values' should be 'these values' in the comment.
| //In the case of Dynamo for Revit HostInfo.HostVersion will contain the DynamoRevit version so we will use this values for installing packages in the right location | |
| //In the case of Dynamo for Revit HostInfo.HostVersion will contain the DynamoRevit version so we will use these values for installing packages in the right location |
| if (HostInfo.HostVersion != null) | ||
| { | ||
| pathManagerParams.MajorFileVersion = HostInfo.HostVersion.Major; | ||
| pathManagerParams.MinorFileVersion = HostInfo.HostVersion.Minor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I guess these are considered overwriting of PathManager default behavior right? Would you point me, where are these two params used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If with default behavior you are talking about DynamoSandbox, I already tested and is installing the packages in the right path (e.g. if DynamoCore is 3.6.0 then is installed in C:\Users\user\AppData\Roaming\Dynamo\Dynamo Core\3.6).
We are using majorFileVersion and minorFileVersion inside PathManager in the next code:
| return Path.Combine(folder, |
And is used for building the userDataDir that later is used for building the packages dir in the next code:
| commonPackages = Path.Combine(commonDataDir, PackagesDirectoryName); |
Also found that for creating the PathManager instance we are using a lazy loading Singleton with parameters in the constructor but we are passing the parameters only in test mode so not used in Revit, then the only way that I found to get the Version was by using a static class.
Also not sure how we are going to test this change due that I had to use Dynamo RC3.6.0_master branch with DynamoRevit master branch to test in Revit Preview Release 2027, if I use the latest Dynamo master branch (the base of my branch) then Dynamo is not opening in Revit.
Updating comments suggested by Copilot
|
@QilongTang @zeusongit |
| /// <summary> | ||
| /// Contains the HostVersion inside a static class so that it can be accessed in other parts of the code without creating an instance. | ||
| /// </summary> | ||
| public static class HostInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For host name/version, we should use the one in DynamoModel.HostAnalyticsInfo instead of exposing it directly on the model. Any reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reddyashish the reason is due that we need to use the host name/version inside the PathManager class (which is a lazy loading Singleton), then PathManager doesn't have access to DynamoModel.HostAnalyticsInfo and the only way that I found for accessing the host name/version in the singleton (and avoiding altering the structure) was by using a public static class.
|
@QilongTang Any update from the D4R side that will affect this? Can we merge and test? |
Sorry I should comment way earlier, I am a bit skeptical the |
GitHub Copilot is suggesting the next alternatives:
I will check the options 1 and 2 since are the recommended, 4 is similar like I implemented |
|
closed due that we are already working in a different implementation, see #16528 |



Purpose
Considering that we are using DynamoCore 3.6.0 and DynamoRevit 3.4.0, previously when installing a package in Dynamo for Revit was installing the package in the path created using DynamoCore version (e.g. C:\Users\user\AppData\Roaming\Dynamo\Dynamo Revit\3.6) but after this change now is using the DynamoRevit version path (e.g. C:\Users\user\AppData\Roaming\Dynamo\Dynamo Revit\3.4\packages).
Note: This fix is only for Dynamo for Revit
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Changing the package path installation for Dynamo Revit to use the DynamoRevit version (instead of DynamoCore version)
Reviewers
@QilongTang
FYIs
@zeusongit