<?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 回复： Unable to create elbow fitting via api but able to create via command TR in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208923#M37883</link>
    <description>&lt;P&gt;Well：&lt;/P&gt;&lt;P&gt;I'm telling you that Revit API does not allow elbow connecting between ACUTE angle.&lt;/P&gt;&lt;P&gt;try use the following&lt;/P&gt;&lt;PRE&gt;var angle = conn1.CoordinateSystem.BasisZ.AngleTo(conn2.CoordinateSystem.BasisZ);&lt;/PRE&gt;&lt;P&gt;Check the angle value (it's is Rad unit, which means you should convert it into Degree if it's inconvenient for you to read the value).&lt;/P&gt;&lt;P&gt;In your issue, notice that one conn.BasisZ == (1,0,0).&lt;/P&gt;&lt;P&gt;Remeber that API forbits elbow connection for an "Acute" angle, so the other connector.BasisZ MUST NOT be negative.&lt;/P&gt;&lt;P&gt;Got my point?&lt;/P&gt;&lt;P&gt;In your case, the correct connector pair should be&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;(1,0,0)&lt;/LI&gt;&lt;LI&gt;(0,0,1)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, in you rvt document, if you want to create an elbow, one connector is (1,0,0), and another should be nearly (0,0,1) , but not (0,0,-1) which is the wrong connector.&lt;/P&gt;&lt;P&gt;If I had guessed correctly, pay more attention to the Pick point (you mouse left click point), make sure that the pick point is close to the "NEAR" end of a Pipe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To my experience, 2 issues:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;wrong connector&lt;/LI&gt;&lt;LI&gt;the wrong connector leads to an "ACUTE" angle&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Wed, 18 Dec 2019 09:39:21 GMT</pubDate>
    <dc:creator>jlpgy</dc:creator>
    <dc:date>2019-12-18T09:39:21Z</dc:date>
    <item>
      <title>Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9203950#M37877</link>
      <description>&lt;P&gt;Unable to create elbow fitting via api but able to create via command TR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in revit :&lt;/P&gt;&lt;P&gt;first vertical then horizontal we can add elbow successfully&lt;/P&gt;&lt;P&gt;first&amp;nbsp;horizontal unable to pick the vertical pipe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;attachment is my test rvt file&amp;nbsp;&lt;/P&gt;&lt;P&gt;the vertical pipe has a slope about to 199900%.&lt;/P&gt;&lt;P&gt;but i have to connect this two pipe via api.&lt;/P&gt;&lt;P&gt;any help?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 08:31:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9203950#M37877</guid>
      <dc:creator>1368026189</dc:creator>
      <dc:date>2019-12-16T08:31:23Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9203980#M37878</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;What's your problem?&lt;/P&gt;&lt;P&gt;It's very easy to connect these two Pipes:&lt;/P&gt;&lt;P&gt;I have done this job by typing in codes within 5 minutes.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-12-16_165836.png" style="width: 674px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/708317iB143077D7C50A436/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-12-16_165836.png" alt="2019-12-16_165836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;WHAT IS YOUR PROBLEM?&lt;/P&gt;&lt;P&gt;Having trouble Picking? Or having trouble Connecting?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 09:02:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9203980#M37878</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-12-16T09:02:29Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9204002#M37879</link>
      <description>&lt;P&gt;Hello Jin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You pick hor pipe first or vertical first?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 09:17:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9204002#M37879</guid>
      <dc:creator>1368026189</dc:creator>
      <dc:date>2019-12-16T09:17:56Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9204053#M37880</link>
      <description>&lt;PRE&gt; private UIDocument uidoc;
    private Document doc;
    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
    {


      uidoc = commandData.Application.ActiveUIDocument;

      doc = uidoc.Document;

      var sel = uidoc.Selection;


      var ref01 = sel.PickObject(ObjectType.Element);

      var ref02 = sel.PickObject(ObjectType.Element);


      var pipe01 = doc.GetElement(ref01.ElementId) as Pipe;
      var pipe02 = doc.GetElement(ref02.ElementId) as Pipe;



      var pt01 = ref01.GlobalPoint;
      var pt02 = ref02.GlobalPoint;

      var con01 = MepHelper.GetConnectorClosestTo(pipe01.ConnectorManager.Connectors, pt01);
      var con02 = MepHelper.GetConnectorClosestTo(pipe02.ConnectorManager.Connectors, pt02);


      doc.Create.NewElbowFitting(con01, con02);




      return Result.Succeeded;&lt;/PRE&gt;&lt;P&gt;---------------------------&lt;/P&gt;&lt;P&gt;---------------------------&lt;BR /&gt;Autodesk.Revit.Exceptions.InvalidOperationException: Fitting cannot be created between the input connectors because they are not close enough for intersection.&lt;BR /&gt;在 Autodesk.Revit.Creation.Document.NewElbowFitting(Connector connector1, Connector connector2)&lt;BR /&gt;&amp;nbsp;-------------------------&lt;/P&gt;&lt;P&gt;Hi Jin,&lt;/P&gt;&lt;P&gt;I add a test project and it does not work&amp;nbsp; too!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 09:38:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9204053#M37880</guid>
      <dc:creator>1368026189</dc:creator>
      <dc:date>2019-12-16T09:38:30Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208603#M37881</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;断点在这一行，break point at the following line&lt;/P&gt;&lt;PRE&gt;var con01 = MepHelper.GetConnectorClosestTo(pipe01.ConnectorManager.Connectors, pt01);&lt;/PRE&gt;&lt;P&gt;Step over it.&lt;/P&gt;&lt;P&gt;Check the &lt;STRONG&gt;con01.CoordinateSystem.BasisZ&lt;/STRONG&gt; property.&lt;/P&gt;&lt;P&gt;In the rvt document you supplied, the only possible connector pair should be&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;BasisZ of one connector should be (0, 0, 1)&lt;/LI&gt;&lt;LI&gt;BasisZ of the other should be (0, 1, 0)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 05:29:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208603#M37881</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-12-18T05:29:31Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208808#M37882</link>
      <description>&lt;P&gt;HI jin ,&lt;/P&gt;&lt;P&gt;I got&amp;nbsp;(-0.000625164642542109, 0, -0.999999804584566)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(1,0,0)&lt;/P&gt;&lt;P&gt;and in fact the vertical pipe is not&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;upright , maybe i uploaded a wrong file?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bad pipe.PNG" style="width: 457px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/709113iAF54D44B6AF13095/image-size/large?v=v2&amp;amp;px=999" role="button" title="bad pipe.PNG" alt="bad pipe.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 08:27:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208808#M37882</guid>
      <dc:creator>1368026189</dc:creator>
      <dc:date>2019-12-18T08:27:52Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208923#M37883</link>
      <description>&lt;P&gt;Well：&lt;/P&gt;&lt;P&gt;I'm telling you that Revit API does not allow elbow connecting between ACUTE angle.&lt;/P&gt;&lt;P&gt;try use the following&lt;/P&gt;&lt;PRE&gt;var angle = conn1.CoordinateSystem.BasisZ.AngleTo(conn2.CoordinateSystem.BasisZ);&lt;/PRE&gt;&lt;P&gt;Check the angle value (it's is Rad unit, which means you should convert it into Degree if it's inconvenient for you to read the value).&lt;/P&gt;&lt;P&gt;In your issue, notice that one conn.BasisZ == (1,0,0).&lt;/P&gt;&lt;P&gt;Remeber that API forbits elbow connection for an "Acute" angle, so the other connector.BasisZ MUST NOT be negative.&lt;/P&gt;&lt;P&gt;Got my point?&lt;/P&gt;&lt;P&gt;In your case, the correct connector pair should be&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;(1,0,0)&lt;/LI&gt;&lt;LI&gt;(0,0,1)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides, in you rvt document, if you want to create an elbow, one connector is (1,0,0), and another should be nearly (0,0,1) , but not (0,0,-1) which is the wrong connector.&lt;/P&gt;&lt;P&gt;If I had guessed correctly, pay more attention to the Pick point (you mouse left click point), make sure that the pick point is close to the "NEAR" end of a Pipe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To my experience, 2 issues:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;wrong connector&lt;/LI&gt;&lt;LI&gt;the wrong connector leads to an "ACUTE" angle&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 18 Dec 2019 09:39:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9208923#M37883</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-12-18T09:39:21Z</dc:date>
    </item>
    <item>
      <title>回复： Unable to create elbow fitting via api but able to create via command TR</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9213171#M37884</link>
      <description>&lt;P&gt;Thanks Jin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 00:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-create-elbow-fitting-via-api-but-able-to-create-via/m-p/9213171#M37884</guid>
      <dc:creator>1368026189</dc:creator>
      <dc:date>2019-12-20T00:57:23Z</dc:date>
    </item>
  </channel>
</rss>

