Skip to content

Commit f0e6b43

Browse files
committed
making Three.js entities a separate project
1 parent 3665ff2 commit f0e6b43

24 files changed

+58
-726
lines changed
File renamed without changes.

src/Addin/AddinManifest.addin

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<RevitAddIns>
33

44
<AddIn Type="Application">
5-
<FullClassName>CodeCave.Revit.Threejs.Exporter.Addin.App</FullClassName>
5+
<FullClassName>CodeCave.Threejs.Revit.Exporter.Addin.App</FullClassName>
66
<ClientId>f103a0f4-c4cf-4ece-9570-a5243bf30722</ClientId>
77
<Name>== Edit in project's properties ==</Name>
8-
<Assembly>CodeCave.Revit.Threejs.Exporter.Addin.dll</Assembly>
8+
<Assembly>CodeCave.Threejs.Revit.Exporter.Addin.dll</Assembly>
99
<VendorId>== Edit in project's properties ==</VendorId>
1010
<VendorDescription>== Edit (company + authors + website) in project's properties ==</VendorDescription>
1111
</AddIn>

src/Addin/App.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#endregion
1919

20-
namespace CodeCave.Revit.Threejs.Exporter.Addin
20+
namespace CodeCave.Threejs.Revit.Exporter.Addin
2121
{
2222
/// <summary>
2323
/// The main application defined in this add-in

src/Addin/ExporterCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.IO;
55
using System.Windows.Forms;
66

7-
namespace CodeCave.Revit.Threejs.Exporter.Addin
7+
namespace CodeCave.Threejs.Revit.Exporter.Addin
88
{
99
/// <summary>
1010
/// A sample ribbon command, demonstrates the possibility to bing Revit commands to ribbon buttons

src/Addin/ExternalCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#endregion
88

9-
namespace CodeCave.Revit.Threejs.Exporter.Addin
9+
namespace CodeCave.Threejs.Revit.Exporter.Addin
1010
{
1111
/// <summary>
1212
/// A simple example of an external command, usually it's used for batch processing

src/Addin/RibbonHelper.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Windows.Media.Imaging;
99
using Autodesk.Revit.UI;
1010

11-
namespace CodeCave.Revit.Threejs.Exporter.Addin
11+
namespace CodeCave.Threejs.Revit.Exporter.Addin
1212
{
1313
/// <summary>
1414
/// A set of helpers for Revit Ribbon
@@ -30,7 +30,7 @@ public static void AddButtons(
3030
)
3131
{
3232
ribbonPanelName = string.IsNullOrWhiteSpace(ribbonPanelName)
33-
? nameof(CodeCave.Revit.Threejs.Exporter.Addin)
33+
? nameof(CodeCave.Threejs.Revit.Exporter.Addin)
3434
: ribbonPanelName;
3535

3636
RibbonPanel ribbonPanel = null;

src/Addin/StringLocalizer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Reflection;
55
using System.Resources;
66

7-
namespace CodeCave.Revit.Threejs.Exporter.Addin
7+
namespace CodeCave.Threejs.Revit.Exporter.Addin
88
{
99
/// <summary>
1010
/// In absence of <see cref="T:Microsoft.Extensions.Localization"/> and <see cref="T:Microsoft.Extensions.DependencyInjection"/>

src/Addin/Threejs.Exporter.Addin.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
2018 | net46
1515
2019 | net47
1616
2020 | net471
17+
2021 | net48
1718
For example you can exclude Revit 2014, by simply removing net40 target belows
1819
-->
1920
<TargetFrameworks>net471</TargetFrameworks>
@@ -49,6 +50,9 @@
4950
<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
5051
<RevitVersion>2020</RevitVersion>
5152
</PropertyGroup>
53+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
54+
<RevitVersion>2021</RevitVersion>
55+
</PropertyGroup>
5256
<PropertyGroup>
5357
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
5458
<PlatformTarget>x64</PlatformTarget>
@@ -90,6 +94,7 @@
9094
<PackageReference Include="Autodesk.Revit.SDK" Version="2018.*" Condition=" '$(RevitVersion)' == '2018' " PrivateAssets="All" />
9195
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
9296
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.*" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
97+
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
9398
</ItemGroup>
9499
<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
95100
<ItemGroup>
@@ -118,7 +123,6 @@
118123
</Content>
119124
</ItemGroup>
120125
<ItemGroup>
121-
<Compile Include="Exporter.cs" />
122126
<Compile Include="RibbonHelper.cs" />
123127
<Compile Include="App.cs" />
124128
<Compile Include="ExternalCommand.cs" />
@@ -130,7 +134,7 @@
130134
<ProjectReference Include="..\Exporter\Threejs.Exporter.csproj" />
131135
</ItemGroup>
132136
<PropertyGroup>
133-
<RootNamespace>CodeCave.Revit.Threejs.Exporter.Addin</RootNamespace>
137+
<RootNamespace>CodeCave.Threejs.Revit.Exporter.Addin</RootNamespace>
134138
<AssemblyName>Threejs.Exporter.Addin</AssemblyName>
135139
<Authors>Your name</Authors>
136140
<PackageId>sample.vendor.id.change.it</PackageId>

src/Addin/ZeroDocStateAvailability.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Autodesk.Revit.DB;
22
using Autodesk.Revit.UI;
33

4-
namespace CodeCave.Revit.Threejs.Exporter.Addin
4+
namespace CodeCave.Threejs.Revit.Exporter.Addin
55
{
66
public class ZeroDocStateAvailability : IExternalCommandAvailability
77
{

src/Addin/Exporter.cs renamed to src/Exporter/Exporter.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.IO;
66
using System.Linq;
77

8-
namespace CodeCave.Revit.Threejs.Exporter.Addin
8+
namespace CodeCave.Threejs.Revit.Exporter
99
{
1010
public class Exporter
1111
{
@@ -75,12 +75,13 @@ public void ExportFile(Document docWrapper, string rfaFilePath)
7575
}
7676

7777
var context = new ObjectSceneExportContext(docWrapper, new FileInfo(outputFilePath));
78-
var exporter = new CustomExporter(docWrapper, context)
78+
using (var exporter = new CustomExporter(docWrapper, context)
7979
{
80-
ShouldStopOnError = false
81-
};
82-
83-
exporter.Export(uiapp.ActiveUIDocument.ActiveView as View3D);
80+
ShouldStopOnError = false,
81+
})
82+
{
83+
exporter.Export(uiapp.ActiveUIDocument.ActiveView);
84+
}
8485

8586
this?.OnSymbolExportEnded(familyTypeExportArgs);
8687

src/Exporter/Extensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using Autodesk.Revit.DB;
5-
using CodeCave.Revit.Threejs.Exporter.Materials;
5+
using CodeCave.Threejs.Entities;
66
using Material = Autodesk.Revit.DB.Material;
77

8-
namespace CodeCave.Revit.Threejs.Exporter
8+
namespace CodeCave.Threejs.Revit.Exporter
99
{
1010
public static class ElementExtensions
1111
{

src/Exporter/Geometries/BufferGeometry.cs

-15
This file was deleted.

src/Exporter/Geometries/Geometry.cs

-154
This file was deleted.

src/Exporter/Helpers/CurrentSet.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
4-
using CodeCave.Revit.Threejs.Exporter.Geometries;
5-
using CodeCave.Revit.Threejs.Exporter.Objects;
4+
using CodeCave.Threejs.Entities;
65

7-
namespace CodeCave.Revit.Threejs.Exporter.Helpers
6+
namespace CodeCave.Threejs.Revit.Exporter.Helpers
87
{
98
public struct CurrentSet
109
{
@@ -39,10 +38,9 @@ public void SetMaterial(string materialUuid)
3938
{
4039
Debug.Assert(!GeometryCache.ContainsKey(materialUuid), "expected same keys in both");
4140

42-
ObjectCache.Add(materialUuid, new Object3D("Mesh")
41+
ObjectCache.Add(materialUuid, new Object3D("Mesh", uuidPerMaterial)
4342
{
4443
Geometry = uuidPerMaterial,
45-
Uuid = uuidPerMaterial,
4644
Material = MaterialUid,
4745
Name = Element.Name,
4846
});

src/Exporter/Helpers/Point3D.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Autodesk.Revit.DB;
33

4-
namespace CodeCave.Revit.Threejs.Exporter.Helpers
4+
namespace CodeCave.Threejs.Revit.Exporter.Helpers
55
{
66
public class Point3D : IEquatable<Point3D>, IComparable<Point3D>
77
{

src/Exporter/Helpers/VerticesOfPoint3D.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Collections;
22
using System.Collections.Generic;
33

4-
namespace CodeCave.Revit.Threejs.Exporter.Helpers
4+
namespace CodeCave.Threejs.Revit.Exporter.Helpers
55
{
66
public class VerticesOfPoint3D : IEnumerable<Point3D>
77
{

0 commit comments

Comments
 (0)