-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
719 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using OpenMEP.Helpers; | ||
using RevitServices.Persistence; | ||
|
||
namespace OpenMEP.Element; | ||
|
||
public class PipeType | ||
{ | ||
private PipeType() | ||
{ | ||
|
||
} | ||
|
||
/// <summary> | ||
/// get pipe type by name | ||
/// </summary> | ||
/// <param name="typeName">type name of pipe</param> | ||
/// <returns></returns> | ||
public static Revit.Elements.Element? GetPipeTypeByName(string typeName) | ||
{ | ||
return GetAllPipeTypes().FirstOrDefault(x => x!.Name == typeName); | ||
} | ||
|
||
/// <summary> | ||
/// return all pipe types of the current document | ||
/// </summary> | ||
/// <returns name="pipeTypes">All Pipe Types</returns> | ||
public static List<Revit.Elements.Element?> GetAllPipeTypes() | ||
{ | ||
// Get all the pipe types in the current document | ||
Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument; | ||
Autodesk.Revit.DB.FilteredElementCollector collector = new Autodesk.Revit.DB.FilteredElementCollector(doc); | ||
Autodesk.Revit.DB.ElementClassFilter filter = new Autodesk.Revit.DB.ElementClassFilter(typeof(Autodesk.Revit.DB.Plumbing.PipeType)); | ||
Autodesk.Revit.DB.FilteredElementIterator iterator = collector.WherePasses(filter).GetElementIterator(); | ||
iterator.Reset(); | ||
List<Revit.Elements.Element?> pipeTypes = new List<Revit.Elements.Element?>(); | ||
while (iterator.MoveNext()) | ||
{ | ||
Autodesk.Revit.DB.Element element = iterator.Current!; | ||
if (element is Autodesk.Revit.DB.Plumbing.PipeType pipeType) | ||
{ | ||
pipeTypes.Add(pipeType.ToDynamoType()); | ||
} | ||
} | ||
return pipeTypes; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
|
||
### Create By Two Point | ||
|
||
|
||
|
||
### Create By Two Connector | ||
|
||
### Create By Line | ||
|
Oops, something went wrong.