Skip to content

Commit 024cd75

Browse files
committed
Merge branch 'dev'
2 parents 0e68d69 + 2d3d47c commit 024cd75

38 files changed

+2125
-105
lines changed

OpenMEP.sln

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
1010
docs\pkg.json = docs\pkg.json
1111
CHANGELOG.md = CHANGELOG.md
1212
docs\OpenMEP_DynamoCustomization.xml = docs\OpenMEP_DynamoCustomization.xml
13+
docs\OpenMEPSandbox_DynamoCustomization.xml = docs\OpenMEPSandbox_DynamoCustomization.xml
1314
EndProjectSection
1415
EndProject
1516
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeployInstaller", "DeployInstaller\DeployInstaller.csproj", "{C7835EFE-E1C7-48B2-90D0-E943D43A905D}"
@@ -18,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "build\_build.cspr
1819
EndProject
1920
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenMEPTest", "OpenMEPTest\OpenMEPTest.csproj", "{C4A7A7CC-2B34-4359-B16E-F8F2082CB840}"
2021
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenMEPSandbox", "OpenMEPSandbox\OpenMEPSandbox.csproj", "{5FDD66F2-49B5-4896-B6FB-79B1CC457904}"
23+
EndProject
2124
Global
2225
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2326
Debug R20|Any CPU = Debug R20|Any CPU
@@ -87,5 +90,25 @@ Global
8790
{C4A7A7CC-2B34-4359-B16E-F8F2082CB840}.Release R23|Any CPU.ActiveCfg = Debug|Any CPU
8891
{C4A7A7CC-2B34-4359-B16E-F8F2082CB840}.Release R23.1|Any CPU.ActiveCfg = Debug|Any CPU
8992
{C4A7A7CC-2B34-4359-B16E-F8F2082CB840}.Installer|Any CPU.ActiveCfg = Debug|Any CPU
93+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R20|Any CPU.ActiveCfg = Debug R20|Any CPU
94+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R20|Any CPU.Build.0 = Debug R20|Any CPU
95+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R21|Any CPU.ActiveCfg = Debug R21|Any CPU
96+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R21|Any CPU.Build.0 = Debug R21|Any CPU
97+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R22|Any CPU.ActiveCfg = Debug R22|Any CPU
98+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R22|Any CPU.Build.0 = Debug R22|Any CPU
99+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R23|Any CPU.ActiveCfg = Debug R23|Any CPU
100+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R23|Any CPU.Build.0 = Debug R23|Any CPU
101+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R23.1|Any CPU.ActiveCfg = Debug R23.1|Any CPU
102+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Debug R23.1|Any CPU.Build.0 = Debug R23.1|Any CPU
103+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R20|Any CPU.ActiveCfg = Release R20|Any CPU
104+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R20|Any CPU.Build.0 = Release R20|Any CPU
105+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R21|Any CPU.ActiveCfg = Release R21|Any CPU
106+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R21|Any CPU.Build.0 = Release R21|Any CPU
107+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R22|Any CPU.ActiveCfg = Release R22|Any CPU
108+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R22|Any CPU.Build.0 = Release R22|Any CPU
109+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R23|Any CPU.ActiveCfg = Release R23|Any CPU
110+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R23|Any CPU.Build.0 = Release R23|Any CPU
111+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R23.1|Any CPU.ActiveCfg = Release R23.1|Any CPU
112+
{5FDD66F2-49B5-4896-B6FB-79B1CC457904}.Release R23.1|Any CPU.Build.0 = Release R23.1|Any CPU
90113
EndGlobalSection
91114
EndGlobal

OpenMEP/Application/Dynamo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static string Version()
2020
return version.ToString();
2121
}
2222

23-
#if R20
23+
#if R20 || R21
2424
#else
2525
/// <summary>
2626
/// return current file name of script opening

OpenMEP/Element/Fitting.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ private Fitting()
166166
/// </summary>
167167
/// <param name="fitting">fitting to get</param>
168168
/// <returns name="systemtype">system type of fitting</returns>
169+
[NodeCategory("Query")]
169170
public static global::Revit.Elements.Element? SystemType(global::Revit.Elements.Element fitting)
170171
{
171172
Autodesk.Revit.DB.Element element = fitting.InternalElement;
@@ -213,7 +214,7 @@ private Fitting()
213214
// Get Current Unit
214215
FormatOptions units = doc.GetUnits().GetFormatOptions(SpecTypeId.PipeSize);
215216
double value = UnitUtils.ConvertToInternalUnits(radius, units.GetUnitTypeId());
216-
connectors.ForEach(x => x.Radius = value);
217+
connectors.ForEach(x => x!.Radius = value);
217218
TransactionManager.Instance.TransactionTaskDone();
218219
return fitting;
219220
}

OpenMEP/Element/FlexPipe.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Autodesk.Revit.DB;
2+
using Dynamo.Graph.Nodes;
23
using OpenMEP.Helpers;
34
using Revit.GeometryConversion;
45
using RevitServices.Persistence;
@@ -109,6 +110,7 @@ private FlexPipe()
109110
/// The set operation will fail if the modification makes the connection invalid.
110111
/// </remarks>
111112
///<returns name="points">list point of flex pipe</returns>
113+
[NodeCategory("Query")]
112114
public static List<Autodesk.DesignScript.Geometry.Point> Points(Autodesk.Revit.DB.Plumbing.FlexPipe flexPipe)
113115
{
114116
return flexPipe.Points.Select(x=>x.ToPoint()).ToList();

OpenMEP/Element/Insulation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ private Insulation()
5959
/// </summary>
6060
/// <param name="element">the element to check</param>
6161
/// <returns name="bool">true if element is insulation</returns>
62+
[NodeCategory("Query")]
6263
public bool IsAddInsulationOrLining(Revit.Elements.Element element)
6364
{
6465
Autodesk.Revit.DB.Element e = element.InternalElement;

OpenMEP/Element/Pipe.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ Autodesk.DesignScript.Geometry.Point point
508508
/// </summary>
509509
/// <param name="pipe">pipe to get</param>
510510
/// <returns name="systemtype">system type of pipe</returns>
511+
[NodeCategory("Query")]
511512
public static global::Revit.Elements.Element? SystemType(global::Revit.Elements.Element pipe)
512513
{
513514
if (pipe == null) throw new ArgumentNullException(nameof(pipe));
@@ -601,6 +602,7 @@ public static double GetRoughness(global::Revit.Elements.Element pipe)
601602
/// </summary>
602603
/// <param name="pipe">pipe to get shape</param>
603604
/// <returns name="connectorProfileType">connectorProfileType</returns>
605+
[NodeCategory("Query")]
604606
public static dynamic? Shape(global::Revit.Elements.Element pipe)
605607
{
606608
Autodesk.Revit.DB.Plumbing.Pipe? pipeInternalElement = pipe.InternalElement as Autodesk.Revit.DB.Plumbing.Pipe;
@@ -616,6 +618,7 @@ public static double GetRoughness(global::Revit.Elements.Element pipe)
616618
///<remarks>
617619
/// If the curve does not belong to any systems, the value will be <see langword="null" />.
618620
/// If the curve belongs to more than one system, the first available value is returned. </remarks>
621+
[NodeCategory("Query")]
619622
public static global::Revit.Elements.Element? MEPSystem(global::Revit.Elements.Element pipe)
620623
{
621624
Autodesk.Revit.DB.Plumbing.Pipe? pipeInternalElement = pipe.InternalElement as Autodesk.Revit.DB.Plumbing.Pipe;

OpenMEP/Geometry/Point.cs

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,9 @@
1-
using Autodesk.Revit.DB;
2-
3-
namespace OpenMEP.Geometry;
1+
namespace OpenMEP.Geometry;
42

53
public class Point
64
{
75
private Point()
86
{
97

108
}
11-
12-
/// <summary>
13-
/// Project a point onto a plane
14-
/// </summary>
15-
/// <param name="point">point need to project</param>
16-
/// <param name="planeNormal">vector normal of plane</param>
17-
/// <returns name="point">new point projected on plane</returns>
18-
public static Autodesk.DesignScript.Geometry.Point ProjectOntoPlane(
19-
Autodesk.DesignScript.Geometry.Point point,
20-
Autodesk.DesignScript.Geometry.Vector planeNormal )
21-
{
22-
double a = planeNormal.X;
23-
double b = planeNormal.Y;
24-
double c = planeNormal.Z;
25-
26-
double dx = ( b * b + c * c ) * point.X - ( a * b ) * point.Y - ( a * c ) * point.Z;
27-
double dy = -( b * a ) * point.X + ( a * a + c * c ) * point.Y - ( b * c ) * point.Z;
28-
double dz = -( c * a ) * point.X - ( c * b ) * point.Y + ( a * a + b * b ) * point.Z;
29-
return Autodesk.DesignScript.Geometry.Point.ByCoordinates( dx, dy, dz );
30-
}
31-
32-
/// <summary>
33-
/// Get the centroid of a list of points
34-
/// </summary>
35-
/// <param name="points">list of points</param>
36-
/// <returns name="point">centroid</returns>
37-
public static Autodesk.DesignScript.Geometry.Point Centroid( List<Autodesk.DesignScript.Geometry.Point> points )
38-
{
39-
double x = 0;
40-
double y = 0;
41-
double z = 0;
42-
foreach ( Autodesk.DesignScript.Geometry.Point point in points )
43-
{
44-
x += point.X;
45-
y += point.Y;
46-
z += point.Z;
47-
}
48-
return Autodesk.DesignScript.Geometry.Point.ByCoordinates( x / points.Count, y / points.Count, z / points.Count );
49-
}
509
}

OpenMEP/Helpers/Convert.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Reflection;
22
using Autodesk.DesignScript.Runtime;
33
using Autodesk.Revit.DB;
4+
using GShark.Geometry;
45
using Revit.Elements;
56
using Revit.GeometryConversion;
67
using RevitServices.Persistence;
8+
using Arc = Autodesk.Revit.DB.Arc;
79
using dynCategory = Revit.Elements.Category;
810
using dynDocument = Revit.Application.Document;
911
using dynElement = Revit.Elements.Element;
@@ -13,13 +15,16 @@
1315
using dynFamilyParameter = Revit.Elements.FamilyParameter;
1416
#endif
1517
using dynParameter = Revit.Elements.Parameter;
18+
using Line = Autodesk.Revit.DB.Line;
19+
using Plane = Autodesk.Revit.DB.Plane;
1620
using Point = Autodesk.DesignScript.Geometry.Point;
1721
using rvtCategory = Autodesk.Revit.DB.Category;
1822
using rvtDocument = Autodesk.Revit.DB.Document;
1923
using rvtElement = Autodesk.Revit.DB.Element;
2024
using rvtFamilyParameter = Autodesk.Revit.DB.FamilyParameter;
2125
using rvtParameter = Autodesk.Revit.DB.Parameter;
2226
using Surface = Autodesk.DesignScript.Geometry.Surface;
27+
using Vector = Autodesk.DesignScript.Geometry.Vector;
2328

2429
namespace OpenMEP.Helpers
2530
{
@@ -426,5 +431,38 @@ internal static IEnumerable<Surface> ToDynamoType(this Face item)
426431
IEnumerable<Surface> surfaces = item.ToProtoType();
427432
return surfaces;
428433
}
434+
435+
internal static Autodesk.DesignScript.Geometry.Vector ToDynamoType(this GShark.Geometry.Vector3 vector3)
436+
{
437+
return Autodesk.DesignScript.Geometry.Vector.ByCoordinates(vector3.X, vector3.Y, vector3.Z);
438+
}
439+
internal static GShark.Geometry.Vector3 ToGSharkType(this Autodesk.DesignScript.Geometry.Vector vector)
440+
{
441+
return new Vector3(vector.X, vector.Y, vector.Z);
442+
}
443+
internal static Autodesk.DesignScript.Geometry.Point ToDynamoType(this Point3 point3)
444+
{
445+
return Autodesk.DesignScript.Geometry.Point.ByCoordinates(point3.X, point3.Y, point3.Z);
446+
}
447+
internal static Point3 ToGSharkType(this Autodesk.DesignScript.Geometry.Point point)
448+
{
449+
return new Point3(point.X, point.Y, point.Z);
450+
}
451+
internal static Autodesk.DesignScript.Geometry.Line ToDynamoType(this GShark.Geometry.Line line)
452+
{
453+
return Autodesk.DesignScript.Geometry.Line.ByStartPointEndPoint(ToDynamoType(line.StartPoint), ToDynamoType(line.EndPoint));
454+
}
455+
internal static GShark.Geometry.Line ToGSharkType(this Autodesk.DesignScript.Geometry.Line line)
456+
{
457+
return new GShark.Geometry.Line(ToGSharkType(line.StartPoint), ToGSharkType(line.EndPoint));
458+
}
459+
internal static Autodesk.DesignScript.Geometry.Plane ToDynamoType(this GShark.Geometry.Plane plane)
460+
{
461+
return Autodesk.DesignScript.Geometry.Plane.ByOriginNormal(plane.Origin.ToDynamoType(), plane.ZAxis.ToDynamoType());
462+
}
463+
internal static GShark.Geometry.Plane ToGSharkType(this Autodesk.DesignScript.Geometry.Plane plane)
464+
{
465+
return new GShark.Geometry.Plane(plane.Origin.ToGSharkType(), plane.Normal.ToGSharkType());
466+
}
429467
}
430468
}

OpenMEP/OpenMEP.csproj

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>true</ImplicitUsings>
7+
<AssemblyVersion>1.0.0.*</AssemblyVersion>
78
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
89
<LangVersion>latest</LangVersion>
910
<UseWPF>true</UseWPF>
1011
<RootNamespace>OpenMEP</RootNamespace>
1112
<AssemblyName>OpenMEP</AssemblyName>
1213
<PlatformTarget>x64</PlatformTarget>
13-
<AssemblyVersion>1.0.0.*</AssemblyVersion>
1414
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1515
<Configurations>Debug R20;Debug R21;Debug R22;Debug R23;Debug R23.1</Configurations>
1616
<Configurations>$(Configurations);Release R20;Release R21;Release R22;Release R23;Release R23.1</Configurations>
17-
<NoWarn>CS1591;CS0168;CS8618;CS1591;CS0419</NoWarn>
17+
<NoWarn>CS1591;CS0168;CS8618;CS1591;CS0419;MSB3277</NoWarn>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="$(Configuration.Contains('Debug R20'))">
2020
<DynamoVersion>2.3</DynamoVersion>
@@ -31,15 +31,15 @@
3131
<DefineConstants>$(DefineConstants);R20</DefineConstants>
3232
</PropertyGroup>
3333
<PropertyGroup Condition="$(Configuration.Contains('Debug R21'))">
34-
<DynamoVersion>2.12</DynamoVersion>
34+
<DynamoVersion>2.6</DynamoVersion>
3535
<DynamoOutput>2.6</DynamoOutput>
3636
<RevitVersion>2021</RevitVersion>
3737
<DebugSymbols>true</DebugSymbols>
3838
<DebugType>full</DebugType>
3939
<DefineConstants>$(DefineConstants);R21</DefineConstants>
4040
</PropertyGroup>
4141
<PropertyGroup Condition="$(Configuration.Contains('Release R21'))">
42-
<DynamoVersion>2.12</DynamoVersion>
42+
<DynamoVersion>2.6</DynamoVersion>
4343
<DynamoOutput>2.6</DynamoOutput>
4444
<RevitVersion>2021</RevitVersion>
4545
<DefineConstants>$(DefineConstants);R21</DefineConstants>
@@ -59,29 +59,29 @@
5959
<DefineConstants>$(DefineConstants);R22</DefineConstants>
6060
</PropertyGroup>
6161
<PropertyGroup Condition="$(Configuration.Contains('Debug R23'))">
62-
<DynamoVersion>2.12</DynamoVersion>
62+
<DynamoVersion>2.13</DynamoVersion>
6363
<DynamoOutput>2.13</DynamoOutput>
6464
<RevitVersion>2023</RevitVersion>
6565
<DebugSymbols>true</DebugSymbols>
6666
<DebugType>full</DebugType>
6767
<DefineConstants>$(DefineConstants);R23</DefineConstants>
6868
</PropertyGroup>
69+
<PropertyGroup Condition="$(Configuration.Contains('Release R23'))">
70+
<DynamoVersion>2.13</DynamoVersion>
71+
<DynamoOutput>2.13</DynamoOutput>
72+
<RevitVersion>2023</RevitVersion>
73+
<DefineConstants>$(DefineConstants);R23</DefineConstants>
74+
</PropertyGroup>
6975
<PropertyGroup Condition="$(Configuration.Contains('Debug R23.1'))">
70-
<DynamoVersion>2.12</DynamoVersion>
76+
<DynamoVersion>2.16</DynamoVersion>
7177
<DynamoOutput>2.16</DynamoOutput>
7278
<RevitVersion>2023</RevitVersion>
7379
<DebugSymbols>true</DebugSymbols>
7480
<DebugType>full</DebugType>
7581
<DefineConstants>$(DefineConstants);R23</DefineConstants>
7682
</PropertyGroup>
77-
<PropertyGroup Condition="$(Configuration.Contains('Release R23'))">
78-
<DynamoVersion>2.12</DynamoVersion>
79-
<DynamoOutput>2.13</DynamoOutput>
80-
<RevitVersion>2023</RevitVersion>
81-
<DefineConstants>$(DefineConstants);R23</DefineConstants>
82-
</PropertyGroup>
8383
<PropertyGroup Condition="$(Configuration.Contains('Release R23.1'))">
84-
<DynamoVersion>2.12</DynamoVersion>
84+
<DynamoVersion>2.16</DynamoVersion>
8585
<DynamoOutput>2.16</DynamoOutput>
8686
<RevitVersion>2023</RevitVersion>
8787
<DefineConstants>$(DefineConstants);R23</DefineConstants>
@@ -104,14 +104,14 @@
104104
<PackageReference Include="Chuongmep.Revit.Api.RevitAPIUI" Version="$(RevitVersion).*">
105105
<ExcludeAssets>runtime</ExcludeAssets>
106106
</PackageReference>
107-
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynamoVersion).*">
107+
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynVersion).*">
108108
<ExcludeAssets>runtime</ExcludeAssets>
109109
</PackageReference>
110-
<PackageReference Include="DynamoVisualProgramming.Revit" Version="$(DynamoVersion).*">
110+
<PackageReference Include="DynamoVisualProgramming.Revit" Version="$(DynVersion).*">
111111
<ExcludeAssets>runtime</ExcludeAssets>
112112
</PackageReference>
113113
<Reference Include="System.Net.Http" />
114-
<PackageReference Include="GShark" Version="2.1.0" />
114+
<PackageReference Include="GShark" Version="2.2.0" />
115115
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
116116
</ItemGroup>
117117
<ItemGroup>
@@ -127,6 +127,9 @@
127127
<DependentUpon>OpenMEPImages.resx</DependentUpon>
128128
</Compile>
129129
</ItemGroup>
130+
<ItemGroup>
131+
<ProjectReference Include="..\OpenMEPSandbox\OpenMEPSandbox.csproj" />
132+
</ItemGroup>
130133
<Target Name="CopyFiles" AfterTargets="CoreBuild">
131134
<ItemGroup>
132135
<AssemblyFiles Include="$(TargetDir)*.*" />

0 commit comments

Comments
 (0)