Setup and Debug - dd-bim/City2BIM GitHub Wiki
- Clone repository
- Check & Update repository
- Testing, Updating & Debugging
- Git-Commit, Git-Push- & Git-Merge (see GitLab)
This section briefly describes how to save the repository on your local machine.
What do we need?
- Text editor (Notepad++)
- Visual Studio (Community)
- Git (for Windows) (not needed, but also useful: Tortoise Git)
- (Autodesk Revit)
(If you allready worked with Visual Studio - skip to step XY):
-
Install Visual Studio (VS) (to a preferred location). While installation you can choose some packages. If you have already installed VS you can use the "Visual Studio Installer" to update or install some packages (if missing). What do we need?
- .NET Desktop Development (.NET-Desktopentwicklung)
- Go to tab: Individual components (Einzelnze Komponenten)
- .NET Framework 4.8 SDK
- .NET SDK
- Package for specifying target versions of .NET Framework 4.8
- Git for Windows
- NuGet Package Manager (NuGet-Paket-Manager)
- C# and Visual Basic Roslyn-Compiler
- MSBuild
- Just-in-Time-Debugger
- C#/XAML for HTML5
- GitHub Extension for Visual Studio
- Got to tab: Language Packages (Sprachpakete) - you can also add some prefered packages (englisch / german...)
Apply the "settings" via Change (Ändern). Note you can also add more (the packages listed above are only required for this project).
-
(Skip this step, if you )
-
Start "Visual Studio" on the right side there is a possibility "Clone a repository" through the context menu (header: "Get started").
Now go to the "main page" of the repository. The button "Code" hides the possibility to get the "git path". For "City2BIM-Repository" it should be: https://github.com/dd-bim/City2BIM.git. This one is need (as you can see in the picture above) to set the "Repository location".
If needed set the "Path" to a custom location (via "Browse" button).
After that you can start with "Clone"! --> The repository will be cloned right now (it may takes a moment).
-
Open the "GeospatialEngineeringBIM.sln".
If this error message appears. This can be confirmed with "OK".
The extent of the development environment can be read here: Link
In the solution explorer via "Solution 'GeospatialEngineeringBIM'" it is possible to build the whole solution (right mouse button -> build solution). You can also build specific projects via the solution explorer.
Normally there should be no more error messages. Via the following page common issues & solutions can be read: Link
In this section we want to give you some information about NuGet package manager. Via the "Solution Explorer" it is possible to start the NuGet package manager. Note: a package can be installed in different projects. It is not necessary to add the reference to the package to each project.
In general the four context menus can be used for:
- Browse -> Search & Add libraries
- Installed -> Overview of the installed libraries (here you can uninstall libs, if not needed anymore). As you can see in the picture above. The chosen library is only added to one project.
- Updates -> manage the different versions of the packages (Note: sometimes it may be necessary to make an update because there are security holes or similar -> this is represented by a yellow triangle with an exclamation mark, as shown in the picture above)
- Consolidate -> if you update a package in a specific project but it is also installed in the solution in another project (with another version) you can manage here the differences and update packages
In this section we want to give you a small introduction in how to: test software, update code and how to debug. This is just a very small overview to getting started.
Debugger this is the most important tool. By means of this tool you can see the "accompany the software" and value of variables or also check whether the program behaves as desired.
The debugger is to be used differently depending on the software product. Below some hints: In gernal start Visual Studio and open the GeospatialEngineeringBIM Solution. After that set the mode to Debug. Otherwise it is not possible to start with debugging!
For the first use of a debugger the usage of Visual Studio is recommended. For this purpose the project City2RVT (via RMB) should be selected in the Solution Explorer. In the Properties under "Build Events" at the Post-build event command line the following should be noted the following should be noted:
robocopy /XO $(TargetDir) $(ProgramData)\Autodesk\Revit\Addins\2021 /S exit 0
This command copies or exchanges the required *.dlls into the directory. (Note: Revit reads by default from this path! & If you use another version change the ending of the year to the correct date!)
In the next step you should change under the menu item: "Debug" the programm which
should be started. For this select Start external programm and choose the "Revit.exe"
via the "Browse..." button. (Default path: "C:\Program Files\Autodesk\Revit 2021\Revit.exe"
)
If you start debugging Autodesk Revit will also start. If you stop debugging or close Revit the debugging will end. Another way to use the debugger is to run Revit. As soon as you want to debug you can go to Visual Studio via the menu item Debug and the menu point Attatch to Process you can choose the Revit.exe-process. If you stop debugging Revit will not be stopped.
There are two possible ways to debug IfcTerrain Command:
-
[general] this means you can start debugging in visual studio. Set your break points in the code. Use the command line to set the file path (to the config).
-
[file specific] here you need a config and the corresponding file path to the config. In the next step go to the project properties. Here go on under the menu item: Debug in the "Command line arguments" text field and set the config file path. After that: you can start with debugging. IfcTerrain will read this config.
To debug the graphical user interface you should use Visual Studio. Go to the Solution Explorer and select via RMB the project IfcTerrainGUI and Set as Startup Project. Now you can use the GUI and as soon as a break point has been hitted. The programm will stop and jump to the breakpoint.