<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to Disregard Pipes that are Vertical in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489475#M16214</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a FilteredElementCollector finding all pipes in the model. I would like to disregarded pipes that are vertical/have a slope equal to "Not Computed". What is the best way to achieve this?&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public Result Execute(ExternalCommandData edata, ref string message, ElementSet elements)
        {
            UIDocument uidoc = edata.Application.ActiveUIDocument;
            Document doc = uidoc.Document;

            Transaction t = new Transaction(doc, "Auto Trench");
            t.Start();

            // Find all Pipes in Model
            FilteredElementCollector pipes = new FilteredElementCollector(uidoc.Document);
            List&amp;lt;Pipe&amp;gt; pipeList = pipes.OfClass(typeof(Pipe)).OfType&amp;lt;Pipe&amp;gt;().ToList();&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aciavardini_1-1666065572953.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1128566i9C35FC5C1D999D3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aciavardini_1-1666065572953.png" alt="aciavardini_1-1666065572953.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 04:03:45 GMT</pubDate>
    <dc:creator>aciavardini</dc:creator>
    <dc:date>2022-10-18T04:03:45Z</dc:date>
    <item>
      <title>How to Disregard Pipes that are Vertical</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489475#M16214</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a FilteredElementCollector finding all pipes in the model. I would like to disregarded pipes that are vertical/have a slope equal to "Not Computed". What is the best way to achieve this?&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public Result Execute(ExternalCommandData edata, ref string message, ElementSet elements)
        {
            UIDocument uidoc = edata.Application.ActiveUIDocument;
            Document doc = uidoc.Document;

            Transaction t = new Transaction(doc, "Auto Trench");
            t.Start();

            // Find all Pipes in Model
            FilteredElementCollector pipes = new FilteredElementCollector(uidoc.Document);
            List&amp;lt;Pipe&amp;gt; pipeList = pipes.OfClass(typeof(Pipe)).OfType&amp;lt;Pipe&amp;gt;().ToList();&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aciavardini_1-1666065572953.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1128566i9C35FC5C1D999D3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aciavardini_1-1666065572953.png" alt="aciavardini_1-1666065572953.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 04:03:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489475#M16214</guid>
      <dc:creator>aciavardini</dc:creator>
      <dc:date>2022-10-18T04:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Disregard Pipes that are Vertical</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489597#M16215</link>
      <description>&lt;P&gt;All pipes are driven from a Linework. if you extracted the line from the pipe and checked its Z direction against 1, then you will be able to filter that out ... see the below code if does help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (Pipe pipe in pipeList)
{
    var pipeCurve = pipe.Location as LocationCurve;
    var pipeLine = pipeCurve.Curve as Line;
    if (pipeLine.Direction.Z == 1) continue;

    //do my stuff to not 100% vertical Pipes
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Oct 2022 06:16:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489597#M16215</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2022-10-18T06:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to Disregard Pipes that are Vertical</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489658#M16216</link>
      <description>&lt;P&gt;Thanks to Mostafa for one initial approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you choose to follow that suggestion, I would definitely add some fuzz, i.e., compare the Z direction to be &lt;U&gt;almost&lt;/U&gt; equal to 1.0, not exactly equal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2022/08/instances-in-room-and-need-for-fuzz.html#3" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2022/08/instances-in-room-and-need-for-fuzz.html#3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This kind of comparison requires post-processing of the filtered element collector results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can check the verticality or the slope not computed property up front using existing properties or parameters on the pipe elements, you might be able to replace the post-processing by significantly faster quick or slow filters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, depending on your requirements, the post-processing might be perfectly acceptable, and it is probably the easiest approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 06:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11489658#M16216</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-10-18T06:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Disregard Pipes that are Vertical</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11620389#M16217</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11318643"&gt;@aciavardini&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;This is another approach, maybe more performant:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Parameter slopeParam = pipe.get_Parameter(BuiltInParameter.RBS_PIPE_SLOPE);
if (slopeParam.HasValue)  
{
	//Do something 
}
else
{
	//Do another thing on pipes with parameter slope "Not Computed"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I did a few tests and it appears that "Not computed" pipes always have this parameter property set to false.&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11318643"&gt;@aciavardini&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:40:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-disregard-pipes-that-are-vertical/m-p/11620389#M16217</guid>
      <dc:creator>rtg.dev015A9H9</dc:creator>
      <dc:date>2022-12-14T16:40:22Z</dc:date>
    </item>
  </channel>
</rss>

