<?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 Fabrication elbow - discern top/bottom extensions in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10875159#M21424</link>
    <description>&lt;P&gt;I am trying to change the top or bottom extension of a standard radius elbow. However, I cannot figure out how to tell whether one end is "top" or "bottom." The only consistent approach I have found so far is to guess, and undo if the guess was incorrect. The &lt;STRONG&gt;Edit Part&lt;/STRONG&gt; dialog shows a preview of the part, but not in context of the drawing. Here is essentially what I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// part in question is part1
// part's connectors are c1 and c2a
// goal is to figure out which (top/bottom) extension corresponds to c2a
FabricationDimensionDefinition topExt = part1.GetDimensions().SingleOrDefault(i =&amp;gt; i.Name == "Top Extension");
double part1topExtension = part1.GetDimensionValue(topExt);
double extLength = 5; // pick your length
part1.SetDimensionValue(topExt, extLength);
// oops, wrong extension, try again 50% of the time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions for other improvements in technique also welcome, of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-01-12 11.03.22 obzcbG5PJi.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1010433i920206C7C374EFD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-01-12 11.03.22 obzcbG5PJi.png" alt="2022-01-12 11.03.22 obzcbG5PJi.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 19:15:08 GMT</pubDate>
    <dc:creator>steven.williams.as</dc:creator>
    <dc:date>2022-01-12T19:15:08Z</dc:date>
    <item>
      <title>Fabrication elbow - discern top/bottom extensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10875159#M21424</link>
      <description>&lt;P&gt;I am trying to change the top or bottom extension of a standard radius elbow. However, I cannot figure out how to tell whether one end is "top" or "bottom." The only consistent approach I have found so far is to guess, and undo if the guess was incorrect. The &lt;STRONG&gt;Edit Part&lt;/STRONG&gt; dialog shows a preview of the part, but not in context of the drawing. Here is essentially what I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// part in question is part1
// part's connectors are c1 and c2a
// goal is to figure out which (top/bottom) extension corresponds to c2a
FabricationDimensionDefinition topExt = part1.GetDimensions().SingleOrDefault(i =&amp;gt; i.Name == "Top Extension");
double part1topExtension = part1.GetDimensionValue(topExt);
double extLength = 5; // pick your length
part1.SetDimensionValue(topExt, extLength);
// oops, wrong extension, try again 50% of the time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions for other improvements in technique also welcome, of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-01-12 11.03.22 obzcbG5PJi.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1010433i920206C7C374EFD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-01-12 11.03.22 obzcbG5PJi.png" alt="2022-01-12 11.03.22 obzcbG5PJi.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 19:15:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10875159#M21424</guid>
      <dc:creator>steven.williams.as</dc:creator>
      <dc:date>2022-01-12T19:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Fabrication elbow - discern top/bottom extensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10876379#M21425</link>
      <description>&lt;P&gt;The part is defined in its own local coordinate system. In that definition framework, top and bottom are well defined. When the part is placed in the project coordinate space, a transformation is applied. You need to determine what that transformation is. That will tell you how the local coordinate system is transformed to the project space, and thus how the original top and bottom directions end up oriented in your model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 07:39:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10876379#M21425</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-01-13T07:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Fabrication elbow - discern top/bottom extensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10876562#M21426</link>
      <description>&lt;P&gt;use CordinateSystem.BasisX/Y/Z in connectors to know where is top&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 09:07:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10876562#M21426</guid>
      <dc:creator>MarryTookMyCoffe</dc:creator>
      <dc:date>2022-01-13T09:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fabrication elbow - discern top/bottom extensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10880709#M21427</link>
      <description>&lt;P&gt;So it appears that I can use the part's inverse transformation on each connector to find which one is further in the y-direction. As much as that doesn't seem well defined to me -- shouldn't z be top/bottom, not y? -- I think I can work with it. Here's what I have:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// part in question is part1
// connectors are c1 and c2
Transform part1transform = part1.GetTransform();
XYZ c1original = part1transform.Inverse.OfPoint(c1.Origin);
XYZ c2original = part1transform.Inverse.OfPoint(c2.Origin);
if (c1original.Y &amp;gt; c2original.Y)
{
    // c2 is near the bottom extension, do something
}
else
{
    // c2 is near the top extension, do something else
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this look reliable for discerning the top and bottom connectors?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 19:25:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10880709#M21427</guid>
      <dc:creator>steven.williams.as</dc:creator>
      <dc:date>2022-01-14T19:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fabrication elbow - discern top/bottom extensions</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10880979#M21428</link>
      <description>&lt;P&gt;Looks good to me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be able to see and understand why to top side is the Y direction by looking into the family definition in the family editor. The family definition defines the origin and orientation of the part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 21:15:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/fabrication-elbow-discern-top-bottom-extensions/m-p/10880979#M21428</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-01-14T21:15:00Z</dc:date>
    </item>
  </channel>
</rss>

