添加项目文件。

This commit is contained in:
GG Z
2024-01-08 09:30:50 +08:00
commit 1ccc4b3047
85 changed files with 5904 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
using System;
namespace KGdev.BI3D.Revit.Common
{
public interface IAuthProvider
{
bool TryUpdateToken(string key);
bool ValidateToken(string token);
bool IsTrial(string token);
int LicenseTypeInt(string token);
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
namespace KGdev.BI3D.Revit.Common
{
public interface IBI3DViewsProvider
{
View3D GetContextView3D(Document document);
List<View3D> GetScenes(Document document);
string GetSceneName(View3D view3d);
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace KGdev.BI3D.Revit.Common
{
public interface IConstantsProvider
{
string ProductId { get; }
string PurchaseUrl { get; }
string ViewerAndExamplesFolderName { get; }
string TrialKey { get; }
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using KGdev.BI3D.Revit.Common.Models;
namespace KGdev.BI3D.Revit.Common
{
public interface IDataExporter
{
string Name { get; }
string Description { get; }
string Extension { get; }
List<IOptionDefinition> Options { get; }
void Export(
Document rootDocument,
List<LinkedElementIdPath> exportedElementIdPaths,
string path
);
}
}

View File

@@ -0,0 +1,10 @@
using System;
using KGdev.BI3D.Revit.Common.Models;
namespace KGdev.BI3D.Revit.Common
{
public interface IElementIdProvider
{
string GetElementId(LinkedElementIdPath elementIdPath);
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using KGdev.BI3D.Revit.Common.Models;
namespace KGdev.BI3D.Revit.Common
{
public interface IExporter
{
string Description { get; }
List<IOptionDefinition> Options { get; }
Dictionary<string, LinkedElementIdPath> Export(
View3D objectsView,
string path,
Dictionary<string, object> optionValues
);
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
namespace KGdev.BI3D.Revit.Common
{
public interface IGlobalStore
{
string GetToken();
void SetToken(string token);
string GetKey();
void SetKey(string key);
string GetAppTempDirectoryPath();
Dictionary<string, object> GetDefaultExporterChosenOptionValues();
void SetDefaultExporterChosenOptionValues(Dictionary<string, object> valuesDictionary);
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using KGdev.BI3D.Revit.Common.Models;
namespace KGdev.BI3D.Revit.Common
{
public interface ILinkedDocumentsUtilities
{
IList<LinkedDocumentInformation> GetLinkedDocuments(
Document rootDocument,
Transform baseTransform,
bool includeThis,
List<ElementId> passedLinkInstanceId
);
Element GetElement(Document rootDocument, LinkedElementIdPath path);
}
}

View File

@@ -0,0 +1,13 @@
using System;
namespace KGdev.BI3D.Revit.Common
{
public interface IMainWindow
{
void Show();
void Close();
bool IsVisible { get; }
}
}

View File

@@ -0,0 +1,9 @@
using System;
namespace KGdev.BI3D.Revit.Common
{
public interface IMuidProvider
{
string GetMuid();
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
namespace KGdev.BI3D.Revit.Common
{
public interface IOptionDefinition
{
string Id { get; }
string Label { get; }
string Description { get; }
OptionValueType OptionValueType { get; }
List<ISelectOptionDefinitionValue> PossibleValues { get; }
object DefaultValue { get; }
double Min { get; }
double Max { get; }
double Step { get; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace KGdev.BI3D.Revit.Common
{
public interface IReduxReducer
{
event EventHandler<Dictionary<string, object>> OnStateChanged;
void Reduce(Dictionary<string, object> action);
}
}

View File

@@ -0,0 +1,11 @@
using System;
namespace KGdev.BI3D.Revit.Common
{
public interface ISelectOptionDefinitionValue
{
string Label { get; set; }
object Value { get; set; }
}
}

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{1124213F-BDC6-4A9D-BF39-7E916D3FBCA1}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>KGdev.BI3D.Revit.Common</RootNamespace>
<AssemblyName>KGdev.BI3D.Revit.Common</AssemblyName>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<FileAlignment>512</FileAlignment>
<TargetFramework>net472</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<EnableDefaultItems>False</EnableDefaultItems>
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Compile Include="IAuthProvider.cs" />
<Compile Include="IBI3DViewsProvider.cs" />
<Compile Include="IConstantsProvider.cs" />
<Compile Include="IDataExporter.cs" />
<Compile Include="IElementIdProvider.cs" />
<Compile Include="IExporter.cs" />
<Compile Include="IGlobalStore.cs" />
<Compile Include="ILinkedDocumentsUtilities.cs" />
<Compile Include="IMainWindow.cs" />
<Compile Include="IMuidProvider.cs" />
<Compile Include="IOptionDefinition.cs" />
<Compile Include="IReduxReducer.cs" />
<Compile Include="ISelectOptionDefinitionValue.cs" />
<Compile Include="Models\LinkedDocumentInformation.cs" />
<Compile Include="Models\LinkedElementIdPath.cs" />
<Compile Include="OptionValueType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="RevitAPI">
<HintPath>C:\Program Files\Autodesk\Revit 2018\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
namespace KGdev.BI3D.Revit.Common.Models
{
public class LinkedDocumentInformation
{
public Document Document { get; set; }
public Transform TransformToRoot { get; set; }
public List<ElementId> PassedLinkInstanceIds { get; set; } = new List<ElementId>();
}
}

View File

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
namespace KGdev.BI3D.Revit.Common.Models
{
public class LinkedElementIdPath
{
public List<ElementId> ElementIds { get; private set; } = new List<ElementId>();
public LinkedElementIdPath(IList<ElementId> elementIds)
{
this.ElementIds.AddRange(elementIds);
}
public override bool Equals(object obj)
{
LinkedElementIdPath linkedElementIdPath = obj as LinkedElementIdPath;
bool flag = linkedElementIdPath == null;
bool flag2;
if (flag)
{
flag2 = false;
}
else
{
bool flag3 = this.ElementIds.Count != linkedElementIdPath.ElementIds.Count;
if (flag3)
{
flag2 = false;
}
else
{
for (int i = 0; i < this.ElementIds.Count; i++)
{
int integerValue = this.ElementIds[i].IntegerValue;
int integerValue2 = linkedElementIdPath.ElementIds[i].IntegerValue;
bool flag4 = integerValue != integerValue2;
if (flag4)
{
return false;
}
}
flag2 = true;
}
}
return flag2;
}
public override int GetHashCode()
{
int num = this.ElementIds.Count.GetHashCode();
foreach (ElementId elementId in this.ElementIds)
{
num ^= elementId.IntegerValue.GetHashCode();
}
return num;
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
namespace KGdev.BI3D.Revit.Common
{
public enum OptionValueType
{
STRING,
BOOLEAN,
NUMBER,
SELECT
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyCompany("KGdev.BI3D.Revit.Common")]
[assembly: AssemblyConfiguration("Release 2020")]
[assembly: AssemblyFileVersion("1.3.0")]
[assembly: AssemblyInformationalVersion("1.3.0")]
[assembly: AssemblyProduct("KGdev.BI3D.Revit.Common")]
[assembly: AssemblyTitle("KGdev.BI3D.Revit.Common")]