Skip to content

Commit

Permalink
Merge pull request #3 from chuongmep/dev
Browse files Browse the repository at this point in the history
add first test release
  • Loading branch information
chuongmep authored Jan 24, 2023
2 parents 09f89fc + 0355474 commit daab86b
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 6 deletions.
1 change: 1 addition & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
Expand Down
10 changes: 9 additions & 1 deletion DeployInstaller/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const string outputName = "OpenMEP";
string folderPackageName = "OpenMEP";
const string outputDir = "output";
string Version = $"1.0.{GetLastTwoDigitOfYear()}.{GetDayInYear()}";
string Version = $"1.0.{GetLastTwoDigitOfYear()}.{GetDayInYear()}{GetDay()}";
var fileName = new StringBuilder().Append(outputName).Append("-").Append(Version);

var project = new Project
Expand Down Expand Up @@ -140,4 +140,12 @@ string GetLastTwoDigitOfYear()
return now.Year.ToString().Substring(2, 2);
}

string GetDay()
{
int hour = DateTime.Now.Hour;
int minute = DateTime.Now.Minute;
string Sub = hour + minute.ToString();
return Sub;
}


3 changes: 3 additions & 0 deletions OpenMEP/OpenMEP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynamoVersion).*">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="DynamoVisualProgramming.Revit" Version="$(DynamoVersion).*">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
Expand Down
36 changes: 36 additions & 0 deletions OpenMEP/Utils/FamilyUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Autodesk.Revit.DB;

namespace Utils;

public class FamilyUtils
{
private FamilyUtils(){}

public static void ConvertFamilyToFaceHostBased(Autodesk.Revit.DB.Document doc,int familyId)
{
using Transaction tran = new Autodesk.Revit.DB.Transaction (doc, "convert");
tran.Start();
Autodesk.Revit.DB.FamilyUtils.ConvertFamilyToFaceHostBased(doc,new ElementId(familyId));
tran.Commit();
}

public static void FamilyCanConvertToFaceHostBased(Autodesk.Revit.DB.Document doc,int familyId)
{
using Transaction tran = new Autodesk.Revit.DB.Transaction (doc, "convert");
tran.Start();
Autodesk.Revit.DB.FamilyUtils.FamilyCanConvertToFaceHostBased(doc,new ElementId(familyId));
tran.Commit();
}

// public static IEnumerable<Element> GetProfileSymbols(Autodesk.Revit.DB.Document doc,ProfileFamilyUsage profileFamilyUsage,bool oneCurveLoopOnly)
// {
// using Transaction tran = new Autodesk.Revit.DB.Transaction (doc, "convert");
// tran.Start();
// ICollection<ElementId> profileSymbols = Autodesk.Revit.DB.FamilyUtils.GetProfileSymbols(doc,profileFamilyUsage,oneCurveLoopOnly);
// foreach (ElementId elementId in profileSymbols)
// {
// yield return doc.GetElement(elementId).ToDSType(true);
// }
// tran.Commit();
// }
}
34 changes: 34 additions & 0 deletions OpenMEP/Utils/LabelUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Autodesk.Revit.DB.Structure;

namespace Utils;

public class LabelUtils
{
private LabelUtils()
{

}

/// <summary>
/// Gets the user-visible name for a BuiltInParameter.
/// </summary>
/// <param name="builtInParameter">The BuiltInParameter to get the user-visible name.</param>
/// <returns name="label">label of BuiltInParameter </returns>
/// <remarks>The name is obtained in the current Revit language</remarks>
public static string GetLabelFor(Autodesk.Revit.DB.BuiltInParameter builtInParameter)
{
string label = Autodesk.Revit.DB.LabelUtils.GetLabelFor(builtInParameter);
return label;
}

/// <summary>
/// Gets the user-visible name for a BuiltInCategory.
/// </summary>
/// <param name="builtInCategory">The BuiltInCategory to get the user-visible name.</param>
/// <returns name="label">The name is obtained in the current Revit language</returns>
public static string GetLabelFor(Autodesk.Revit.DB.BuiltInCategory builtInCategory)
{
string label = Autodesk.Revit.DB.LabelUtils.GetLabelFor(builtInCategory);
return label;
}
}
25 changes: 25 additions & 0 deletions OpenMEP/Utils/ParameterUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Autodesk.Revit.DB;

namespace Utils;

public class ParameterUtils
{
private ParameterUtils()
{

}

#if R22 || R23
/// <summary>
/// Gets the BuiltInParameter value corresponding to built-in parameter identified by the given ForgeTypeId.
/// </summary>
/// <returns>The BuiltInParameter value corresponding to the given parameter identifier.</returns>
/// <param name="forgeTypeId">The parameter identifier.</param>
public static dynamic GetBuiltInParameter(ForgeTypeId forgeTypeId)
{
BuiltInParameter builtInParameter = Autodesk.Revit.DB.ParameterUtils.GetBuiltInParameter(forgeTypeId);
return builtInParameter;
}
#endif

}
3 changes: 3 additions & 0 deletions OpenMEP/Utils/UnitUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Autodesk.Revit.DB;
using RevitServices.Persistence;

namespace Utils;

Expand All @@ -19,6 +20,7 @@ private UnitUtils()
//
// UnitUtils.GetSymbolTypeId()
//

// UnitUtils.GetUnitSymbolType()
}

Expand All @@ -32,6 +34,7 @@ private UnitUtils()
/// <returns name="value">The converted value.</returns>
public static double Convert(double value,ForgeTypeId currentUnitTypeId,ForgeTypeId desiredUnitTypeId)
{

double convert = Autodesk.Revit.DB.UnitUtils.Convert(value, currentUnitTypeId, desiredUnitTypeId);
return convert;
}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Open MEP

# Description

# About

3 changes: 1 addition & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,12 @@ class Build : NukeBuild
var newRelease = new NewRelease(version)
{
Name = version,
// Body = CreateChangelog(version),
//Body = CreateChangelog(version),
Draft = true,
TargetCommitish = GitVersion.Sha,
GenerateReleaseNotes = true,
};
var draft = CreatedDraft(gitHubOwner, gitHubName, newRelease);
UploadArtifacts(draft, artifacts);
ReleaseDraft(gitHubOwner, gitHubName, draft);
Expand Down
3 changes: 1 addition & 2 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<NukeTelemetryVersion>1</NukeTelemetryVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.2.1" />
<PackageReference Include="Octokit" Version="4.0.2" />
<PackageReference Include="Nuke.Common" Version="6.3.0" />
<PackageReference Include="vswhere" Version="2.*" />
<PackageDownload Include="GitVersion.Tool" Version="[5.8.1]" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.0",
"version": "6.*",
"rollForward": "latestMinor",
"allowPrerelease": true
}
Expand Down

0 comments on commit daab86b

Please sign in to comment.