<?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: Duct fittings connectors width and height depending on position and orientation in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/11820290#M44972</link>
    <description>&lt;P&gt;Hello, Rustam!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At 2023 it's may be not actual for you. But my answer may be useful for anyone with same problem.&lt;/P&gt;&lt;P&gt;Yes, Width and Height parameters of rectangular ducts depends from orientation instance of duct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, we have two segments of rectangular duct (with same type, same geometry, shape and dimensions). It's may be dimensions 500x1000, one is vertical segment, and second segment is horizontal. Both segment have one shape, but for vertical segment 500 is Height, and for second segment 500 is Width.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can work with it by checking and compare Connectors and they properties Basis.X/Basis.Y (see attachment, where is in Revit LookUp).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See below some rude example of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get a connectors sets our segments&lt;/P&gt;&lt;P&gt;ConnectorSet csDuct1 = (duct1 as MEPCurve).ConnectorManager.Connectors;&lt;/P&gt;&lt;P&gt;ConnectorSet csDuct2 = (duct2 as MEPCurve).ConnectorManager.Connectors;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get connectors from ConnectorSets to List&amp;lt;Connector&amp;gt;&lt;BR /&gt;foreach (Connector connectorDuct1 in csDuct1)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;connectorList.Add(connectorDuct1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (Connector connectorDuct2 in csDuct2)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;connectorList.Add(connectorDuct2);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get connector from 1 Duct&lt;/P&gt;&lt;P&gt;var c1 = connectorList[0];&lt;/P&gt;&lt;P&gt;//Get connector from 2 Duct&lt;/P&gt;&lt;P&gt;var c2 = connectorList[2];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get BasisX for connectors 1 and 2 Ducts&lt;BR /&gt;var c1BasisX = c1.CoordinateSystem.BasisX;&lt;BR /&gt;var c2BasisX = c2.CoordinateSystem.BasisX;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//If BasisX is different then Height and Width is mixed up, and for our Duct1 Height we take value from Width Duct2, etc.&amp;nbsp;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;if (c1BasisX.X == 0 &amp;amp; c2BasisX.X != 0)&lt;BR /&gt;{&lt;BR /&gt;duct1.get_Parameter(BuiltInParameter.RBS_CURVE_WIDTH_PARAM).Set(c2.Height);&lt;BR /&gt;duct1.get_Parameter(BuiltInParameter.RBS_CURVE_HEIGHT_PARAM).Set(c2.Width);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;catch&lt;/P&gt;&lt;P&gt;{}&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2023 12:41:34 GMT</pubDate>
    <dc:creator>dbiserov</dc:creator>
    <dc:date>2023-03-14T12:41:34Z</dc:date>
    <item>
      <title>Duct fittings connectors width and height depending on position and orientation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/8510779#M44970</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm developing a plugin for sizing duct systems (sizes of ducts, fittings and other elements).&amp;nbsp;When it comes to setting the sizes of fittings I found out that width and height of fitting's connectors depend on fitting's location and orientation. I'm setting&amp;nbsp;fitting's sizes throught it's&amp;nbsp;&lt;STRONG style="font-style: italic;"&gt;ConnectorElement&lt;/STRONG&gt; (&lt;A title="Revit API docs" href="http://www.revitapidocs.com/2018.1/cd7d7579-1058-e8ca-d55a-c3a914843667.htm" target="_blank"&gt;http://www.revitapidocs.com/2018.1/cd7d7579-1058-e8ca-d55a-c3a914843667.htm&lt;/A&gt;)&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;by changing&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;BuiltInParameter.CONNECTOR_WIDTH&lt;/STRONG&gt;&lt;/EM&gt; and&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;BuiltInParameter.CONNECTOR_HEIGHT &lt;/STRONG&gt;&lt;/EM&gt;parameters. But you can see that Revit maps those&amp;nbsp;parameters with width and height by some logic that I can't understand yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here some examples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I'm setting &lt;EM&gt;&lt;STRONG&gt;BuiltInParameter.CONNECTOR_WIDTH = 500&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;BuiltInParameter.CONNECTOR_HEIGHT = 150&lt;/STRONG&gt;&lt;/EM&gt;, but turns out that Revit interprets 500 as height and 150 as width:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Width and height changed." style="width: 801px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/589008i5538205D47253DC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Width and height changed." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Width and height changed.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The same system contains another fitting that&amp;nbsp; sized correctly (as I expected):&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Width and height as I expected." style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/589014iAE135214F5C7BE03/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Width and height as I expected." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Width and height as I expected.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone explain me the logic Revit uses to map&amp;nbsp;&lt;STRONG style="font-style: italic;"&gt;ConnectorElement's&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;BuiltInParameter.CONNECTOR_WIDTH&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;BuiltInParameter.CONNECTOR_HEIGHT&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;parameters to actual width and height of the connector?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;P.S.: in this case I've also tried to set &lt;EM&gt;&lt;STRONG&gt;Width&lt;/STRONG&gt;&lt;/EM&gt; and &lt;EM&gt;&lt;STRONG&gt;Height&lt;/STRONG&gt;&lt;/EM&gt; of corresponding &lt;EM&gt;&lt;STRONG&gt;Connector&lt;/STRONG&gt; &lt;/EM&gt;(&lt;A title="Revit API docs" href="http://www.revitapidocs.com/2018.1/11e07082-b3f2-26a1-de79-16535f44716c.htm" target="_blank"&gt;http://www.revitapidocs.com/2018.1/11e07082-b3f2-26a1-de79-16535f44716c.htm&lt;/A&gt;), but Revit throws an exception that this operation is not allowed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 17:16:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/8510779#M44970</guid>
      <dc:creator>rustamMMMR2</dc:creator>
      <dc:date>2019-01-09T17:16:12Z</dc:date>
    </item>
    <item>
      <title>回复： Duct fittings connectors width and height depending on position and orientat</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/8515059#M44971</link>
      <description>&lt;P&gt;Здравствуйте:&lt;/P&gt;
&lt;P&gt;I cannot definitely answer your question.&lt;/P&gt;
&lt;P&gt;But I am aware of one fact in Revit UI:&lt;/P&gt;
&lt;P&gt;For a non-round Duct, Width &amp;amp; Height are swapped in different views. Let's see some screenshots.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="图像 1.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/589684iDF61D112DC4F0591/image-size/large?v=v2&amp;amp;px=999" role="button" title="图像 1.png" alt="图像 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I simply drew a new Rectangular Duct in a 'Floor Plan' view. You can see it's of 6" width &amp;amp; 3" height.&lt;/P&gt;
&lt;P&gt;Now I switched to a section view.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="图像 1.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/589685iA0678E4A9B61D3C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="图像 1.png" alt="图像 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please look closely at the left top corner of the above screenshot. Notice that Width &amp;amp; Height have been swapped!!!&lt;/P&gt;
&lt;P&gt;Then please look at the Properties pane. Notice that parameters 'Width' &amp;amp; 'Height' are definite.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, once again, I cannot definitely answer your question. But I hope these experience can help you avoid some tricks in Revit UI.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;For my experience, I DO NOT trust Revit UI. Each line of your codes should be based on Revit API parameters.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;For Duct Fittings, I guess things will get more complicated. &lt;BR /&gt;Actually the SO-CALLED 'width' or 'height' parameters are totally defined by the author of its family.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;As far as I know, *Rectangular Duct Elbow* family does NOT necessarily tell the difference between 'Left-Right' and 'Top-Bottom', which means that width &amp;amp; height of Duct Elbow are NOT corresponding to the width &amp;amp; height of a Duct.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;If you are willing to test CableTray elbow fitting, you will find out that width &amp;amp; height are strictly corresponding to the width &amp;amp; height of a CableTray.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I hope these ideas can help you figure out some workarounds. &lt;img id="manhappy" class="emoticon emoticon-manhappy" src="https://forums.autodesk.com/i/smilies/16x16_man-happy.png" alt="Man Happy" title="Man Happy" /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 02:51:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/8515059#M44971</guid>
      <dc:creator>jlpgy</dc:creator>
      <dc:date>2019-01-11T02:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Duct fittings connectors width and height depending on position and orientation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/11820290#M44972</link>
      <description>&lt;P&gt;Hello, Rustam!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At 2023 it's may be not actual for you. But my answer may be useful for anyone with same problem.&lt;/P&gt;&lt;P&gt;Yes, Width and Height parameters of rectangular ducts depends from orientation instance of duct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, we have two segments of rectangular duct (with same type, same geometry, shape and dimensions). It's may be dimensions 500x1000, one is vertical segment, and second segment is horizontal. Both segment have one shape, but for vertical segment 500 is Height, and for second segment 500 is Width.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can work with it by checking and compare Connectors and they properties Basis.X/Basis.Y (see attachment, where is in Revit LookUp).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See below some rude example of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get a connectors sets our segments&lt;/P&gt;&lt;P&gt;ConnectorSet csDuct1 = (duct1 as MEPCurve).ConnectorManager.Connectors;&lt;/P&gt;&lt;P&gt;ConnectorSet csDuct2 = (duct2 as MEPCurve).ConnectorManager.Connectors;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get connectors from ConnectorSets to List&amp;lt;Connector&amp;gt;&lt;BR /&gt;foreach (Connector connectorDuct1 in csDuct1)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;connectorList.Add(connectorDuct1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (Connector connectorDuct2 in csDuct2)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;connectorList.Add(connectorDuct2);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get connector from 1 Duct&lt;/P&gt;&lt;P&gt;var c1 = connectorList[0];&lt;/P&gt;&lt;P&gt;//Get connector from 2 Duct&lt;/P&gt;&lt;P&gt;var c2 = connectorList[2];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Get BasisX for connectors 1 and 2 Ducts&lt;BR /&gt;var c1BasisX = c1.CoordinateSystem.BasisX;&lt;BR /&gt;var c2BasisX = c2.CoordinateSystem.BasisX;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//If BasisX is different then Height and Width is mixed up, and for our Duct1 Height we take value from Width Duct2, etc.&amp;nbsp;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;if (c1BasisX.X == 0 &amp;amp; c2BasisX.X != 0)&lt;BR /&gt;{&lt;BR /&gt;duct1.get_Parameter(BuiltInParameter.RBS_CURVE_WIDTH_PARAM).Set(c2.Height);&lt;BR /&gt;duct1.get_Parameter(BuiltInParameter.RBS_CURVE_HEIGHT_PARAM).Set(c2.Width);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;catch&lt;/P&gt;&lt;P&gt;{}&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 12:41:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/11820290#M44972</guid>
      <dc:creator>dbiserov</dc:creator>
      <dc:date>2023-03-14T12:41:34Z</dc:date>
    </item>
  </channel>
</rss>

