<?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: How to get duct shape? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054012#M67364</link>
    <description>&lt;P&gt;Dear Charles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sr is the author of the thread, not me.&lt;/P&gt;&lt;P&gt;And yes, that's the way to get the Shape, just using the connectors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2016 09:40:15 GMT</pubDate>
    <dc:creator>Revitalizer</dc:creator>
    <dc:date>2016-02-24T09:40:15Z</dc:date>
    <item>
      <title>How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6053821#M67360</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;有没有简单的办法直接获得风管的DuctShape?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;我知道接口可以获得shape&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 07:16:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6053821#M67360</guid>
      <dc:creator>sr</dc:creator>
      <dc:date>2016-02-24T07:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6053890#M67361</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really, really want to help anybody, but don't expect everyone to understand your mother tongue.&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/revit-api/problema-na-instalacao-do-revit-2015/m-p/6047166/highlight/true#M14438" target="_blank"&gt;http://forums.autodesk.com/t5/revit-api/problema-na-instalacao-do-revit-2015/m-p/6047166/highlight/true#M14438&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 08:16:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6053890#M67361</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-02-24T08:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6053992#M67362</link>
      <description>&lt;P&gt;Dear Sr,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unlike Revitalizer, I understand you perfectly, thanks to Google translate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say: "There is no simple way to directly get Duct Shape Duct? I know the user interface can be obtained shape."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are asking how to determine the cross sectional shape of a duct element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This used to be a pretty hard question, once upon a time, and several different approaches could be taken, e.g. geometrical analysis, as you can see from these discussions on The Building Coder:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Distinguishing MEP Element Shape&amp;nbsp;--&amp;nbsp;&lt;A href="http://thebuildingcoder.typepad.com/blog/2011/03/distinguishing-mep-element-shape.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2011/03/distinguishing-mep-element-shape.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Improved MEP Element Shape --&amp;nbsp;&lt;A href="http://thebuildingcoder.typepad.com/blog/2011/05/improved-mep-element-shape-and-mount-ararat.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2011/05/improved-mep-element-shape-and-mount-ararat.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way to achieve this is to open the duct fitting family and query the DuctConnector element for its Shape property:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/aec/2013/03/how-to-get-the-duct-section-shape-for-duct-type-object.html" target="_blank"&gt;http://adndevblog.typepad.com/aec/2013/03/how-to-get-the-duct-section-shape-for-duct-type-object.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, opening the family is quite a costly operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From Revit 2015 onwards, the simplest an most effective method to achieve what you need is to query the ElementType.FamilyName property:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html#4.05" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html#4.05&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case, that might look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  /// &amp;lt;summary&amp;gt;
  /// Determine element shape from its 
  /// element type's family name property.
  /// &amp;lt;/summary&amp;gt;
  static public string GetElementShape4(
    Element e )
  {
    string shape = "unknown";

    ElementId tid = e.GetTypeId();

    if( ElementId.InvalidElementId != tid )
    {
      Document doc = e.Document;

      ElementType etyp = doc.GetElement( tid )
        as ElementType;

      if( null != etyp )
      {
        shape = etyp.FamilyName;
      }
    }
    return shape;
  }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added this code to The Building Coder samples release 2016.0.126.3, in the module CmdMepElementShape.cs, in lines 719-744:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples/releases/tag/2016.0.126.3" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples/releases/tag/2016.0.126.3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdMepElementShape.cs#L719-L744" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdMepElementShape.cs#L719-L744&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 09:28:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6053992#M67362</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-02-24T09:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054005#M67363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like Revitalizer, I'm not sure, of that you want. With the title of your post, I understand that you want find the shape of a duct.&lt;/P&gt;&lt;P&gt;The solution is with the connector.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public ConnectorProfilType GetShape (Duct _duct)
{
  ConnectorProfilType ductShape = null;&lt;BR /&gt;
  foreach(Connector connect in _duct.ConnectorManager.Connectors)
  {
    if (connect.ConnectorType == ConnectorType.End)
    {
      ductShape = connect.Shape;
      break;
    }
  }&lt;BR /&gt;
  return ductShape;
}&lt;/PRE&gt;&lt;P&gt;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 09:47:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054005#M67363</guid>
      <dc:creator>Charles.Piro</dc:creator>
      <dc:date>2016-02-24T09:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054012#M67364</link>
      <description>&lt;P&gt;Dear Charles,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sr is the author of the thread, not me.&lt;/P&gt;&lt;P&gt;And yes, that's the way to get the Shape, just using the connectors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 09:40:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054012#M67364</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-02-24T09:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054121#M67365</link>
      <description>&lt;P&gt;Thank you, Charles, for chiming in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I published a summary of these suggestions here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2016/02/ifc-import-levels-and-mep-element-shapes.html#3" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2016/02/ifc-import-levels-and-mep-element-shapes.html#3&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 11:05:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054121#M67365</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-02-24T11:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054259#M67366</link>
      <description>&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you too Jeremy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 12:59:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/6054259#M67366</guid>
      <dc:creator>Charles.Piro</dc:creator>
      <dc:date>2016-02-24T12:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/11633891#M67367</link>
      <description>&lt;P&gt;From Revit 2019 onwards there is also a `Shape` property on the `&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;MEPCurveType`:&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2022/06152f02-9c8c-7f53-8e0b-a0d2adac505a.htm" target="_blank" rel="noopener"&gt;https://www.revitapidocs.com/2022/06152f02-9c8c-7f53-8e0b-a0d2adac505a.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 12:10:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/11633891#M67367</guid>
      <dc:creator>matteoWNPXW</dc:creator>
      <dc:date>2022-12-21T12:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get duct shape?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/11633898#M67368</link>
      <description>&lt;P&gt;&lt;SPAN&gt;From Revit 2019 onwards there is also a `Shape` property on the `&lt;/SPAN&gt;&lt;SPAN class=""&gt;MEPCurveType`:&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2022/06152f02-9c8c-7f53-8e0b-a0d2adac505a.htm" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.revitapidocs.com/2022/06152f02-9c8c-7f53-8e0b-a0d2adac505a.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 12:11:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-duct-shape/m-p/11633898#M67368</guid>
      <dc:creator>teocomi</dc:creator>
      <dc:date>2022-12-21T12:11:48Z</dc:date>
    </item>
  </channel>
</rss>

