123456789101112131415161718192021222324252627282930313233 |
- using System;
- using Autodesk.Revit.DB;
- using Autodesk.Revit.DB.Plumbing;
- using Autodesk.Revit.UI.Selection;
- using SAGA.RevitUtils.Extends;
- namespace SAGA.RevitUtils.MEP
- {
- public class VerPipeFilter : ISelectionFilter
- {
- public bool AllowElement(Element elem)
- {
- bool flag = false;
- if (elem.GetCategory() != BuiltInCategory.OST_PipeCurves)
- {
- return flag;
- }
- Pipe pipe = elem as Pipe;
- if (pipe == null)
- {
- return flag;
- }
- Line curve = pipe.Location.GetLine();
- return (curve.StartPoint().NewZ(0.0).IsEqual2(curve.EndPoint().NewZ(0.0), 0.0) && (Math.Abs((double) (curve.StartPoint().Z - curve.EndPoint().Z)).FromApi() >= -1.0));
- }
- public bool AllowReference(Reference reference, XYZ position)
- {
- return true;
- }
- }
- }
|