More revit (#6)
* more revit api * add IRevitFamilySymbol * converting more basic types * all basic converters done * fix points * extensions and helpers done * finished Raw * first pass done? * fmt
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Autodesk.Revit.DB;
|
||||
using Mapster.Utils;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
#pragma warning disable CA1010
|
||||
@@ -29,6 +30,113 @@ public partial interface IRevitForgeTypeIdProxy : IRevitForgeTypeId;
|
||||
)]
|
||||
public partial interface IRevitElementProxy : IRevitElement;
|
||||
|
||||
public partial class ElementProxy
|
||||
{
|
||||
public IRevitParameter GetParameter(RevitBuiltInParameter builtInParameter) =>
|
||||
new ParameterProxy(_Instance.get_Parameter(Enum<BuiltInParameter>.Parse(builtInParameter.ToString())));
|
||||
|
||||
public IRevitBoundingBoxXYZ GetBoundingBox() => new BoundingBoxXYZProxy(_Instance.get_BoundingBox(null));
|
||||
|
||||
public IRevitGeometryElement GetGeometry(IRevitOptions options) =>
|
||||
new GeometryElementProxy(_Instance.get_Geometry(((OptionsProxy)options)._Instance));
|
||||
|
||||
public IRevitFamilySymbol? ToFamilySymbol()
|
||||
{
|
||||
if (_Instance is FamilySymbol s)
|
||||
{
|
||||
return new FamilySymbolProxy(s);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitMaterial? ToMaterial()
|
||||
{
|
||||
if (_Instance is Material m)
|
||||
{
|
||||
return new MaterialProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitHostObject? ToHostObject()
|
||||
{
|
||||
if (_Instance is HostObject m)
|
||||
{
|
||||
return new HostObjectProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitGroup? ToGroup()
|
||||
{
|
||||
if (_Instance is Group m)
|
||||
{
|
||||
return new GroupProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitGraphicsStyle? ToGraphicsStyle()
|
||||
{
|
||||
if (_Instance is GraphicsStyle m)
|
||||
{
|
||||
return new GraphicsStyleProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitElementType? ToType()
|
||||
{
|
||||
if (_Instance is ElementType m)
|
||||
{
|
||||
return new ElementTypeProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitSketch? ToSketch()
|
||||
{
|
||||
if (_Instance is Sketch m)
|
||||
{
|
||||
return new SketchProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitFloor? ToFloor()
|
||||
{
|
||||
if (_Instance is Floor m)
|
||||
{
|
||||
return new FloorProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitModelLine? ToModelLine()
|
||||
{
|
||||
if (_Instance is ModelLine m)
|
||||
{
|
||||
return new ModelLineProxy(m);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(typeof(FamilySymbol), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitFamilySymbolProxy : IRevitFamilySymbol;
|
||||
|
||||
[Proxy(typeof(ElementType), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitElementTypeProxy : IRevitElementType;
|
||||
|
||||
[Proxy(
|
||||
typeof(Category),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
@@ -49,5 +157,11 @@ public partial interface IRevitCurtainGridProxy : IRevitCurtainGrid;
|
||||
[Proxy(typeof(Wall), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitWallProxy : IRevitWall;
|
||||
|
||||
[Proxy(typeof(WallType), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitWallTypeProxy : IRevitWallType;
|
||||
|
||||
[Proxy(typeof(HostObject), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitHostObjectProxy : IRevitHostObject;
|
||||
|
||||
[Proxy(typeof(Ellipse), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitEllipseProxy : IRevitEllipse;
|
||||
|
||||
@@ -50,3 +50,48 @@ public partial class ModelCurveArrArrayProxy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(CurveArrArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitCurveArrArrayProxy : IRevitCurveArrArray;
|
||||
|
||||
public partial class CurveArrArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<IRevitCurveArray> GetEnumerator() => new RevitCurveArrayIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct RevitCurveArrayIterator : IEnumerator<IRevitCurveArray>
|
||||
{
|
||||
private readonly CurveArrArrayIterator _curveArrayIterator;
|
||||
|
||||
public RevitCurveArrayIterator(CurveArrArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitCurveArray Current => new CurveArrayProxy((CurveArray)_curveArrayIterator.Current);
|
||||
}
|
||||
|
||||
public IRevitCurveArray this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
var obj = _Instance.get_Item(index);
|
||||
return Mapster.TypeAdapter.Adapt<IRevitCurveArray>(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.PointClouds;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
@@ -50,3 +51,151 @@ public partial class ModelCurveArrayProxy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(CurveArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitCurveArrayProxy : IRevitCurveArray;
|
||||
|
||||
public partial class CurveArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<IRevitCurve> GetEnumerator() => new RevitCurveCollectionIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct RevitCurveCollectionIterator : IEnumerator<IRevitCurve>
|
||||
{
|
||||
private readonly CurveArrayIterator _curveArrayIterator;
|
||||
|
||||
public RevitCurveCollectionIterator(CurveArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitCurve Current => new CurveProxy((Curve)_curveArrayIterator.Current);
|
||||
}
|
||||
|
||||
public IRevitCurve this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
var obj = _Instance.get_Item(index);
|
||||
return Mapster.TypeAdapter.Adapt<IRevitCurve>(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(DoubleArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitDoubleArrayProxy : IRevitDoubleArray;
|
||||
|
||||
public partial class DoubleArrayProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public int Count => Size;
|
||||
|
||||
public IEnumerator<double> GetEnumerator() => new DoubleArrayProxyIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct DoubleArrayProxyIterator : IEnumerator<double>
|
||||
{
|
||||
private readonly DoubleArrayIterator _curveArrayIterator;
|
||||
|
||||
public DoubleArrayProxyIterator(DoubleArrayIterator doubleArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = doubleArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public double Current => (double)_curveArrayIterator.Current;
|
||||
}
|
||||
|
||||
public double this[int index] => _Instance.get_Item(index);
|
||||
}
|
||||
|
||||
public struct RevitCloudPoint : IRevitCloudPoint
|
||||
{
|
||||
public float X { get; }
|
||||
public float Y { get; }
|
||||
public float Z { get; }
|
||||
public int Color { get; }
|
||||
|
||||
public RevitCloudPoint(float x, float y, float z, int color)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
public IRevitXYZ ToXYZ() => new XYZProxy(new XYZ(X, Y, Z));
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(RevitCloudPoint),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitCloudPointProxy : IRevitCloudPointList;
|
||||
|
||||
[Proxy(
|
||||
typeof(PointCollection),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator", "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitCloudPointListProxy : IRevitCloudPointList;
|
||||
|
||||
public partial class PointCollectionProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public IEnumerator<IRevitCloudPoint> GetEnumerator() => new RevitCloudPointListIterator(_Instance.GetPointIterator());
|
||||
|
||||
private readonly struct RevitCloudPointListIterator : IEnumerator<IRevitCloudPoint>
|
||||
{
|
||||
private readonly PointIterator _curveArrayIterator;
|
||||
|
||||
public RevitCloudPointListIterator(PointIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitCloudPoint Current
|
||||
{
|
||||
get
|
||||
{
|
||||
var current = _curveArrayIterator.Current;
|
||||
return new RevitCloudPoint(current.X, current.Y, current.Z, current.Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,27 @@ public partial interface IRevitLocationCurveProxy : IRevitLocationCurve;
|
||||
[Proxy(typeof(Location), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitLocationProxy : IRevitLocation;
|
||||
|
||||
public partial class LocationProxy
|
||||
{
|
||||
public IRevitLocationPoint? ToLocationPoint()
|
||||
{
|
||||
if (_Instance is LocationPoint point)
|
||||
{
|
||||
return new LocationPointProxy(point);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IRevitLocationCurve? ToLocationCurve()
|
||||
{
|
||||
if (_Instance is LocationCurve point)
|
||||
{
|
||||
return new LocationCurveProxy(point);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(LocationPoint),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using System.Collections;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Architecture;
|
||||
using Mapster.Utils;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
@@ -12,3 +15,385 @@ public partial interface IRevitUnitsProxy : IRevitUnits;
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitFormatOptionsProxy : IRevitFormatOptions;
|
||||
|
||||
[Proxy(
|
||||
typeof(Transform),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Basis" }
|
||||
)]
|
||||
public partial interface IRevitTransformProxy : IRevitTransform;
|
||||
|
||||
public partial class TransformProxy
|
||||
{
|
||||
public void Dispose() => _Instance.Dispose();
|
||||
}
|
||||
|
||||
[Proxy(typeof(BasePoint), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitBasePointProxy : IRevitBasePoint;
|
||||
|
||||
[Proxy(typeof(ParameterSet), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitParameterSetProxy : IRevitParameterSet;
|
||||
|
||||
public partial class ParameterSetProxy
|
||||
{
|
||||
public void Dispose() => _Instance.Dispose();
|
||||
|
||||
IEnumerator<IRevitParameter> IEnumerable<IRevitParameter>.GetEnumerator() =>
|
||||
new ParameterSetProxyIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct ParameterSetProxyIterator : IEnumerator<IRevitParameter>
|
||||
{
|
||||
private readonly ParameterSetIterator _curveArrayIterator;
|
||||
|
||||
public ParameterSetProxyIterator(ParameterSetIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitParameter Current => new ParameterProxy((Parameter)_curveArrayIterator.Current);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(Parameter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "IsReadOnly", "StorageType" }
|
||||
)]
|
||||
public partial interface IRevitParameterProxy : IRevitParameter;
|
||||
|
||||
public partial class ParameterProxy
|
||||
{
|
||||
public bool IsReadOnly => _Instance.IsReadOnly;
|
||||
public IRevitStorageType StorageType => Enum<IRevitStorageType>.Parse(_Instance.StorageType.ToString());
|
||||
}
|
||||
|
||||
[Proxy(typeof(Definition), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitDefinitionProxy : IRevitDefinition;
|
||||
|
||||
public partial class DefinitionProxy
|
||||
{
|
||||
public IRevitInternalDefinition? ToInternal()
|
||||
{
|
||||
var id = _Instance as InternalDefinition;
|
||||
if (id is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new InternalDefinitionProxy(id);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(InternalDefinition),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "ParameterGroup", "Name", "GetGroupTypeId", "BuiltInParameter", "get_ParameterGroup", "set_ParameterGroup" }
|
||||
)]
|
||||
public partial interface IRevitInternalDefinitionProxy : IRevitInternalDefinition;
|
||||
|
||||
public partial class InternalDefinitionProxy
|
||||
{
|
||||
public RevitBuiltInParameter BuiltInParameter =>
|
||||
Enum<RevitBuiltInParameter>.Parse(_Instance.BuiltInParameter.ToString());
|
||||
}
|
||||
|
||||
[Proxy(typeof(PolyLine), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitPolyLineProxy : IRevitPolyLine;
|
||||
|
||||
[Proxy(typeof(Point), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitPointProxy : IRevitPoint;
|
||||
|
||||
[Proxy(typeof(Plane), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitPlaneProxy : IRevitPlane;
|
||||
|
||||
public partial class PlaneProxy
|
||||
{
|
||||
public void Dispose() => _Instance.Dispose();
|
||||
}
|
||||
|
||||
[Proxy(typeof(Arc), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitArcProxy : IRevitArc;
|
||||
|
||||
[Proxy(
|
||||
typeof(BoundingBoxXYZ),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "BoundEnabled", "MaxEnabled", "MinEnabled", "Bounds" }
|
||||
)]
|
||||
public partial interface IRevitBoundingBoxXYZProxy : IRevitBoundingBoxXYZ;
|
||||
|
||||
[Proxy(typeof(Line), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitLineProxy : IRevitLine;
|
||||
|
||||
[Proxy(
|
||||
typeof(Mesh),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Transformed", "Triangle" }
|
||||
)]
|
||||
public partial interface IRevitMeshProxy : IRevitMesh;
|
||||
|
||||
public partial class MeshProxy
|
||||
{
|
||||
public IRevitMeshTriangle GetTriangle(int index) => new MeshTriangleProxy(_Instance.get_Triangle(index));
|
||||
|
||||
public IRevitMesh GetTransformed(IRevitTransform inverseTransform) =>
|
||||
new MeshProxy(_Instance.get_Transformed(((TransformProxy)inverseTransform)._Instance));
|
||||
}
|
||||
|
||||
[Proxy(typeof(Material), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitMaterialProxy : IRevitMaterial;
|
||||
|
||||
[Proxy(
|
||||
typeof(MeshTriangle),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Vertex", "Index" }
|
||||
)]
|
||||
public partial interface IRevitMeshTriangleProxy : IRevitMeshTriangle;
|
||||
|
||||
public partial class MeshTriangleProxy
|
||||
{
|
||||
public uint GetIndex(int index) => _Instance.get_Index(index);
|
||||
}
|
||||
|
||||
[Proxy(typeof(NurbSpline), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitNurbSplineProxy : IRevitNurbSpline;
|
||||
|
||||
public partial class NurbSplineProxy
|
||||
{
|
||||
public bool IsRational => _Instance.isRational;
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(HermiteSpline),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitHermiteSplineProxy : IRevitHermiteSpline;
|
||||
|
||||
[Proxy(
|
||||
typeof(PointCloudInstance),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitPointCloudInstanceProxy : IRevitPointCloudInstance;
|
||||
|
||||
[Proxy(typeof(Instance), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitInstanceProxy : IRevitInstance;
|
||||
|
||||
[Proxy(typeof(Level), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitLevelProxy : IRevitLevel;
|
||||
|
||||
[Proxy(
|
||||
typeof(FamilyInstance),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "ToRoom", "FromRoom", "Space", "Room", "StructuralType" }
|
||||
)]
|
||||
public partial interface IRevitFamilyInstanceProxy : IRevitFamilyInstance;
|
||||
|
||||
public partial class FamilyInstanceProxy
|
||||
{
|
||||
public RevitStructuralType StructuralType => Enum<RevitStructuralType>.Parse(_Instance.StructuralType.ToString());
|
||||
}
|
||||
|
||||
[Proxy(typeof(Solid), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSolidProxy : IRevitSolid;
|
||||
|
||||
[Proxy(typeof(Group), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitGroupProxy : IRevitGroup;
|
||||
|
||||
[Proxy(
|
||||
typeof(GeometryObject),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Equals" }
|
||||
)]
|
||||
public partial interface IRevitGeometryObjectProxy : IRevitGeometryObject;
|
||||
|
||||
[Proxy(
|
||||
typeof(Options),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "DetailLevel" }
|
||||
)]
|
||||
public partial interface IRevitOptionsProxy : IRevitOptions;
|
||||
|
||||
public partial class OptionsProxy
|
||||
{
|
||||
public RevitViewDetailLevel DetailLevel => Enum<RevitViewDetailLevel>.Parse(_Instance.DetailLevel.ToString());
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(Face),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Period", "IsCyclic" }
|
||||
)]
|
||||
public partial interface IRevitFaceProxy : IRevitFace;
|
||||
|
||||
[Proxy(
|
||||
typeof(FaceArray),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Item", "get_Item", "set_Item" }
|
||||
)]
|
||||
public partial interface IRevitFaceArrayProxy : IRevitFaceArray;
|
||||
|
||||
public partial class FaceArrayProxy
|
||||
{
|
||||
public int Count => _Instance.Size;
|
||||
public IRevitFace this[int index] => new FaceProxy(_Instance.get_Item(index));
|
||||
|
||||
IEnumerator<IRevitFace> IEnumerable<IRevitFace>.GetEnumerator() =>
|
||||
new ParameterSetProxyIterator(_Instance.ForwardIterator());
|
||||
|
||||
private readonly struct ParameterSetProxyIterator : IEnumerator<IRevitFace>
|
||||
{
|
||||
private readonly FaceArrayIterator _curveArrayIterator;
|
||||
|
||||
public ParameterSetProxyIterator(FaceArrayIterator curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitFace Current => new FaceProxy((Face)_curveArrayIterator.Current);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(GeometryElement),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetEnumerator" }
|
||||
)]
|
||||
public partial interface IRevitGeometryElementProxy : IRevitGeometryElement;
|
||||
|
||||
public partial class GeometryElementProxy
|
||||
{
|
||||
IEnumerator IEnumerable.GetEnumerator() => new GeometryElementProxyIterator(_Instance.GetEnumerator());
|
||||
|
||||
IEnumerator<IRevitGeometryObject> IEnumerable<IRevitGeometryObject>.GetEnumerator() =>
|
||||
new GeometryElementProxyIterator(_Instance.GetEnumerator());
|
||||
|
||||
private readonly struct GeometryElementProxyIterator : IEnumerator<IRevitGeometryObject>
|
||||
{
|
||||
private readonly IEnumerator<GeometryObject> _curveArrayIterator;
|
||||
|
||||
public GeometryElementProxyIterator(IEnumerator<GeometryObject> curveArrayIterator)
|
||||
{
|
||||
_curveArrayIterator = curveArrayIterator;
|
||||
}
|
||||
|
||||
public void Dispose() => _curveArrayIterator.Dispose();
|
||||
|
||||
public bool MoveNext() => _curveArrayIterator.MoveNext();
|
||||
|
||||
public void Reset() => _curveArrayIterator.Reset();
|
||||
|
||||
object IEnumerator.Current => Current;
|
||||
|
||||
public IRevitGeometryObject Current => new GeometryObjectProxy((GeometryObject)_curveArrayIterator.Current);
|
||||
}
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(GeometryInstance),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitGeometryInstanceProxy : IRevitGeometryInstance;
|
||||
|
||||
[Proxy(
|
||||
typeof(GraphicsStyle),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitGraphicsStyleProxy : IRevitGraphicsStyle;
|
||||
|
||||
[Proxy(
|
||||
typeof(BoundarySegment),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitBoundarySegmentProxy : IRevitBoundarySegment;
|
||||
|
||||
[Proxy(typeof(Color), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitColorProxy : IRevitColor;
|
||||
|
||||
[Proxy(typeof(Ceiling), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitCeilingProxy : IRevitCeiling;
|
||||
|
||||
[Proxy(
|
||||
typeof(CeilingAndFloor),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitCeilingAndFloorProxy : IRevitCeilingAndFloor;
|
||||
|
||||
[Proxy(typeof(Sketch), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSketchProxy : IRevitSketch;
|
||||
|
||||
[Proxy(typeof(SketchBase), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSketchBaseProxy : IRevitSketchBase;
|
||||
|
||||
[Proxy(typeof(DirectShape), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitDirectShapeProxy : IRevitDirectShape;
|
||||
|
||||
[Proxy(
|
||||
typeof(ExtrusionRoof),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitExtrusionRoofProxy : IRevitExtrusionRoof;
|
||||
|
||||
[Proxy(typeof(RoofBase), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitRoofBaseProxy : IRevitRoofBase;
|
||||
|
||||
[Proxy(typeof(SketchPlane), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitSketchPlaneProxy : IRevitSketchPlane;
|
||||
|
||||
[Proxy(typeof(Floor), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitFloorProxy : IRevitFloor;
|
||||
|
||||
[Proxy(typeof(ModelLine), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitModelLineProxy : IRevitModelLine;
|
||||
|
||||
[Proxy(
|
||||
typeof(FootPrintRoof),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "Overhang", "ExtendIntoWall", "Offset", "SlopeAngle", "DefinesSlope" }
|
||||
)]
|
||||
public partial interface IRevitFootPrintRoofProxy : IRevitFootPrintRoof;
|
||||
|
||||
[Proxy(typeof(Room), ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface)]
|
||||
public partial interface IRevitRoomProxy : IRevitRoom;
|
||||
|
||||
[Proxy(
|
||||
typeof(TopographySurface),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitTopographySurfaceProxy : IRevitTopographySurface;
|
||||
|
||||
[Proxy(
|
||||
typeof(SpatialElement),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||
new[] { "GetBoundarySegments" }
|
||||
)]
|
||||
public partial interface IRevitSpatialElementProxy : IRevitSpatialElement;
|
||||
|
||||
public partial class SpatialElementProxy
|
||||
{
|
||||
public IEnumerable<IEnumerable<IRevitBoundarySegment>> GetBoundarySegments()
|
||||
{
|
||||
var segments = _Instance.GetBoundarySegments(new SpatialElementBoundaryOptions());
|
||||
foreach (var seg in segments)
|
||||
{
|
||||
yield return GetSegments(seg);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<IRevitBoundarySegment> GetSegments(IList<BoundarySegment> segments) =>
|
||||
segments.Select(seg => new BoundarySegmentProxy(seg));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.PointClouds;
|
||||
using Mapster.Utils;
|
||||
using Speckle.ProxyGenerator;
|
||||
using Speckle.Revit.Interfaces;
|
||||
|
||||
@@ -32,14 +34,34 @@ public class RevitFilterFactory : IRevitFilterFactory
|
||||
elementIds.Cast<IRevitElementIdProxy>().Select(x => x._Instance).ToList()
|
||||
)
|
||||
);
|
||||
|
||||
public IRevitPointCloudFilter CreateMultiPlaneFilter(params IRevitPlane[] planes) =>
|
||||
new PointCloudFilterProxy(
|
||||
PointCloudFilterFactory.CreateMultiPlaneFilter(planes.Cast<PlaneProxy>().Select(x => x._Instance).ToList())
|
||||
);
|
||||
|
||||
public IRevitElementCategoryFilter CreateElementCategoryFilter(RevitBuiltInCategory category) =>
|
||||
new ElementCategoryFilterProxy(new ElementCategoryFilter(Enum<BuiltInCategory>.Parse(category.ToString())));
|
||||
}
|
||||
|
||||
[Proxy(
|
||||
typeof(PointCloudFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitPointCloudFilterProxy : IRevitPointCloudFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitElementFilterProxy : IRevitElementFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementCategoryFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
)]
|
||||
public partial interface IRevitElementCategoryFilterProxy : IRevitElementCategoryFilter;
|
||||
|
||||
[Proxy(
|
||||
typeof(ElementIsElementTypeFilter),
|
||||
ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface
|
||||
|
||||
@@ -9,4 +9,80 @@ public class RevitUnitUtils : IRevitUnitUtils
|
||||
UnitUtils.ConvertFromInternalUnits(value, ((ForgeTypeIdProxy)forgeTypeId)._Instance);
|
||||
|
||||
public IRevitForgeTypeId Length => new ForgeTypeIdProxy(SpecTypeId.Length);
|
||||
public IRevitForgeTypeId Millimeters => new ForgeTypeIdProxy(UnitTypeId.Millimeters);
|
||||
public IRevitForgeTypeId Centimeters => new ForgeTypeIdProxy(UnitTypeId.Centimeters);
|
||||
public IRevitForgeTypeId Meters => new ForgeTypeIdProxy(UnitTypeId.Meters);
|
||||
public IRevitForgeTypeId MetersCentimeters => new ForgeTypeIdProxy(UnitTypeId.MetersCentimeters);
|
||||
public IRevitForgeTypeId Inches => new ForgeTypeIdProxy(UnitTypeId.Inches);
|
||||
public IRevitForgeTypeId FractionalInches => new ForgeTypeIdProxy(UnitTypeId.FractionalInches);
|
||||
public IRevitForgeTypeId Feet => new ForgeTypeIdProxy(UnitTypeId.Feet);
|
||||
public IRevitForgeTypeId FeetFractionalInches => new ForgeTypeIdProxy(UnitTypeId.FeetFractionalInches);
|
||||
}
|
||||
|
||||
public class RevitTransformUtils : IRevitTransformUtils
|
||||
{
|
||||
public IRevitTransform Identity => new TransformProxy(Transform.Identity);
|
||||
|
||||
public IRevitTransform CreateTranslation(IRevitXYZ vector) =>
|
||||
new TransformProxy(Transform.CreateTranslation(((XYZProxy)vector)._Instance));
|
||||
|
||||
public IRevitTransform CreateRotation(IRevitXYZ axis, double angle) =>
|
||||
new TransformProxy(Transform.CreateRotation(((XYZProxy)axis)._Instance, angle));
|
||||
}
|
||||
|
||||
public class RevitXYZUtils : IRevitXYZUtils
|
||||
{
|
||||
public IRevitXYZ Zero => new XYZProxy(XYZ.Zero);
|
||||
public IRevitXYZ BasisX => new XYZProxy(XYZ.BasisX);
|
||||
public IRevitXYZ BasisY => new XYZProxy(XYZ.BasisY);
|
||||
public IRevitXYZ BasisZ => new XYZProxy(XYZ.BasisZ);
|
||||
}
|
||||
|
||||
public class RevitElementIdUtils : IRevitElementIdUtils
|
||||
{
|
||||
public IRevitElementId InvalidElementId => new ElementIdProxy(ElementId.InvalidElementId);
|
||||
}
|
||||
|
||||
public class RevitPlaneUtils : IRevitPlaneUtils
|
||||
{
|
||||
public IRevitPlane CreateByOriginAndBasis(IRevitXYZ center, IRevitXYZ xDirection, IRevitXYZ yDirection) =>
|
||||
new PlaneProxy(
|
||||
Plane.CreateByOriginAndBasis(
|
||||
((XYZProxy)center)._Instance,
|
||||
((XYZProxy)xDirection)._Instance,
|
||||
((XYZProxy)yDirection)._Instance
|
||||
)
|
||||
);
|
||||
|
||||
public IRevitPlane CreateByNormalAndOrigin(IRevitXYZ normal, IRevitXYZ center) =>
|
||||
new PlaneProxy(Plane.CreateByNormalAndOrigin(((XYZProxy)normal)._Instance, ((XYZProxy)center)._Instance));
|
||||
}
|
||||
|
||||
public class RevitNurbSplineUtils : IRevitNurbSplineUtils
|
||||
{
|
||||
public IRevitNurbSpline Create(IRevitHermiteSpline hermiteSpline) =>
|
||||
new NurbSplineProxy(NurbSpline.Create(((HermiteSplineProxy)hermiteSpline)._Instance));
|
||||
}
|
||||
|
||||
public class RevitFormatOptionsUtils : IRevitFormatOptionsUtils
|
||||
{
|
||||
public bool CanHaveSymbol(IRevitForgeTypeId forgeTypeId) =>
|
||||
FormatOptions.CanHaveSymbol(((ForgeTypeIdProxy)forgeTypeId)._Instance);
|
||||
|
||||
public IList<IRevitForgeTypeId> GetValidSymbols(IRevitForgeTypeId forgeTypeId) =>
|
||||
FormatOptions
|
||||
.GetValidSymbols(((ForgeTypeIdProxy)forgeTypeId)._Instance)
|
||||
.Select(x => new ForgeTypeIdProxy(x))
|
||||
.ToList<IRevitForgeTypeId>();
|
||||
|
||||
public string GetLabelForSymbol(IRevitForgeTypeId symbolId) =>
|
||||
LabelUtils.GetLabelForSymbol(((ForgeTypeIdProxy)symbolId)._Instance);
|
||||
}
|
||||
|
||||
public class RevitSolidUtils : IRevitSolidUtils
|
||||
{
|
||||
public IRevitSolid CreateTransformed(IRevitSolid solid, IRevitTransform inverseTransform) =>
|
||||
new SolidProxy(
|
||||
SolidUtils.CreateTransformed(((SolidProxy)solid)._Instance, ((TransformProxy)inverseTransform)._Instance)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCategory
|
||||
public interface IRevitCategory : IRevitObject
|
||||
{
|
||||
string Name { get; }
|
||||
IRevitElementId Id { get; }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public interface IRevitCurtainGrid
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCurtainGrid : IRevitObject
|
||||
{
|
||||
ICollection<IRevitElementId> GetMullionIds();
|
||||
ICollection<IRevitElementId> GetPanelIds();
|
||||
|
||||
@@ -1,7 +1,125 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public interface IRevitCurve
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCurve : IRevitGeometryObject
|
||||
{
|
||||
IRevitXYZ GetEndPoint(int index);
|
||||
double Length { get; }
|
||||
IRevitXYZ Evaluate(double parameter, bool normalized);
|
||||
double GetEndParameter(int index);
|
||||
bool IsBound { get; }
|
||||
IList<IRevitXYZ> Tessellate();
|
||||
}
|
||||
|
||||
public interface IRevitCloudPoint
|
||||
{
|
||||
float X { get; }
|
||||
float Y { get; }
|
||||
float Z { get; }
|
||||
int Color { get; }
|
||||
IRevitXYZ ToXYZ();
|
||||
}
|
||||
|
||||
public interface IRevitCloudPointList : IEnumerable<IRevitCloudPoint>;
|
||||
|
||||
public interface IRevitPointCloudInstance : IRevitInstance
|
||||
{
|
||||
IRevitCloudPointList GetPoints(IRevitPointCloudFilter filter, double averageDistance, int numPoints);
|
||||
}
|
||||
|
||||
public interface IRevitInstance : IRevitElement
|
||||
{
|
||||
IRevitTransform GetTransform();
|
||||
}
|
||||
|
||||
public interface IRevitCurveArray : IReadOnlyList<IRevitCurve>;
|
||||
|
||||
public interface IRevitCurveArrArray : IReadOnlyList<IRevitCurveArray>;
|
||||
|
||||
public interface IRevitEllipse : IRevitCurve
|
||||
{
|
||||
IRevitXYZ Center { get; }
|
||||
IRevitXYZ XDirection { get; }
|
||||
IRevitXYZ YDirection { get; }
|
||||
double RadiusX { get; }
|
||||
double RadiusY { get; }
|
||||
}
|
||||
|
||||
public interface IRevitLevel : IRevitDatumPlane
|
||||
{
|
||||
double Elevation { get; }
|
||||
}
|
||||
|
||||
public interface IRevitDatumPlane : IRevitElement;
|
||||
|
||||
public interface IRevitFamilyInstance : IRevitInstance
|
||||
{
|
||||
IRevitFamilySymbol Symbol { get; }
|
||||
bool FacingFlipped { get; }
|
||||
bool HandFlipped { get; }
|
||||
bool IsSlantedColumn { get; }
|
||||
RevitStructuralType StructuralType { get; }
|
||||
}
|
||||
|
||||
public enum RevitStructuralType
|
||||
{
|
||||
NonStructural,
|
||||
Beam,
|
||||
Brace,
|
||||
Column,
|
||||
Footing,
|
||||
UnknownFraming,
|
||||
}
|
||||
|
||||
public interface IRevitOptionsFactory
|
||||
{
|
||||
IRevitOptions Create(RevitViewDetailLevel viewDetailLevel);
|
||||
}
|
||||
|
||||
public enum RevitViewDetailLevel
|
||||
{
|
||||
Undefined,
|
||||
Coarse,
|
||||
Medium,
|
||||
Fine,
|
||||
}
|
||||
|
||||
public interface IRevitOptions
|
||||
{
|
||||
RevitViewDetailLevel DetailLevel { get; }
|
||||
bool ComputeReferences { get; set; }
|
||||
}
|
||||
|
||||
public interface IRevitGroup : IRevitElement
|
||||
{
|
||||
IList<IRevitElementId> GetMemberIds();
|
||||
}
|
||||
|
||||
public interface IRevitSolid : IRevitGeometryObject
|
||||
{
|
||||
IRevitFaceArray Faces { get; }
|
||||
double SurfaceArea { get; }
|
||||
}
|
||||
|
||||
public interface IRevitFace
|
||||
{
|
||||
IRevitMesh Triangulate();
|
||||
IRevitElementId MaterialElementId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitFaceArray : IReadOnlyList<IRevitFace>;
|
||||
|
||||
public interface IRevitGeometryElement : IRevitGeometryObject, IEnumerable<IRevitGeometryObject>;
|
||||
|
||||
public interface IRevitFloor : IRevitCeilingAndFloor
|
||||
{
|
||||
IRevitElementId SketchId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitModelLine : IRevitModelCurve;
|
||||
|
||||
public interface IRevitFootPrintRoof : IRevitRoofBase
|
||||
{
|
||||
IRevitModelCurveArrArray GetProfiles();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitCurveElement
|
||||
public interface IRevitCurveElement : IRevitElement
|
||||
{
|
||||
IRevitCurve GeometryCurve { get; }
|
||||
IRevitSketchPlane SketchPlane { get; }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitDocument
|
||||
public interface IRevitDocument : IRevitObject
|
||||
{
|
||||
string PathName { get; }
|
||||
bool IsFamilyDocument { get; }
|
||||
|
||||
@@ -1,10 +1,89 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public interface IRevitElement
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElement : IRevitObject
|
||||
{
|
||||
IList<IRevitElementId> GetDependentElements(IRevitElementFilter filter);
|
||||
|
||||
IRevitElementId Id { get; }
|
||||
string UniqueId { get; }
|
||||
IRevitElementId LevelId { get; }
|
||||
IRevitCategory Category { get; }
|
||||
IRevitDocument Document { get; }
|
||||
IRevitElementId GetTypeId();
|
||||
string Name { get; }
|
||||
IRevitBoundingBoxXYZ GetBoundingBox();
|
||||
|
||||
IRevitFamilySymbol? ToFamilySymbol();
|
||||
IRevitMaterial? ToMaterial();
|
||||
IRevitHostObject? ToHostObject();
|
||||
IRevitGroup? ToGroup();
|
||||
IRevitGraphicsStyle? ToGraphicsStyle();
|
||||
IRevitElementType? ToType();
|
||||
IRevitSketch? ToSketch();
|
||||
IRevitFloor? ToFloor();
|
||||
IRevitModelLine? ToModelLine();
|
||||
|
||||
IRevitParameterSet Parameters { get; }
|
||||
|
||||
IRevitParameter? GetParameter(RevitBuiltInParameter parameter);
|
||||
|
||||
IRevitGeometryElement GetGeometry(IRevitOptions options);
|
||||
IRevitLocation Location { get; }
|
||||
}
|
||||
|
||||
public interface IRevitParameterSet : IEnumerable<IRevitParameter>, IDisposable;
|
||||
|
||||
public interface IRevitElementType
|
||||
{
|
||||
string Name { get; }
|
||||
string FamilyName { get; }
|
||||
}
|
||||
|
||||
public interface IRevitFamilySymbol : IRevitElementType;
|
||||
|
||||
public interface IRevitBasePoint : IRevitElement
|
||||
{
|
||||
bool IsShared { get; }
|
||||
IRevitXYZ Position { get; }
|
||||
}
|
||||
|
||||
public interface IRevitParameter
|
||||
{
|
||||
bool IsReadOnly { get; }
|
||||
bool HasValue { get; }
|
||||
bool IsShared { get; }
|
||||
Guid GUID { get; }
|
||||
string? AsString();
|
||||
|
||||
int AsInteger();
|
||||
double AsDouble();
|
||||
IRevitElementId? AsElementId();
|
||||
IRevitStorageType StorageType { get; }
|
||||
IRevitForgeTypeId GetUnitTypeId();
|
||||
IRevitDefinition Definition { get; }
|
||||
}
|
||||
|
||||
public interface IRevitDefinition
|
||||
{
|
||||
IRevitInternalDefinition? ToInternal();
|
||||
string Name { get; }
|
||||
IRevitForgeTypeId GetGroupTypeId();
|
||||
IRevitForgeTypeId GetDataType();
|
||||
}
|
||||
|
||||
public interface IRevitInternalDefinition : IRevitDefinition
|
||||
{
|
||||
RevitBuiltInParameter BuiltInParameter { get; }
|
||||
}
|
||||
|
||||
public enum IRevitStorageType
|
||||
{
|
||||
None,
|
||||
Integer,
|
||||
Double,
|
||||
String,
|
||||
ElementId,
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementFilter;
|
||||
public interface IRevitElementFilter : IRevitObject;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementId;
|
||||
public interface IRevitElementId : IRevitObject
|
||||
{
|
||||
int IntegerValue { get; }
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitElementIsElementTypeFilter : IRevitElementFilter;
|
||||
|
||||
public interface IRevitPointCloudFilter : IRevitElementFilter;
|
||||
|
||||
public interface IRevitElementCategoryFilter : IRevitElementFilter, IDisposable;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
#pragma warning disable CA1040
|
||||
public interface IRevitFilterFactory
|
||||
@@ -13,4 +15,7 @@ public interface IRevitFilterFactory
|
||||
IRevitDocument document,
|
||||
params IRevitElementId[] elementIds
|
||||
);
|
||||
|
||||
IRevitPointCloudFilter CreateMultiPlaneFilter(params IRevitPlane[] planes);
|
||||
IRevitElementCategoryFilter CreateElementCategoryFilter(RevitBuiltInCategory category);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitForgeTypeId;
|
||||
public interface IRevitForgeTypeId : IRevitObject
|
||||
{
|
||||
string TypeId { get; }
|
||||
bool Empty();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
[SuppressMessage("Design", "CA1040:Avoid empty interfaces")]
|
||||
public interface IRevitFormatOptions
|
||||
public interface IRevitFormatOptions : IRevitObject
|
||||
{
|
||||
IRevitForgeTypeId GetUnitTypeId();
|
||||
}
|
||||
|
||||
public interface IRevitFormatOptionsUtils
|
||||
{
|
||||
bool CanHaveSymbol(IRevitForgeTypeId forgeTypeId);
|
||||
IList<IRevitForgeTypeId> GetValidSymbols(IRevitForgeTypeId forgeTypeId);
|
||||
string GetLabelForSymbol(IRevitForgeTypeId symbolId);
|
||||
}
|
||||
|
||||
public interface IRevitSolidUtils
|
||||
{
|
||||
IRevitSolid CreateTransformed(IRevitSolid solid, IRevitTransform inverseTransform);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
public interface IRevitLocation : IRevitObject
|
||||
{
|
||||
IRevitLocationPoint? ToLocationPoint();
|
||||
|
||||
[SuppressMessage("Design", "CA1040:Avoid empty interfaces")]
|
||||
public interface IRevitLocation;
|
||||
IRevitLocationCurve? ToLocationCurve();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,144 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitLocationCurve : IRevitLocation
|
||||
{
|
||||
IRevitCurve Curve { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPolyLine : IRevitGeometryObject
|
||||
{
|
||||
IList<IRevitXYZ> GetCoordinates();
|
||||
}
|
||||
|
||||
public interface IRevitGeometryObject : IRevitObject
|
||||
{
|
||||
IRevitElementId GraphicsStyleId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPoint : IRevitObject
|
||||
{
|
||||
IRevitXYZ Coord { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPlane : IRevitSurface
|
||||
{
|
||||
IRevitXYZ Origin { get; }
|
||||
IRevitXYZ Normal { get; }
|
||||
IRevitXYZ XVec { get; }
|
||||
IRevitXYZ YVec { get; }
|
||||
}
|
||||
|
||||
public interface IRevitSurface : IRevitObject, IDisposable;
|
||||
|
||||
public interface IRevitLine : IRevitCurve;
|
||||
|
||||
public interface IRevitArc : IRevitCurve
|
||||
{
|
||||
IRevitXYZ Center { get; }
|
||||
IRevitXYZ XDirection { get; }
|
||||
IRevitXYZ YDirection { get; }
|
||||
|
||||
double Radius { get; }
|
||||
IRevitXYZ Normal { get; }
|
||||
}
|
||||
|
||||
public interface IRevitMesh : IRevitGeometryObject
|
||||
{
|
||||
IList<IRevitXYZ> Vertices { get; }
|
||||
IRevitElementId MaterialElementId { get; }
|
||||
int NumTriangles { get; }
|
||||
IRevitMeshTriangle GetTriangle(int index);
|
||||
IRevitMesh GetTransformed(IRevitTransform transform);
|
||||
}
|
||||
|
||||
public interface IRevitMaterial : IRevitElement
|
||||
{
|
||||
int Transparency { get; }
|
||||
IRevitColor Color { get; }
|
||||
}
|
||||
|
||||
public interface IRevitColor
|
||||
{
|
||||
byte Red { get; }
|
||||
byte Green { get; }
|
||||
byte Blue { get; }
|
||||
}
|
||||
|
||||
public interface IRevitMeshTriangle
|
||||
{
|
||||
uint GetIndex(int idx);
|
||||
}
|
||||
|
||||
public interface IRevitHermiteSpline : IRevitCurve;
|
||||
|
||||
public interface IRevitNurbSpline : IRevitCurve
|
||||
{
|
||||
IList<IRevitXYZ> CtrlPoints { get; }
|
||||
IRevitDoubleArray Weights { get; }
|
||||
IRevitDoubleArray Knots { get; }
|
||||
int Degree { get; }
|
||||
bool IsRational { get; }
|
||||
bool IsClosed { get; }
|
||||
}
|
||||
|
||||
public interface IRevitDoubleArray : IReadOnlyList<double>;
|
||||
|
||||
public interface IRevitGeometryInstance : IRevitGeometryObject
|
||||
{
|
||||
IRevitGeometryElement GetSymbolGeometry();
|
||||
IRevitGeometryElement GetInstanceGeometry();
|
||||
}
|
||||
|
||||
public interface IRevitGraphicsStyle : IRevitElement
|
||||
{
|
||||
IRevitCategory GraphicsStyleCategory { get; }
|
||||
}
|
||||
|
||||
public interface IRevitBoundarySegment : IRevitObject
|
||||
{
|
||||
IRevitCurve GetCurve();
|
||||
}
|
||||
|
||||
public interface IRevitCeiling : IRevitCeilingAndFloor
|
||||
{
|
||||
IRevitElementId SketchId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitCeilingAndFloor : IRevitHostObject;
|
||||
|
||||
public interface IRevitSketch : IRevitSketchBase
|
||||
{
|
||||
IRevitCurveArrArray Profile { get; }
|
||||
|
||||
IList<IRevitElementId> GetAllElements();
|
||||
}
|
||||
|
||||
public interface IRevitDirectShape : IRevitElement;
|
||||
|
||||
public interface IRevitExtrusionRoof : IRevitRoofBase
|
||||
{
|
||||
IRevitModelCurveArray GetProfile();
|
||||
}
|
||||
|
||||
public interface IRevitSketchBase : IRevitElement;
|
||||
|
||||
public interface IRevitRoofBase : IRevitHostObject;
|
||||
|
||||
public interface IRevitSketchPlane : IRevitElement
|
||||
{
|
||||
IRevitPlane GetPlane();
|
||||
}
|
||||
|
||||
public interface IRevitRoom : IRevitSpatialElement;
|
||||
|
||||
public interface IRevitSpatialElement : IRevitElement
|
||||
{
|
||||
IEnumerable<IEnumerable<IRevitBoundarySegment>> GetBoundarySegments();
|
||||
string Number { get; }
|
||||
IRevitLevel Level { get; }
|
||||
}
|
||||
|
||||
public interface IRevitTopographySurface : IRevitElement;
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
public interface IRevitLocationPoint : IRevitLocation
|
||||
{
|
||||
IRevitXYZ Point { get; }
|
||||
double Rotation { get; }
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitModelCurve : IRevitCurveElement;
|
||||
public interface IRevitModelCurve : IRevitCurveElement
|
||||
{
|
||||
IRevitGraphicsStyle Subcategory { get; }
|
||||
IRevitElement LineStyle { get; }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix")]
|
||||
public interface IRevitModelCurveArray : IReadOnlyList<IRevitModelCurve>;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitNurbSplineUtils
|
||||
{
|
||||
IRevitNurbSpline Create(IRevitHermiteSpline hermiteSpline);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitObject;
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitTransform : IRevitObject, IDisposable
|
||||
{
|
||||
IRevitXYZ OfPoint(IRevitXYZ inbound);
|
||||
IRevitXYZ OfVector(IRevitXYZ inbound);
|
||||
IRevitTransform Multiply(IRevitTransform right);
|
||||
IRevitXYZ Origin { get; }
|
||||
IRevitXYZ BasisX { get; }
|
||||
IRevitXYZ BasisY { get; }
|
||||
IRevitTransform Inverse { get; }
|
||||
}
|
||||
|
||||
public interface IRevitTransformUtils
|
||||
{
|
||||
IRevitTransform Identity { get; }
|
||||
IRevitTransform CreateTranslation(IRevitXYZ vector);
|
||||
IRevitTransform CreateRotation(IRevitXYZ axis, double angle);
|
||||
}
|
||||
@@ -4,4 +4,18 @@ public interface IRevitUnitUtils
|
||||
{
|
||||
double ConvertFromInternalUnits(double value, IRevitForgeTypeId forgeTypeId);
|
||||
IRevitForgeTypeId Length { get; }
|
||||
IRevitForgeTypeId Millimeters { get; }
|
||||
IRevitForgeTypeId Centimeters { get; }
|
||||
IRevitForgeTypeId Meters { get; }
|
||||
IRevitForgeTypeId MetersCentimeters { get; }
|
||||
IRevitForgeTypeId Inches { get; }
|
||||
IRevitForgeTypeId FractionalInches { get; }
|
||||
IRevitForgeTypeId Feet { get; }
|
||||
IRevitForgeTypeId FeetFractionalInches { get; }
|
||||
}
|
||||
|
||||
public interface IRevitPlaneUtils
|
||||
{
|
||||
IRevitPlane CreateByOriginAndBasis(IRevitXYZ center, IRevitXYZ xDirection, IRevitXYZ yDirection);
|
||||
IRevitPlane CreateByNormalAndOrigin(IRevitXYZ normal, IRevitXYZ center);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
#pragma warning disable CA1040
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitUnits
|
||||
public interface IRevitUnits : IRevitObject
|
||||
{
|
||||
IRevitFormatOptions GetFormatOptions(IRevitForgeTypeId length);
|
||||
}
|
||||
|
||||
|
||||
#pragma warning restore CA1040
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitWall : IRevitHostObject
|
||||
{
|
||||
IRevitCurtainGrid CurtainGrid { get; }
|
||||
bool IsStackedWall { get; }
|
||||
IList<IRevitElementId> GetStackedWallMemberIds();
|
||||
IRevitWallType WallType { get; }
|
||||
bool Flipped { get; }
|
||||
IRevitElementId SketchId { get; }
|
||||
}
|
||||
|
||||
public interface IRevitWallType : IRevitElementType;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Speckle.Revit.Interfaces;
|
||||
|
||||
public interface IRevitXYZ
|
||||
public interface IRevitXYZ : IRevitObject
|
||||
{
|
||||
double Z { get; }
|
||||
|
||||
@@ -8,4 +8,32 @@ public interface IRevitXYZ
|
||||
|
||||
double X { get; }
|
||||
double DistanceTo(IRevitXYZ source);
|
||||
|
||||
IRevitXYZ Multiply(double value);
|
||||
IRevitXYZ Divide(double value);
|
||||
IRevitXYZ Add(IRevitXYZ source);
|
||||
IRevitXYZ Subtract(IRevitXYZ source);
|
||||
IRevitXYZ Normalize();
|
||||
double AngleOnPlaneTo(IRevitXYZ right, IRevitXYZ normal);
|
||||
IRevitXYZ Negate();
|
||||
}
|
||||
|
||||
public interface IRevitBoundingBoxXYZ
|
||||
{
|
||||
IRevitXYZ Min { get; }
|
||||
IRevitXYZ Max { get; }
|
||||
IRevitTransform Transform { get; }
|
||||
}
|
||||
|
||||
public interface IRevitXYZUtils
|
||||
{
|
||||
IRevitXYZ Zero { get; }
|
||||
IRevitXYZ BasisX { get; }
|
||||
IRevitXYZ BasisY { get; }
|
||||
IRevitXYZ BasisZ { get; }
|
||||
}
|
||||
|
||||
public interface IRevitElementIdUtils
|
||||
{
|
||||
IRevitElementId InvalidElementId { get; }
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user