|
1 |
| -Revit Toolkit |
| 1 | +Revit(less) Toolkit |
2 | 2 | =============
|
3 | 3 |
|
4 |
| -A cross-platform toolkit for processing .rfa, .rvt etc without Revit |
| 4 | +A cross-platform **Revit-less** toolkit for processing .rfa, .rvt and other files without [Revit](https://en.wikipedia.org/wiki/Autodesk_Revit) |
5 | 5 |
|
6 |
| -[](http://www.revitapidocs.com/2017/) |
7 |
| -[](https://www.nuget.org/packages/CodeCave.Revit.Toolkit/) |
| 6 | +[](http://www.revitapidocs.com/2017/) |
| 7 | +[](https://www.nuget.org/packages/CodeCave.Revit.Toolkit/) |
| 8 | +[](https://github.com/CodeCavePro/revit-toolkit/blob/master/LICENSE.txt) |
8 | 9 | [](https://www.nuget.org/packages/CodeCave.Revit.Toolkit/)
|
9 | 10 | [](https://github.com/CodeCavePro/revit-toolkit/releases)
|
10 |
| -[](https://github.com/CodeCavePro/revit-toolkit/blob/master/LICENSE.txt) |
11 | 11 |
|
12 | 12 | [](https://ci.appveyor.com/project/salaros/revit-toolkit/history)
|
13 |
| -[]() |
14 |
| -[]() |
| 13 | +[](https://ci.appveyor.com/project/salaros/revit-toolkit/build/tests) |
15 | 14 | [](http://revit-toolkit.readthedocs.io/en/latest/)
|
| 15 | + |
| 16 | +Installation |
| 17 | +============ |
| 18 | + |
| 19 | +**Revit Toolkit** can be installed via [NuGet](https://www.nuget.org/packages?q=CodeCave.Revit) |
| 20 | +by using Package Manager in your IDE, `dotnet` binary or Package Console |
| 21 | + |
| 22 | +```bash |
| 23 | +# Add the CodeCave.Revit package to a project named [<PROJECT>] |
| 24 | +dotnet add [<PROJECT>] package CodeCave.Revit |
| 25 | +``` |
| 26 | + |
| 27 | +or Visual Studio's Package Console |
| 28 | + |
| 29 | +```powershell |
| 30 | +# Add the CodeCave.Revit package to the default project |
| 31 | +Install-Package CodeCave.Revit |
| 32 | +
|
| 33 | +# Add the CodeCave.Revit package to a project named [<PROJECT>] |
| 34 | +Install-Package Elmah -ProjectName [<PROJECT>] |
| 35 | +``` |
| 36 | + |
| 37 | +Usage |
| 38 | +===== |
| 39 | + |
| 40 | +**Revit Toolkit** provides various tools, you can easily find the full list by browsing the [documentation](http://revit-toolkit.readthedocs.io/en/latest/). |
| 41 | + |
| 42 | +## Shared parameter file |
| 43 | + |
| 44 | +```cs |
| 45 | +var sharedParamFile = new SharedParameterFile(@"path/to/shared/parameter/file.txt"); |
| 46 | + |
| 47 | +// alternatively you can supply the content of the file |
| 48 | +var sharedParamFile = new SharedParameterFile(File.ReadAllText(@"path/to/file.txt")); |
| 49 | + |
| 50 | +// .. or you can create a completely new (empty) shared file |
| 51 | +var sharedParamFile = new SharedParameterFile(); |
| 52 | + |
| 53 | +// .. or with some empty (with no parameters assigned yet) groups |
| 54 | +var sharedParamFile = new SharedParameterFile(new Dictionary<string,int> { { "Identity Data", 100 } } ); |
| 55 | + |
| 56 | +sharedParamFile.Parameters.Add( |
| 57 | + new Guid("61ff3d56-09d7-4049-8c78-4abe745e4e5a"),"EquipmentName", |
| 58 | + "Identity Data", // Referencing group by name |
| 59 | + ParameterType.Text |
| 60 | +); |
| 61 | + |
| 62 | +sharedParamFile.Parameters.Add( |
| 63 | + new Guid("b5a53ea4-55d9-497c-8488-6607faa11e5f"), "EquipmentServed", |
| 64 | + new SharedParameterFile.Group("Identity Data", 100), // Creating group as object |
| 65 | + ParameterType.Text |
| 66 | +); |
| 67 | + |
| 68 | +sharedParamFile.Parameters.Add( |
| 69 | + new Guid("758c97dc-6b88-4fbd-9570-4affdc32f08d"), "EquipmentNumber", |
| 70 | + sharedParamFile.Groups.FirstOrDefault(g => "Identity Data".Equals(g.Name)), // Finding group dynamically |
| 71 | + ParameterType.Text |
| 72 | +); |
| 73 | + |
| 74 | + |
| 75 | +// Create a group object |
| 76 | +var electricalGroup = new SharedParameterFile.Group("Electrical", 999); |
| 77 | + |
| 78 | +// Add some parameters assigned to this group |
| 79 | +sharedParamFile.Parameters.Add( |
| 80 | + new Guid("5031db93-bb19-454e-bea4-0f77d60f15e6"), "ApparentPower", |
| 81 | + electricalGroup, ParameterType.ElectricalApparentPower |
| 82 | +); |
| 83 | +sharedParamFile.Parameters.Add( |
| 84 | + new Guid("963abdb6-372f-496c-b99e-f11d8e0e5d20"), "Current", |
| 85 | + electricalGroup, ParameterType.ElectricalCurrent |
| 86 | +); |
| 87 | +sharedParamFile.Parameters.Add( |
| 88 | + new Guid("c006d4d6-0b12-42ad-8078-fe38ab8b1eff"), "Phases", |
| 89 | + "Electrical", // Using group's name, because we've just added parameters with a group object having the same name |
| 90 | + ParameterType.NumberOfPoles |
| 91 | +); |
| 92 | + |
| 93 | +// Write out shared parameters file to disk |
| 94 | +sharedParamFile.Save("path/new/shared/file.txt"); |
| 95 | +``` |
0 commit comments