<?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 Re: Adding couplings to pipe. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587925#M73143</link>
    <description>Dear Anusha, what is the problem of your code for slanted or vertical pipes? would you please upload some screenshot?</description>
    <pubDate>Mon, 13 Apr 2015 05:19:44 GMT</pubDate>
    <dc:creator>Aaron.Lu</dc:creator>
    <dc:date>2015-04-13T05:19:44Z</dc:date>
    <item>
      <title>Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5564601#M73142</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'FrutigerNextW04-Regular',serif; font-size: 10.5pt;"&gt;The below code is splitting the pipe and adding the coupling perfectly, if the line is straight.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'FrutigerNextW04-Regular',serif; font-size: 10.5pt;"&gt;Offset is going to negative side, and the pipe diameter is always showing as 200m in the Revit, if i check in the application the pipe diameter is same as the original pipe. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'FrutigerNextW04-Regular',serif; font-size: 10.5pt;"&gt;Please can anyone suggest me, how to work if the pipe is having any angles or the pipe is vertical.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'FrutigerNextW04-Regular',serif; font-size: 10.5pt;"&gt;Thank you very much in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// code&lt;/P&gt;&lt;P&gt;FilteredElementCollector collector = new FilteredElementCollector(doc);&lt;BR /&gt;collector.OfClass(typeof(PipeType));&lt;BR /&gt;PipeType pipeType = collector.FirstElement() as PipeType;&lt;/P&gt;&lt;P&gt;Selection sel = uidoc.Selection;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Element e in sel.Elements)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pipe c = e as Pipe;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (null != c)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pipes.Add(c);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (2 == pipes.Count)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tx.Start("split pipe");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Curve c1 = (pipes[0].Location as LocationCurve).Curve;// selecting one pipe and taking its location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ p00 = c1.GetEndPoint(0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ p01 = c1.GetEndPoint(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // finding thte length of the selected pipe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double len = pipes[0].get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH).AsDouble();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; len = len / 2;&amp;nbsp; //dividing the length.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // creatin first pipe&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;XYZ q0 = p00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ q1 = p01 - len * XYZ.BasisX;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Pipe pipe = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (null != pipeType)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pipe = doc.Create.NewPipe(q0, q1, pipeType);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// creatin first pipe&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;XYZ q2 = p01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ q3 = p01 - (len - 1) * XYZ.BasisX;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pipe pipe1 = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (null != pipeType)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pipe1 = doc.Create.NewPipe(q2, q3, pipeType);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Connector pipe2_start = null;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Connector pipe2_end = null;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double dist = double.MaxValue;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Connector c in pipe.ConnectorManager.Connectors)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ p = c.Origin;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double d = p.DistanceTo(q1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (d &amp;lt; dist)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist = d;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pipe2_start = c;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Connector conn in pipe1.ConnectorManager.Connectors)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (conn.Origin.IsAlmostEqualTo(q3))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pipe2_end = conn;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FamilyInstance takeoff = doc.Create.NewUnionFitting(pipe2_start, pipe2_end);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DeleteElement(doc, pipes[0]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tx.Commit();&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 07:29:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5564601#M73142</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-31T07:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587925#M73143</link>
      <description>Dear Anusha, what is the problem of your code for slanted or vertical pipes? would you please upload some screenshot?</description>
      <pubDate>Mon, 13 Apr 2015 05:19:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587925#M73143</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-04-13T05:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587931#M73144</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;code is not working for both Vertical and slant pipes.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am attaching the screen shot.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 05:31:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587931#M73144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-13T05:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587952#M73145</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i am facing different issue. Like pipe may be in any direction its spliting, But the pipe location is moving to some other location.&lt;/P&gt;&lt;P&gt;I am doing like this,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can any one help me to solve this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code:&lt;/P&gt;&lt;P&gt;Curve &lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;c1 = (pipes[0].Location &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Consolas" color="#0000ff"&gt;&lt;FONT size="2" face="Consolas" color="#0000ff"&gt;&lt;FONT size="2" face="Consolas" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT size="2" face="Consolas" color="#2b91af"&gt;&lt;FONT size="2" face="Consolas" color="#2b91af"&gt;&lt;FONT size="2" face="Consolas" color="#2b91af"&gt;LocationCurve&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Consolas"&gt;&lt;FONT size="2" face="Consolas"&gt;).Curve;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;XYZ &lt;FONT size="2" face="Consolas"&gt;&lt;FONT size="2" face="Consolas"&gt;p00 = c1.GetEndPoint(1) - c1.GetEndPoint(0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;q0 = p00;&lt;/P&gt;&lt;P&gt;q1 = q0 + m_divide_val * p00.Normalize();&lt;/P&gt;&lt;P&gt;m_pipes = CreateNewPipe(m_document, q0, q1);&lt;/P&gt;&lt;P&gt;p00 += ((m_divide_val + .5) * p00.Normalize());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here i am substracting the end location with the start location, because of this only the pipe location is moving after creating new pipe.&lt;/P&gt;&lt;P&gt;I have attached the output of my code&amp;nbsp;for refrence..&lt;/P&gt;&lt;P&gt;Please provide me solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 06:14:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5587952#M73145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-13T06:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590543#M73146</link>
      <description>1. Does the old problem still exist?&lt;BR /&gt;2. What is the problem of new problem? or, whichi image is the expected result? after*.JPG or A_*.JPG?</description>
      <pubDate>Tue, 14 Apr 2015 04:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590543#M73146</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-04-14T04:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590565#M73147</link>
      <description>&lt;P&gt;Thank you very much for the reply..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Still the old problem existing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1)If i use the below code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;XYZ &lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;p00 = c1.GetEndPoint(0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;for&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(i = 0; i &amp;lt; final_count; i++)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;//creating pipes based on the location of current pipe.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;q0 = p00;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;q1 = q0 + m_divide_val * &lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.BasisX;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;m_pipes = CreateNewPipe(m_document, q0, q1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;p00 += ((m_divide_val + .5) *&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.BasisX);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" face="Consolas" color="#3366ff"&gt;&lt;FONT size="2" face="Consolas"&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in floor plan view, its working for only Horizantal pipes. If i have to work with vertical and Slope pipes how to modify the above code?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2)And if use the below code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;XYZ &lt;FONT size="2" face="Consolas"&gt;&lt;FONT size="2" face="Consolas"&gt;p00 = c1.GetEndPoint(1) - c1.GetEndPoint(0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;p00.Normalize();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;for&lt;FONT size="2" face="Consolas"&gt;&lt;FONT size="2" face="Consolas"&gt;(i = 0; i &amp;lt; final_count; i++)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; q0 = p00;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; q1 = q0 + m_divide_val * p00.Normalize();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; m_pipes = CreateNewPipe(m_document, q0, q1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp; p00 += ((m_divide_val + .5) * p00.Normalize());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Newly created pipes are shifting to the other location as shown in the after_runningcode_H.JPG and A_runningcode_S.jpg.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" face="Consolas"&gt;after_runningcode_H.JPG and A_runningcode_S.jpg are the output of the code.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Beforerunningcode_Horizantal is the original location of the pipe.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the code&lt;STRONG&gt; m_divide_val &lt;/STRONG&gt;is the lenght of the original pipe&amp;nbsp;is divided the length by 1000, and i am creating the each pipe of the 1000 mm.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 05:12:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590565#M73147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-14T05:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590571#M73148</link>
      <description>&lt;P&gt;Please find the attached screens for the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;XYZ &lt;FONT face="Consolas" size="2"&gt;p00 = c1.GetEndPoint(0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;for&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(i = 0; i &amp;lt; final_count; i++)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;//creating pipes based on the location of current pipe.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;q0 = p00;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;q1 = q0 + m_divide_val * &lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.BasisX;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;m_pipes = CreateNewPipe(m_document, q0, q1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366ff"&gt;p00 += ((m_divide_val + .5) *&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.BasisX);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" face="Consolas" color="#3366ff"&gt;&lt;FONT size="2" face="Consolas"&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A_running_H is the output after running the code.&lt;/P&gt;&lt;P&gt;B_running_H is the output before running the code.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 05:17:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590571#M73148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-14T05:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590591#M73149</link>
      <description>Ok, I finally got u.&lt;BR /&gt;&lt;BR /&gt;It is a problem of your algorithm. and I think what you need is this:&lt;BR /&gt;&lt;BR /&gt;    var startPoint = c1.GetEndPoint(0);&lt;BR /&gt;    var midPoint = c1.Evaluate(len / 2, false); //whatever length here&lt;BR /&gt;    var endPoint = c1.GetEndPoint(1);</description>
      <pubDate>Tue, 14 Apr 2015 05:37:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590591#M73149</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-04-14T05:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590597#M73150</link>
      <description>&lt;P&gt;Thank you very much for the solution....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll try this.. Amd i'll let you know the result..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thnaks a lot...&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2015 05:44:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5590597#M73150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-14T05:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5594688#M73151</link>
      <description>&lt;P&gt;Hi Aaron.Lu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var startPoint = c1.GetEndPoint(0);&lt;BR /&gt;var midPoint = c1.Evaluate(len / 2, false); //whatever length here&lt;BR /&gt;var endPoint = c1.GetEndPoint(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you plaese brief these code, i am not understanding properly,&lt;/P&gt;&lt;P&gt;I am new to this Revit API..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance..&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2015 10:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5594688#M73151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-16T10:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5594694#M73152</link>
      <description>c1.Evaluate(length, false) is to get a point with the distance "length" to the start point of the curve, so you want to get 1000mm distance point to the start point, you can use c1.Evaluate(1000 * 0.0032808, false).&lt;BR /&gt;for 2000, use c1.Evaluate(2000 * 0.0032808, false).&lt;BR /&gt;&lt;BR /&gt;is it helpful?</description>
      <pubDate>Thu, 16 Apr 2015 10:05:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5594694#M73152</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-04-16T10:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5601052#M73153</link>
      <description>&lt;P&gt;Hi As you suggested i&amp;nbsp;tried.. And i got proper output also..&lt;/P&gt;&lt;P&gt;Thank you very much.. I am very happy..&lt;/P&gt;&lt;P&gt;Thanks a lot....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 11:29:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5601052#M73153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-21T11:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5601155#M73154</link>
      <description>&lt;P&gt;Thank you Aaron.Lu&amp;nbsp;..&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 12:42:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5601155#M73154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-21T12:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding couplings to pipe.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5601157#M73155</link>
      <description>You are welcome, Glad to see it works!</description>
      <pubDate>Tue, 21 Apr 2015 12:44:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-couplings-to-pipe/m-p/5601157#M73155</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2015-04-21T12:44:33Z</dc:date>
    </item>
  </channel>
</rss>

