From 7fb6505575eb26eb57e0b301cd98f62af8692398 Mon Sep 17 00:00:00 2001 From: gohb Date: Fri, 24 Oct 2025 04:28:31 -0700 Subject: [PATCH 1/4] Updated 'readme.md' partially with latest info --- README.md | 182 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 111 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index be61213482..4a9ed3c71c 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,106 @@ # Dynamo for Revit -**Dynamo for Revit** is a plugin for Revit and a library of [Dynamo](https://github.com/DynamoDS/Dynamo) Nodes. It's also often referred to as **DynamoRevit** or **D4R** for short. -**Dynamo for Revit** has different branches for different versions of Revit. For example, to run **Dynamo for Revit** on Revit 2016 you want the **Dynamo for Revit** 2016 branch. +**Dynamo for Revit** is a plugin for Revit and a library of [Dynamo](https://github.com/DynamoDS/Dynamo) nodes. It is also commonly referred to as **DynamoRevit** or **D4R**. + +**Dynamo for Revit** maintains separate branches for different Revit versions. For example, to run **Dynamo for Revit** on Revit 2016, use the **Dynamo for Revit** 2016 branch. ## How to build and use DynamoRevit -To use a locally built DynamoRevit plugin inside Revit, you'll need to do three things: -1. [Build DynamoRevit](#1-build-dynamorevit) -2. [Get or Build Dynamo Core](#2-get-or-build-dynamo-core) -3. [Associate DynamoRevit with DynamoCore](#3-associate-dynamorevit-with-dynamo-core) -4. [Create a Revit Addin](#4-create-a-revit-addin) +To use a locally built DynamoRevit plugin within Revit, complete the following steps: + +1. [Prerequisites](#prerequisites) +2. [Build DynamoRevit](#1-build-dynamorevit) +3. [Get or Build Dynamo Core](#2-get-or-build-dynamo-core) +4. [Associate DynamoRevit with DynamoCore](#3-associate-dynamorevit-with-dynamo-core) +5. [Create a Revit Addin](#4-create-a-revit-addin) + +### Prerequisites + +Ensure the following software is installed on your system: + +- **Revit**: Revit 2026 (.NET 8), Revit 2027 or later (.NET 10) +- **Visual Studio**: Visual Studio 2022 (17.8.0 or newer) +- **.NET SDK**: [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) for Windows x64 +- **.NET SDK**: [.NET 10 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) for Windows x64 ### 1. Build DynamoRevit -- Clone the DynamoRevit repository. -``` -git clone https://github.com/DynamoDS/DynamoRevit.git -``` -- Get the branch for the version of Revit you want to use. For the latest release of Revit or a preview release, master may be fine. Otherwise, run `git checkout Revit2019` or similar. -- Make sure you have the following installed on your computer: - - For Revit 2024 and older: [.Net Framework 4.8 SDK](https://dotnet.microsoft.com/download) - - For Revit 2025 and newer: [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) for Windows x64 -- Copy `RevitAPI.dll`&`RevitAPIUI.dll` to the folder `DynamoRevit\lib\Revit Preview Release\net48`, these 2 dlls are in the folder same with `Revit.exe` installed on your computer - (if you want to build other branch of DynamoRevit, but corresponding version of Revit is not installed locally, you can get these dlls from https://www.nuget.org/ ) -- Set the `RevitVersionNumber` environment variable to the Revit version you're building against (e.g. `2020`) either in the system environment or in the [user_locals.props](https://github.com/DynamoDS/DynamoRevit/blob/Revit2017/src/Config/user_local.props) file in your build folder. -- Open `DynamoRevit.All.sln` in Visual Studio, and select a build configuration (Debug | Release) - - For Revit 2025 and newer you need Visual Studio 2022 (17.8.0 or newer) +- Clone the DynamoRevit repository: + + > `git clone https://github.com/DynamoDS/DynamoRevit.git` + +- Check out the branch corresponding to your target Revit version: + + - For the latest Revit release: `git checkout master` + - For older Revit releases: `git checkout Revit2026` + +- Open `DynamoRevit.All.sln` in Visual Studio and select a build configuration: + + - Configuration: `Debug` or `Release` + - Platform: `NET80` (for Revit 2025 and later) + +- In `src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt`, change `MajorVersion` from `27` to `4` to match DynamoCore.dll version `4.0.0.xxxx`. This workaround is only needed for Revit 2027; post-Dynamo 4.0 versions will use the host-specified version. + + ```cs + int MajorVersion = 4; // Change from `27` + int MinorVersion = 0; + int BuildNumber = 0; + ``` + +- Configure `src/Config/user_local.props` by setting the `RevitVersionNumber` to match your installed Revit version (e.g., `2025` or `2026`). + + - If Revit is not installed or you need to override the default location, also specify a custom `REVITAPI` path in `user_local.props`. + +- Build `DynamoRevit` solution to produce the right version of `DynamoRevitDS.dll` (i.e. `4.0.0.xxxx` in this case). + +#### Revit API DLL Lookup Order + +The build process automatically locates Revit API DLLs in the following order: + +1. Custom `REVITAPI` path defined in `src/Config/user_local.props` (highest priority if set) +2. `$(SolutionDir)..\lib\Revit $(RevitVersionNumber)\net8.0` +3. `%ProgramFiles%\Autodesk\Revit Architecture $(RevitVersionNumber)` +4. `%ProgramFiles%\Autodesk\Revit $(RevitVersionNumber)` ### 2. Get or Build Dynamo Core -It's often helpful to build both DynamoRevit and Dynamo Core from source. To do that: +Building both DynamoRevit and DynamoCore from source is often beneficial for development. To build from source: + - Clone Dynamo Core from https://github.com/dynamods/dynamo -- Get the branch for the version of Dynamo that you want to use. For the latest release of Revit or a preview release, master is fine. Otherwise, run `git checkout RC2.2.0_master` or similar. -- Build Dynamo according to the instructions in the [README](https://github.com/DynamoDS/Dynamo/blob/master/README.md). +- Check out the branch for your target Dynamo version. For the latest Revit release or preview releases, use the `master` branch. For release candidate testing, select the appropriate branch (e.g., `RC4.0.0_master`). +- Build Dynamo following the instructions in the [README](https://github.com/DynamoDS/Dynamo/blob/master/README.md). -It's also possible to use the prebuilt Dynamo that ships with Revit, or to retrieve a particular Dynamo Core version from Nuget without building it yourself. These approaches need to be documented. +Alternatively, you can use the prebuilt Dynamo that ships with Revit or retrieve a specific Dynamo Core version from NuGet without building from source. Documentation for these approaches is pending. ### 3. Associate DynamoRevit with Dynamo Core -After DynamoRevit is built, you will notice that there is a `Dynamo.config` file in DynamoRevit\bin\AnyCPU\Debug[Or Release]. With this file you must specify which DynamoCore you want to run with the DynamoRevit build. +After building DynamoRevit, a `Dynamo.config` file will be generated at `DynamoRevit\bin\NET100\Debug\Dynamo.config` (or `Release`). This configuration file specifies which DynamoCore installation to use with your DynamoRevit build. + +For example, the following configuration: -For example, if you specify ```xml - + ``` -you will run DynamoRevit with the DynamoCore at `C:\Workspace\GitHub\Dynamo\bin\AnyCPU\Debug`. This is especially useful when you want to test the DynamoRevit built with different flavors of DynamoCore, or you are using RTF to test a built version of DynamoRevit. Rebuilding will overwrite this file, so you must replace the path each time you build. + +will configure DynamoRevit to use the DynamoCore located at `C:\my\repos\Dynamo\bin\AnyCPU\Debug`. This configuration is particularly useful for testing DynamoRevit with different DynamoCore versions or when using the Revit Test Framework (RTF) with a custom build. Note that rebuilding will overwrite this file, requiring you to update the path after each build. ### 4. Create a Revit Addin -Starting in Revit 2020, there is a version of DynamoCore and the DynamoRevit addin included in the Revit install folder. First, remove or delete the DynamoForRevit addin folder from the following location: `C:\Program Files\Autodesk\Revit 2020\AddIns` +Beginning with Revit 2020, DynamoCore and the DynamoRevit addin are included in the Revit installation folder. For development purposes, first remove or delete the DynamoForRevit addin folder from: `%ProgramFiles%\Autodesk\Revit 2020\AddIns` (or `%ProgramFiles%\Autodesk\Revit Preview Release\AddIns` for pre-RTM installation of Revit). -For development, you'll have to manually create an addin file that instructs Revit to load the plugin on startup. A DynamoRevit addin file looks like this: +For development, you must manually create an addin file that instructs Revit to load your custom plugin on startup. A `DynamoForRevit.addin` file should be structured as follows: ```xml Dynamo For Revit - "D:\DynamoRevit\bin\AnyCPU\Debug\Revit\DynamoRevitDS.dll" + "C:\my\repos\DynamoRevit\bin\NET100\Debug\Revit\DynamoRevitDS.dll" 8D83C886-B739-4ACD-A9DB-1BC78F315B2B Dynamo.Applications.DynamoRevitApp ADSK @@ -71,46 +109,49 @@ For development, you'll have to manually create an addin file that instructs Rev ``` -This .addin file should be placed in the following location: -- `ProgramData/Autodesk/Revit/Addins/` +Place this `DynamoForRevit.addin` file in the following location: -where `` is the version of Revit for which the addin is built. Notice that the `Assembly` tag points to the output folder of the **Dynamo for Revit** build you created in step 1. +- `%AppData%\Autodesk\Revit\Addins\` -Now you should be able to launch Revit and see the Dynamo and Dynamo Player icons on the Manage tab. If you experience issues, check the troubleshooting tips in the next section. +where `` corresponds to your target Revit version. Note that the `Assembly` tag must point to the output folder of the **Dynamo for Revit** build created in step 1. -### Build dynamo revit against a local version of Dynamo +After completing these steps, launch Revit to verify that the Dynamo and Dynamo Player icons appear on the Manage tab. If you encounter issues, refer to the troubleshooting section below. + +### Build DynamoRevit Against a Local Dynamo Version 1. Build Dynamo locally -2. Run the Dynamo nuget script (more info [here](https://github.com/DynamoDS/Dynamo/blob/master/tools/NuGet/README.md)) -```.\BuildPackages.bat "template-nuget" "...\GitHub\Dynamo\bin\AnyCPU\Release"``` -This will locally produce all the dynamo nugets. -3. In you Visual Studio editor, add/change the nuget sources to point to your local nuget folder (where the local nugets are). -![alt text](images/local_dynamo_nugets.png) +2. Execute the Dynamo NuGet script (detailed instructions [here](https://github.com/DynamoDS/Dynamo/blob/master/tools/NuGet/README.md)): + `.\BuildPackages.bat "template-nuget" "...\GitHub\Dynamo\bin\AnyCPU\Release"` + This command generates all Dynamo NuGet packages locally. +3. In Visual Studio, configure the NuGet package sources to reference your local NuGet folder containing the generated packages. + ![alt text](images/local_dynamo_nugets.png) ## Troubleshooting Build Issues -* If you see errors like: - - ```1> "C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\11.0\TextTransform.exe" -out AssemblySharedInfo.cs AssemblySharedInfo.tt - 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,1): error CS1519: Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration - 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,6): error CS1520: Compiling transformation: Method must have a return type - ``` - then you need to get rid of any white space in the last line of *DynamoRevit/src/AssemblyInfoGenerator/transform_all.tt*. It's also possible that *transform_all.bat* is looking for a text templating engine for a version of visual studio you do not have installed. +- If you encounter errors similar to: + + ```1> "C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\11.0\TextTransform.exe" -out AssemblySharedInfo.cs AssemblySharedInfo.tt + 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,1): error CS1519: Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration + 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,6): error CS1520: Compiling transformation: Method must have a return type + ``` -* If you see missing classes or namespaces from the Revit or Dynamo APIs, look at the environment variable values in [CS.props](https://github.com/DynamoDS/DynamoRevit/blob/Revit2017/src/Config/CS.props). These environment variables can be overwritten by providing correct path for Dynamo and Revit libraries in [user_locals.props](https://github.com/DynamoDS/DynamoRevit/blob/Revit2017/src/Config/user_local.props) + Remove any trailing whitespace from the last line of _DynamoRevit/src/AssemblyInfoGenerator/transform_all.tt_. This error may also occur if _transform_all.bat_ references a text templating engine for a Visual Studio version that is not installed on your system. -* If your addin is not appearing in Revit, try removing any old copies of the Dynamo.addin file from these locations: - - `Users//AppData/Roaming/Autodesk/Revit/Addins/` - - `ProgramFiles/Autodesk/Revit /AddIns` +- If you encounter missing classes or namespaces from the Revit or Dynamo APIs, review the environment variable values in [CS_SDK.props](https://github.com/DynamoDS/DynamoRevit/blob/master/src/Config/CS_SDK.props). These environment variables can be overridden by specifying the correct paths for Dynamo and Revit libraries in [user_local.props](https://github.com/DynamoDS/DynamoRevit/blob/master/src/Config/user_local.props). -* Revit 2020 and later do not use the DynamoVersionSelector by default, but it's still in the DynamoRevit build. If you'd like to try using it, you can create a Dynamo.addin file that looks like this: +- If your addin does not appear in Revit, remove any existing copies of the Dynamo.addin file from these locations: + + - `Users//AppData/Roaming/Autodesk/Revit/Addins/` + - `ProgramFiles/Autodesk/Revit /AddIns` + +- Revit 2020 and later versions do not use the DynamoVersionSelector by default, though it remains available in the DynamoRevit build. To use the DynamoVersionSelector, create a Dynamo.addin file with the following structure: ```xml Dynamo For Revit - "E:\MyGitPath\Dynamo\bin\AnyCPU\Debug\Revit_xxxx\DynamoRevitVersionSelector.dll" + "C:\my\repos\Dynamo\bin\AnyCPU\Debug\Revit_xxxx\DynamoRevitVersionSelector.dll" 8D83C886-B739-4ACD-A9DB-1BC78F315B2B Dynamo.Applications.VersionLoader ADSK @@ -121,33 +162,32 @@ This will locally produce all the dynamo nugets. ## Running DynamoRevit Tests with RevitTestFramework -(This documentation is a work in progress, still being assembled and verified from internal documents) -For more information, see https://github.com/DynamoDS/RevitTestFramework/blob/master/README.md +_Note: This documentation is currently under development and being compiled from internal sources._ +For comprehensive information, refer to https://github.com/DynamoDS/RevitTestFramework/blob/master/README.md ### Option 1: RevitTestFrameworkConsole.exe -A console application which allows running RTF without a user interface. If you'd like to learn more about the command line options for RTF, you can simply type "RevitTestFrameworkConsole -h". - -As an example, the following command: +This console application enables running RTF without a user interface. To view available command line options for RTF, execute "RevitTestFrameworkConsole -h". -```RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"C:\Program Files\Autodesk\Revit 2019\Revit.exe" --copyAddins --continuous``` +Example command: -will execute all tests in MyTest.dll located in C:\MyTestDir and place all results in MyTestResults.xml (in the same folder). It will use Revit 2019 as specified and will run all tests without shutting down Revit. +`RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"C:\Program Files\Autodesk\Revit 2019\Revit.exe" --copyAddins --continuous` -If you use dev package, another example: +This command executes all tests in MyTest.dll located in C:\MyTestDir and outputs results to MyTestResults.xml (in the same directory). It uses Revit 2019 as specified and runs all tests continuously without shutting down Revit. -```RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"D:\Revit\Revit.exe" --continuous``` +For development packages, use this alternative example: -You specified a non-normally installed Revit.exe, you do not need to add the '--copyAddins' parameter. You need to manually copy a Dynamo.addin file to your working directory 'C:\MyTestDir'. +`RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"D:\Revit\Revit.exe" --continuous` -### Option 2: RevitTestFrameworkGUI.exe (This only supports Revit install build) +When specifying a non-standard Revit.exe installation path, the '--copyAddins' parameter is not required. However, you must manually copy a Dynamo.addin file to your working directory 'C:\MyTestDir'. -Provides a visual interface for you to choose tests from a treeview and to visualize the results of the tests as they are run. The same settings provided in the command line argument help above are available in the UI. The UI also allows you to save your testing session. +### Option 2: RevitTestFrameworkGUI.exe (Supports Revit Installation Builds Only) -The input fields to set the test assembly, the working directory, and the results file, as well as the tree view where available tests are displayed, support dragging and dropping of files and folders. +This tool provides a visual interface for selecting tests from a tree view and monitoring test execution results in real-time. All settings available through command line arguments are accessible in the UI, and the interface supports saving testing sessions. -- *Test Assembly* is your dll to test. -- *Working Directory* is the folder contains your test Revit file and dyn file like Empty.rvt and D4RCreateWallSystemTests.dyn. -- *Additional Resolution Directories* are the DynamoCore and DynamoRevit locations you want to use to run the test (Do they need to match what's in the Dynamo.addin file?) -- *Revit 2020* you can choose which Revit version you want to use in this DropDown List. (Only installed versions of Revit.) +The input fields for test assembly, working directory, and results file, along with the test tree view, support drag-and-drop functionality for files and folders. +- **Test Assembly**: The DLL containing your tests +- **Working Directory**: The folder containing test Revit files and Dynamo files (e.g., Empty.rvt and D4RCreateWallSystemTests.dyn) +- **Additional Resolution Directories**: The DynamoCore and DynamoRevit locations for test execution (these should correspond to your Dynamo.addin file configuration) +- **Revit Version**: Select your target Revit version from the dropdown (displays only installed Revit versions) From 2115034c755298e31922539b3afe957c9fa060e5 Mon Sep 17 00:00:00 2001 From: gohb Date: Sun, 26 Oct 2025 22:26:29 -0700 Subject: [PATCH 2/4] Refined 'readme.md' details --- README.md | 105 +++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 4a9ed3c71c..e6f01709ef 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Ensure the following software is installed on your system: - Open `DynamoRevit.All.sln` in Visual Studio and select a build configuration: - Configuration: `Debug` or `Release` - - Platform: `NET80` (for Revit 2025 and later) + - Platform: `NET80` (or `NET100` for Revit 2027 and later) - In `src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt`, change `MajorVersion` from `27` to `4` to match DynamoCore.dll version `4.0.0.xxxx`. This workaround is only needed for Revit 2027; post-Dynamo 4.0 versions will use the host-specified version. @@ -47,20 +47,26 @@ Ensure the following software is installed on your system: int BuildNumber = 0; ``` -- Configure `src/Config/user_local.props` by setting the `RevitVersionNumber` to match your installed Revit version (e.g., `2025` or `2026`). +- (Optional) Set the `RevitVersionNumber` environment variable to the Revit version you're building against (e.g., `2025`, `2026`, `2027`). If not set, it defaults to `"Preview Release"`. - - If Revit is not installed or you need to override the default location, also specify a custom `REVITAPI` path in `user_local.props`. +- If Revit is not installed locally or you need to use a specific version, copy `RevitAPI.dll` & `RevitAPIUI.dll` to the appropriate folder based on your build platform. These DLLs are located in the same folder as `Revit.exe` on your computer: -- Build `DynamoRevit` solution to produce the right version of `DynamoRevitDS.dll` (i.e. `4.0.0.xxxx` in this case). + - `DynamoRevit\lib\Revit Preview Release\net8.0` (for NET80 builds), OR + - `DynamoRevit\lib\Revit Preview Release\net10.0` (for NET100 builds) -#### Revit API DLL Lookup Order + - If you want to build other branches of DynamoRevit but the corresponding version of Revit is not installed locally, you can get these DLLs from [NuGet](https://www.nuget.org/). -The build process automatically locates Revit API DLLs in the following order: + > **Revit API DLL Lookup Order** + > + > The build process automatically locates Revit API DLLs in the following order: + > + > 1. Custom `REVITAPI` paths defined in `src/Config/user_local.props` (highest priority if set) + > 2. `$(SolutionDir)..\lib\Revit $(RevitVersionNumber)\net8.0` (or `net10.0`) + > 3. `C:\Program Files\Autodesk\Revit Architecture $(RevitVersionNumber)` + > 4. `C:\Program Files\Autodesk\Revit $(RevitVersionNumber)` + > 5. `C:\Program Files\Autodesk\Revit Preview Release` -1. Custom `REVITAPI` path defined in `src/Config/user_local.props` (highest priority if set) -2. `$(SolutionDir)..\lib\Revit $(RevitVersionNumber)\net8.0` -3. `%ProgramFiles%\Autodesk\Revit Architecture $(RevitVersionNumber)` -4. `%ProgramFiles%\Autodesk\Revit $(RevitVersionNumber)` +- Build `DynamoRevit` solution to produce the right version of `DynamoRevitDS.dll` (i.e. `4.0.0.xxxx` in this case). ### 2. Get or Build Dynamo Core @@ -91,7 +97,7 @@ will configure DynamoRevit to use the DynamoCore located at `C:\my\repos\Dynamo\ ### 4. Create a Revit Addin -Beginning with Revit 2020, DynamoCore and the DynamoRevit addin are included in the Revit installation folder. For development purposes, first remove or delete the DynamoForRevit addin folder from: `%ProgramFiles%\Autodesk\Revit 2020\AddIns` (or `%ProgramFiles%\Autodesk\Revit Preview Release\AddIns` for pre-RTM installation of Revit). +Beginning with Revit 2020, DynamoCore and the DynamoRevit addin are included in the Revit installation folder. For development purposes, first remove or delete the DynamoForRevit addin folder from: `%ProgramFiles%\Autodesk\Revit 2026\AddIns`. For development, you must manually create an addin file that instructs Revit to load your custom plugin on startup. A `DynamoForRevit.addin` file should be structured as follows: @@ -117,77 +123,70 @@ where `` corresponds to your target Revit version. Note that the `Assem After completing these steps, launch Revit to verify that the Dynamo and Dynamo Player icons appear on the Manage tab. If you encounter issues, refer to the troubleshooting section below. -### Build DynamoRevit Against a Local Dynamo Version +### Build dynamo revit against a local version of Dynamo 1. Build Dynamo locally -2. Execute the Dynamo NuGet script (detailed instructions [here](https://github.com/DynamoDS/Dynamo/blob/master/tools/NuGet/README.md)): - `.\BuildPackages.bat "template-nuget" "...\GitHub\Dynamo\bin\AnyCPU\Release"` - This command generates all Dynamo NuGet packages locally. -3. In Visual Studio, configure the NuGet package sources to reference your local NuGet folder containing the generated packages. - ![alt text](images/local_dynamo_nugets.png) +2. Run the Dynamo nuget script (more info [here](https://github.com/DynamoDS/Dynamo/blob/master/tools/NuGet/README.md)) +```.\BuildPackages.bat "template-nuget" "...\GitHub\Dynamo\bin\AnyCPU\Release"``` +This will locally produce all the dynamo nugets. +3. In you Visual Studio editor, add/change the nuget sources to point to your local nuget folder (where the local nugets are). +![alt text](images/local_dynamo_nugets.png) ## Troubleshooting Build Issues -- If you encounter errors similar to: - - ```1> "C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\11.0\TextTransform.exe" -out AssemblySharedInfo.cs AssemblySharedInfo.tt - 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,1): error CS1519: Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration - 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,6): error CS1520: Compiling transformation: Method must have a return type - ``` - - Remove any trailing whitespace from the last line of _DynamoRevit/src/AssemblyInfoGenerator/transform_all.tt_. This error may also occur if _transform_all.bat_ references a text templating engine for a Visual Studio version that is not installed on your system. - -- If you encounter missing classes or namespaces from the Revit or Dynamo APIs, review the environment variable values in [CS_SDK.props](https://github.com/DynamoDS/DynamoRevit/blob/master/src/Config/CS_SDK.props). These environment variables can be overridden by specifying the correct paths for Dynamo and Revit libraries in [user_local.props](https://github.com/DynamoDS/DynamoRevit/blob/master/src/Config/user_local.props). +* If you see errors like: -- If your addin does not appear in Revit, remove any existing copies of the Dynamo.addin file from these locations: + ```1> "C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\11.0\TextTransform.exe" -out AssemblySharedInfo.cs AssemblySharedInfo.tt + 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,1): error CS1519: Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration + 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,6): error CS1520: Compiling transformation: Method must have a return type + ``` + then you need to get rid of any white space in the last line of *DynamoRevit/src/AssemblyInfoGenerator/transform_all.tt*. It's also possible that *transform_all.bat* is looking for a text templating engine for a version of visual studio you do not have installed. - - `Users//AppData/Roaming/Autodesk/Revit/Addins/` - - `ProgramFiles/Autodesk/Revit /AddIns` +* If you see missing classes or namespaces from the Revit or Dynamo APIs, look at the environment variable values in [CS.props](https://github.com/DynamoDS/DynamoRevit/blob/Revit2017/src/Config/CS.props). These environment variables can be overwritten by providing correct path for Dynamo and Revit libraries in [user_locals.props](https://github.com/DynamoDS/DynamoRevit/blob/Revit2017/src/Config/user_local.props) -- Revit 2020 and later versions do not use the DynamoVersionSelector by default, though it remains available in the DynamoRevit build. To use the DynamoVersionSelector, create a Dynamo.addin file with the following structure: +* If your addin is not appearing in Revit, try removing any old copies of the Dynamo.addin file from these locations: + - `Users//AppData/Roaming/Autodesk/Revit/Addins/` + - `ProgramFiles/Autodesk/Revit /AddIns` +* Revit 2020 and later do not use the DynamoVersionSelector by default, but it's still in the DynamoRevit build. If you'd like to try using it, you can create a Dynamo.addin file that looks like this: ```xml Dynamo For Revit - "C:\my\repos\Dynamo\bin\AnyCPU\Debug\Revit_xxxx\DynamoRevitVersionSelector.dll" + "E:\MyGitPath\Dynamo\bin\AnyCPU\Debug\Revit_xxxx\DynamoRevitVersionSelector.dll" 8D83C886-B739-4ACD-A9DB-1BC78F315B2B Dynamo.Applications.VersionLoader ADSK - Dynamo - - -``` + @@ -121,33 +162,32 @@ This will locally produce all the dynamo nugets. ## Running DynamoRevit Tests with RevitTestFramework -_Note: This documentation is currently under development and being compiled from internal sources._ -For comprehensive information, refer to https://github.com/DynamoDS/RevitTestFramework/blob/master/README.md - +(This documentation is a work in progress, still being assembled and verified from internal documents) +For more information, see https://github.com/DynamoDS/RevitTestFramework/blob/master/README.md ### Option 1: RevitTestFrameworkConsole.exe -This console application enables running RTF without a user interface. To view available command line options for RTF, execute "RevitTestFrameworkConsole -h". +A console application which allows running RTF without a user interface. If you'd like to learn more about the command line options for RTF, you can simply type "RevitTestFrameworkConsole -h". -Example command: +As an example, the following command: -`RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"C:\Program Files\Autodesk\Revit 2019\Revit.exe" --copyAddins --continuous` +```RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"C:\Program Files\Autodesk\Revit 2019\Revit.exe" --copyAddins --continuous``` -This command executes all tests in MyTest.dll located in C:\MyTestDir and outputs results to MyTestResults.xml (in the same directory). It uses Revit 2019 as specified and runs all tests continuously without shutting down Revit. +will execute all tests in MyTest.dll located in C:\MyTestDir and place all results in MyTestResults.xml (in the same folder). It will use Revit 2019 as specified and will run all tests without shutting down Revit. -For development packages, use this alternative example: +If you use dev package, another example: -`RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"D:\Revit\Revit.exe" --continuous` +```RevitTestFrameworkConsole.exe --dir [DynamoRevit dev root]\test\System -a [DynamoRevit dev root]\bin\AnyCPU\Debug\Revit\RevitSystemTests.dll -r MyTestResults.xml -revit:"D:\Revit\Revit.exe" --continuous``` -When specifying a non-standard Revit.exe installation path, the '--copyAddins' parameter is not required. However, you must manually copy a Dynamo.addin file to your working directory 'C:\MyTestDir'. +You specified a non-normally installed Revit.exe, you do not need to add the '--copyAddins' parameter. You need to manually copy a Dynamo.addin file to your working directory 'C:\MyTestDir'. -### Option 2: RevitTestFrameworkGUI.exe (Supports Revit Installation Builds Only) +### Option 2: RevitTestFrameworkGUI.exe (This only supports Revit install build) -This tool provides a visual interface for selecting tests from a tree view and monitoring test execution results in real-time. All settings available through command line arguments are accessible in the UI, and the interface supports saving testing sessions. +Provides a visual interface for you to choose tests from a treeview and to visualize the results of the tests as they are run. The same settings provided in the command line argument help above are available in the UI. The UI also allows you to save your testing session. -The input fields for test assembly, working directory, and results file, along with the test tree view, support drag-and-drop functionality for files and folders. +The input fields to set the test assembly, the working directory, and the results file, as well as the tree view where available tests are displayed, support dragging and dropping of files and folders. -- **Test Assembly**: The DLL containing your tests -- **Working Directory**: The folder containing test Revit files and Dynamo files (e.g., Empty.rvt and D4RCreateWallSystemTests.dyn) -- **Additional Resolution Directories**: The DynamoCore and DynamoRevit locations for test execution (these should correspond to your Dynamo.addin file configuration) -- **Revit Version**: Select your target Revit version from the dropdown (displays only installed Revit versions) +- *Test Assembly* is your dll to test. +- *Working Directory* is the folder contains your test Revit file and dyn file like Empty.rvt and D4RCreateWallSystemTests.dyn. +- *Additional Resolution Directories* are the DynamoCore and DynamoRevit locations you want to use to run the test (Do they need to match what's in the Dynamo.addin file?) +- *Revit 2020* you can choose which Revit version you want to use in this DropDown List. (Only installed versions of Revit.) From fae25feef46e8bd010b35fa4d472c051c3ee6e47 Mon Sep 17 00:00:00 2001 From: gohb Date: Sun, 26 Oct 2025 22:31:52 -0700 Subject: [PATCH 3/4] Refined 'readme.md' details --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6f01709ef..5402611fae 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ This will locally produce all the dynamo nugets. ## Troubleshooting Build Issues * If you see errors like: - + ```1> "C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\11.0\TextTransform.exe" -out AssemblySharedInfo.cs AssemblySharedInfo.tt 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,1): error CS1519: Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration 1>c:\Users\bykovsm\AppData\Local\Temp\AssemblySharedInfo.tt(1,6): error CS1520: Compiling transformation: Method must have a return type @@ -147,6 +147,7 @@ This will locally produce all the dynamo nugets. * If your addin is not appearing in Revit, try removing any old copies of the Dynamo.addin file from these locations: - `Users//AppData/Roaming/Autodesk/Revit/Addins/` - `ProgramFiles/Autodesk/Revit /AddIns` + * Revit 2020 and later do not use the DynamoVersionSelector by default, but it's still in the DynamoRevit build. If you'd like to try using it, you can create a Dynamo.addin file that looks like this: ```xml @@ -158,12 +159,16 @@ This will locally produce all the dynamo nugets. 8D83C886-B739-4ACD-A9DB-1BC78F315B2B Dynamo.Applications.VersionLoader ADSK - @@ -121,33 +162,32 @@ This will locally produce all the dynamo nugets. + Dynamo + + +``` ## Running DynamoRevit Tests with RevitTestFramework (This documentation is a work in progress, still being assembled and verified from internal documents) For more information, see https://github.com/DynamoDS/RevitTestFramework/blob/master/README.md + ### Option 1: RevitTestFrameworkConsole.exe A console application which allows running RTF without a user interface. If you'd like to learn more about the command line options for RTF, you can simply type "RevitTestFrameworkConsole -h". @@ -190,3 +195,4 @@ The input fields to set the test assembly, the working directory, and the result - *Working Directory* is the folder contains your test Revit file and dyn file like Empty.rvt and D4RCreateWallSystemTests.dyn. - *Additional Resolution Directories* are the DynamoCore and DynamoRevit locations you want to use to run the test (Do they need to match what's in the Dynamo.addin file?) - *Revit 2020* you can choose which Revit version you want to use in this DropDown List. (Only installed versions of Revit.) + From bba35e0df99ecce9069b8ca4b0047fdef3661c9f Mon Sep 17 00:00:00 2001 From: Ben Goh Date: Tue, 28 Oct 2025 22:51:14 -0700 Subject: [PATCH 4/4] Removed notes about 'AssemblySharedInfo' --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index 5402611fae..cc408d592a 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,6 @@ Ensure the following software is installed on your system: - Configuration: `Debug` or `Release` - Platform: `NET80` (or `NET100` for Revit 2027 and later) -- In `src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt`, change `MajorVersion` from `27` to `4` to match DynamoCore.dll version `4.0.0.xxxx`. This workaround is only needed for Revit 2027; post-Dynamo 4.0 versions will use the host-specified version. - - ```cs - int MajorVersion = 4; // Change from `27` - int MinorVersion = 0; - int BuildNumber = 0; - ``` - - (Optional) Set the `RevitVersionNumber` environment variable to the Revit version you're building against (e.g., `2025`, `2026`, `2027`). If not set, it defaults to `"Preview Release"`. - If Revit is not installed locally or you need to use a specific version, copy `RevitAPI.dll` & `RevitAPIUI.dll` to the appropriate folder based on your build platform. These DLLs are located in the same folder as `Revit.exe` on your computer: