Skip to content

Commit 775fbcf

Browse files
committed
improving README file
1 parent d76158d commit 775fbcf

File tree

2 files changed

+97
-14
lines changed

2 files changed

+97
-14
lines changed

README.md

Lines changed: 87 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,95 @@
1-
Revit Toolkit
1+
Revit(less) Toolkit
22
=============
33

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)
55

6-
[![Revit API level](https://img.shields.io/badge/Revit%20API%20Level-2017-447788.svg)](http://www.revitapidocs.com/2017/)
7-
[![NuGet version](https://img.shields.io/nuget/v/CodeCave.Revit.Toolkit.svg)](https://www.nuget.org/packages/CodeCave.Revit.Toolkit/)
6+
[![Revit API](https://img.shields.io/badge/Revit%20API-2017-447788.svg)](http://www.revitapidocs.com/2017/)
7+
[![NuGet version](https://img.shields.io/nuget/v/CodeCave.Revit.Toolkit.svg?label=NuGet)](https://www.nuget.org/packages/CodeCave.Revit.Toolkit/)
8+
[![License](https://img.shields.io/github/license/codecavepro/revit-toolkit.svg)](https://github.com/CodeCavePro/revit-toolkit/blob/master/LICENSE.txt)
89
[![NuGet downloads](https://img.shields.io/nuget/dt/CodeCave.Revit.Toolkit.svg?label=NuGet%20downloads)](https://www.nuget.org/packages/CodeCave.Revit.Toolkit/)
910
[![GitHub downloads](https://img.shields.io/github/downloads/CodeCavePro/revit-toolkit/total.svg?label=GitHub%20downloads)](https://github.com/CodeCavePro/revit-toolkit/releases)
10-
[![License](https://img.shields.io/github/license/codecavepro/revit-toolkit.svg)](https://github.com/CodeCavePro/revit-toolkit/blob/master/LICENSE.txt)
1111

1212
[![AppVeyor build status](https://img.shields.io/appveyor/ci/salaros/revit-toolkit/master.svg?logo=appveyor)](https://ci.appveyor.com/project/salaros/revit-toolkit/history)
13-
[![AppVeyor tests](https://img.shields.io/appveyor/tests/salaros/revit-toolkit.svg)]()
14-
[![.Net Status (GitHub)](https://img.shields.io/dotnetstatus/gh/codecavepro/revit-toolkit/API.svg)]()
13+
[![AppVeyor tests](https://img.shields.io/appveyor/tests/salaros/revit-toolkit.svg)](https://ci.appveyor.com/project/salaros/revit-toolkit/build/tests)
1514
[![Read the Docs (version)](https://img.shields.io/readthedocs/revit-toolkit/latest.svg)](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+
```

tests/SharedParameterFileTests.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34
using System.Linq;
45
using System.Text.RegularExpressions;
@@ -219,29 +220,31 @@ public void FileIsSerializedProperly()
219220
var simpleSharedFromDisk = File
220221
.ReadAllText(SharedParameterFiles.FirstOrDefault(f => f.EndsWith(@"SimpleShared_1.txt")));
221222

222-
var simpleSharedFromBuilt = new SharedParameterFile();
223+
var simpleSharedFromBuilt = new SharedParameterFile(new Dictionary<string,int> { { "Identity Data", 100 } } );
223224

224225
#region Identity Data
225226

226-
var identityDataGroup = new SharedParameterFile.Group("Identity Data", 100);
227227
simpleSharedFromBuilt.Parameters.Add(
228-
new Guid("61ff3d56-09d7-4049-8c78-4abe745e4e5a"), "EquipmentName",
229-
identityDataGroup, ParameterType.Text
228+
new Guid("61ff3d56-09d7-4049-8c78-4abe745e4e5a"),"EquipmentName",
229+
"Identity Data", // Passing group by name
230+
ParameterType.Text
230231
);
231232

232233
simpleSharedFromBuilt.Parameters.Add(
233234
new Guid("758c97dc-6b88-4fbd-9570-4affdc32f08d"), "EquipmentNumber",
234-
identityDataGroup, ParameterType.Text
235+
simpleSharedFromBuilt.Groups.FirstOrDefault(g => "Identity Data".Equals(g.Name)), // Finding group dynamically
236+
ParameterType.Text
235237
);
236238

237239
simpleSharedFromBuilt.Parameters.Add(
238240
new Guid("b5a53ea4-55d9-497c-8488-6607faa11e5f"), "EquipmentServed",
239-
identityDataGroup, ParameterType.Text
241+
new SharedParameterFile.Group("Identity Data", 100), // Creating group as object
242+
ParameterType.Text
240243
);
241244

242245
simpleSharedFromBuilt.Parameters.Add(
243246
new Guid("d4fa8765-86f3-4472-860c-a906aff18593"), "EquipmentType",
244-
identityDataGroup, ParameterType.Text
247+
"Identity Data", ParameterType.Text
245248
);
246249

247250
#endregion

0 commit comments

Comments
 (0)