<?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: Framing section reorganization in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716698#M32217</link>
    <description>&lt;P&gt;Regarding your first question on the null reference exception, the same answer as always: step through your code in the debugger line by line, look at the variable values, and you will see exactly what is causing the problem. That will help understand how to fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2020 07:33:19 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2020-08-28T07:33:19Z</dc:date>
    <item>
      <title>Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716262#M32214</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a code to recognize the structure framing section as the guideline from&amp;nbsp;@Anonymous&amp;nbsp; &amp;nbsp;&lt;A href="https://thebuildingcoder.typepad.com/blog/2013/12/security-framing-cross-section-analyser-and-rex.html" target="_blank" rel="noopener"&gt;https://thebuildingcoder.typepad.com/blog/2013/12/security-framing-cross-section-analyser-and-rex.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run it, there was an error message as following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 668px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/812280iF5E9CEE27CA24972/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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And following is the code I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public class MainCode : IExternalCommand
    {
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
    public class MainCode : IExternalCommand
    {
        void RexXsecAnalyis(
    ExternalCommandData commandData,
    Element e)
        {
            // Initialise converter

            RVTFamilyConverter rvt = new RVTFamilyConverter(
              commandData, true);

            // Retrieve family type

            REXFamilyType fam = rvt.GetFamily(e,
              ECategoryType.SECTION_PARAM);

            // Retrieve section data

            REXFamilyType_ParamSection paramSection = fam
              as REXFamilyType_ParamSection;

            REXSectionParamDescription parameters
              = paramSection.Parameters;

            // Extract dimensions, section type, tapered
            // predicate, etc.
            // If different start and end sections are 
            // required, use DimensionsEnd as well.

            REXSectionParamDimensions dimensions = parameters
              .Dimensions;

            ESectionType sectionType = parameters
              .SectionType;

            bool tapered = parameters.Tapered;

            bool start = true;

            Contour_Section contour = parameters.GetContour(
              start);

            List&amp;lt;ContourCont&amp;gt; shape = contour.Shape;
            TaskDialog.Show("info", sectionType.ToString()); 
          
        }

        static System.Reflection.Assembly OnAssemblyResolve(
        object sender,
        ResolveEventArgs args)
        {
            Assembly a = Assembly.GetExecutingAssembly();

            return Autodesk.REX.Framework.REXAssemblies
              .Resolve(sender, args, "2018", a);
        }

        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
 // Get control of the current document 
            UIDocument uIDocument = commandData.Application.ActiveUIDocument;
            DocumentSet alldocuments = uIDocument.Document.Application.Documents; 

            // Get document control
            Document document = uIDocument.Document;

            // Get current active view
            Autodesk.Revit.DB.View currentview = document.ActiveView;
            Selection selection = uIDocument.Selection;
            IList&amp;lt;Reference&amp;gt; SelectedElements = selection.PickObjects(ObjectType.Element);
      foreach (Reference refe in SelectedElements)
                {
                    Element selectedElement = document.GetElement(refe);
                        RexXsecAnalyis(commandData, selectedElement); 

}
            return Result.Succeeded;

}

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;So if you have experience about this, pleas help me to give a hint how was the problem and how to fix it.&lt;/P&gt;&lt;P&gt;Thank you and have a nice day.&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;Sino&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 22:53:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716262#M32214</guid>
      <dc:creator>Sino.Pacific</dc:creator>
      <dc:date>2020-08-27T22:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716317#M32215</link>
      <description>&lt;P&gt;I don't know how to fix that off hand but I'm wondering why you are not getting the section shape from Family.StructuralSectionShape? A library of families that implements this has standardised parameters and so is easier to identify dimensions of the section as well as the shape.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Almost certain this feature of the REX framework is not covering all the section shapes that exist.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 23:58:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716317#M32215</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-08-27T23:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716369#M32216</link>
      <description>&lt;P&gt;Dear Mr.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your comment. I have checked the Family.StruccturalSectionShape, but mostly all of the Structural framing family ( from default Library of Revit) is not defined:&amp;nbsp;&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/812298iC74F00F4D7410D3E/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;Do you have any other suggestion?&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;Sino&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 01:17:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716369#M32216</guid>
      <dc:creator>Sino.Pacific</dc:creator>
      <dc:date>2020-08-28T01:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716698#M32217</link>
      <description>&lt;P&gt;Regarding your first question on the null reference exception, the same answer as always: step through your code in the debugger line by line, look at the variable values, and you will see exactly what is causing the problem. That will help understand how to fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 07:33:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716698#M32217</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-08-28T07:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716719#M32218</link>
      <description>&lt;P&gt;Dear Mr.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion. I tried to find the bugs location and it had bug at the first line of RVTFamilyConverter as following image:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 949px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/812369i6116C3285338FAAB/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;Do you have any idea why this happen?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;Sino&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 07:50:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716719#M32218</guid>
      <dc:creator>Sino.Pacific</dc:creator>
      <dc:date>2020-08-28T07:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716743#M32219</link>
      <description>&lt;P&gt;Step &lt;U&gt;into&lt;/U&gt; the family converter constructor with the debugger and step through that line by line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will show you exactly what error occurs, why and where.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 08:07:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716743#M32219</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-08-28T08:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716763#M32220</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion, but unfortunately I only know to use the Add in Manager to test the output DLL but don't know how to debug the constructor as you mentioned&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":pensive_face:"&gt;😔&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 08:19:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9716763#M32220</guid>
      <dc:creator>Sino.Pacific</dc:creator>
      <dc:date>2020-08-28T08:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9717000#M32221</link>
      <description>&lt;P&gt;Well the example section you highlighted (double angle) you wouldn't find a standard section shape for and it is also not listed in the REX section table (so would it even identify that?).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at the 2020 content I-Section/C-Section... you'll likely find the section shape is set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you have to decide for yourself between:&lt;/P&gt;&lt;P&gt;A) Trawling though code by others to complete the missing requirements which by description seem to relate to materials (something you are not interested in).&lt;/P&gt;&lt;P&gt;B) Use section shapes in your library, fill in data. This will also put you in good stead for other features that may use them e.g. steel connections.&lt;/P&gt;&lt;P&gt;C) Get end faces from symbol geometry those planar faces that have face normal matching direction in the family document. Analyse the curve loops to distinguish the profile types by traits such as: number of loops/line direction/profile symmetry/numbers of lines/number of arcs etc. (not sure how REX distinguishes between Round and Cable)? In planning use venn diagram or similar to separate out such traits and place each section type within the regions until each is uniquely distinguished.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As noted these are not the only section types that exist these days and if you go with option (C) then you can distinguish between those you know about but a further type may be introduced that is indistinguishable from an existing item (in relation to the traits you check with).&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 10:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9717000#M32221</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2020-08-28T10:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Framing section reorganization</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9718147#M32222</link>
      <description>&lt;P&gt;What Revit version is this in? Your it looks like your 'OnAssemblyResolve' is returning the 2018 version of REX dlls.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This error is occurring in the REX SDK, I'd suggest looking at its documentation to see if anything there might help. I looked a bit and didn't find anything that could explain this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 21:03:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/framing-section-reorganization/m-p/9718147#M32222</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2020-08-28T21:03:31Z</dc:date>
    </item>
  </channel>
</rss>

