<?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 回复： Pipe created with some problem in some complicated situation. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8893253#M41363</link>
    <description>&lt;P&gt;连接件的连接和断开都需要提供和该连接件连接的另一个连接件。&lt;/P&gt;&lt;P&gt;请问用什么方式才能才能获取到另一个连接件？&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;刚接触二次开发，卡在这里了，还请指点。&lt;/P&gt;&lt;P&gt;Both the connection and the disconnection of the connector require the provision of another connector.&lt;/P&gt;&lt;P&gt;How can I use to get another connector?&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jul 2019 06:59:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-06T06:59:27Z</dc:date>
    <item>
      <title>Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8881934#M41359</link>
      <description>&lt;P&gt;I want to write a function to break pipe,this function has no problem in pipe without many pipe fittings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are pipe fittings effecting the pipe? If they are, How can I fix that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if (projectFirstPoint.DistanceTo(pipeCurve.Curve.GetEndPoint(0)) &amp;lt; projectSecondPoint.DistanceTo(pipeCurve.Curve.GetEndPoint(0)))
            {
                newCurve1 = Line.CreateBound(pipeCurve.Curve.GetEndPoint(0), projectFirstPoint) as Curve;
                newCurve2 = Line.CreateBound(projectSecondPoint, pipeCurve.Curve.GetEndPoint(1)) as Curve;
            }
            else
            {
                newCurve1 = Line.CreateBound(pipeCurve.Curve.GetEndPoint(1), projectFirstPoint) as Curve;
                newCurve2 = Line.CreateBound(projectSecondPoint, pipeCurve.Curve.GetEndPoint(0)) as Curve;
            }

Pipe copyPipe = doc.GetElement(ElementTransformUtils.CopyElement(doc, pipe.Id, new XYZ(0, 0, 0)).ElementAt(0)) as Pipe;
                    copyPipeCurve = copyPipe.Location as LocationCurve;

pipeCurve.Curve = newCurve1;
copyPipeCurve.Curve = newCurve2;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 675px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/652650i90DCD5A925AACE39/image-dimensions/675x467?v=v2" width="675" height="467" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 04:50:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8881934#M41359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-01T04:50:09Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8886767#M41360</link>
      <description>&lt;P&gt;可以提供 .rvt 工程文档， 以及更加完整的代码吗？不太理解&lt;/P&gt;&lt;PRE&gt;projectFirstPoint&lt;BR /&gt;projectSecondPoint&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;两个变量的意思。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you pls supply .rvt document, as we as more complete code snippet, so as to help me understand your procedure.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 02:32:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8886767#M41360</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-07-03T02:32:39Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8886894#M41361</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            XYZ firstPoint = selection.PickPoint("请选择第一个打断点");
            XYZ projectFirstPoint = pipeCurve.Curve.Project(firstPoint).XYZPoint;
            XYZ secondPoint = selection.PickPoint("请选择第二个打断点");
            XYZ projectSecondPoint = pipeCurve.Curve.Project(secondPoint).XYZPoint;&lt;/PRE&gt;&lt;P&gt;下面是我测试的Revit文件，但该错误在任何文件都是可重现的，我怀疑可能是管件影响了程序定义的管道长度。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error could happen in any document，I think the length of pipe has changed by the pipe&amp;nbsp;&lt;SPAN&gt;fittings&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 05:01:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8886894#M41361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-03T05:01:35Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8887327#M41362</link>
      <description>&lt;P&gt;不要用赋值 LocationCurve.Curve 的方法改变一个管线的位置，这种处理方法有很多错误。&lt;/P&gt;&lt;P&gt;如果只在长度方向上改变一个直管线的长度，那么首先检查 End Connector 有没有连接。没有连接的话，直接改变 Connector.Origin 属性（沿着管线的方向），在Commit()之后会重新生成管线的实体模型。如果连接着的话，强行改变 Origin 会让管线末端和连接件Origin不再重合，你可以试试。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;！！！&lt;/P&gt;&lt;P&gt;要用 ElementTransformUtils.Copy() 和 Move() 方法。你想把一个直管线打断成两段，如果 GetEndPoint(1)端是连接的，则应先断开连接，复制原始管线（新复制出来的管线两端都是未连接的），改变 oldPipe的 1 端Connector.Origin，还有 newPipe的 0 端Connector.Origin。记得把 newPipe 的 1 端重新连接到原始的连接。&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;你的Post 里面的生成错误应该 oldPipe 两边还有连接的情况下，直接改变位置，Revit在Commit()时会尝试重新生成模型。&lt;/P&gt;&lt;P&gt;任何可能修改MEPCurve 图元位置和长度的操作，都要记得检查一下 GetEndPoint(1) - GetEndPoint(0) 向量方向 在修改之后是否还有初始的方向相同。&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 09:25:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8887327#M41362</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-07-03T09:25:28Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8893253#M41363</link>
      <description>&lt;P&gt;连接件的连接和断开都需要提供和该连接件连接的另一个连接件。&lt;/P&gt;&lt;P&gt;请问用什么方式才能才能获取到另一个连接件？&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;刚接触二次开发，卡在这里了，还请指点。&lt;/P&gt;&lt;P&gt;Both the connection and the disconnection of the connector require the provision of another connector.&lt;/P&gt;&lt;P&gt;How can I use to get another connector?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2019 06:59:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8893253#M41363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-06T06:59:27Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8894654#M41364</link>
      <description>&lt;PRE&gt;        /// &amp;lt;summary&amp;gt;
        /// 如果&amp;lt;paramref name="c"/&amp;gt;已连接，则返回与之连接的另一个连接件；否则返回&amp;lt;see langword="null"/&amp;gt;。
        /// &amp;lt;/summary&amp;gt;
        internal static Connector GetConnected(Connector c)
        {
            if (!c.IsConnected)
            {
                return null;
            }
            else
            {
                Connector toReturn = null;
                foreach (Connector aRefConn in c.AllRefs)
                {
                    if (!(aRefConn.Owner is MEPSystem))
                    {
                        if (aRefConn.ConnectorType == ConnectorType.End
                            || aRefConn.ConnectorType == ConnectorType.Curve)
                        {
                            if (aRefConn.Owner.Id.IntegerValue != c.Owner.Id.IntegerValue)
                            {
                                toReturn = aRefConn;
                            }
                        }
                    }
                }
                return toReturn;
            }
        }&lt;/PRE&gt;&lt;P&gt;用RevitLookup逐个检查，总结规律&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 02:14:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/8894654#M41364</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-07-08T02:14:48Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/9200288#M41365</link>
      <description>哈哈，都是国内的哈，金工是上海哪家单位的呢？</description>
      <pubDate>Fri, 13 Dec 2019 06:17:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/9200288#M41365</guid>
      <dc:creator>1368026189</dc:creator>
      <dc:date>2019-12-13T06:17:13Z</dc:date>
    </item>
    <item>
      <title>回复： Pipe created with some problem in some complicated situation.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/9211069#M41366</link>
      <description>&lt;P&gt;我是自由程序猿，自己研究研究Revit开发的&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 06:13:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/pipe-created-with-some-problem-in-some-complicated-situation/m-p/9211069#M41366</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-12-19T06:13:20Z</dc:date>
    </item>
  </channel>
</rss>

