<?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 How to get OmniClass Number in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11953018#M12126</link>
    <description>&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;Do we have any way to get the OmniClass Number in the Identity Data by using API?&lt;/P&gt;&lt;P&gt;For example : I have Engine Generators has OmniClass Number = "23.80.10.11.11.11". How can I get this value?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 00:06:22 GMT</pubDate>
    <dc:creator>chuong_do77UDA</dc:creator>
    <dc:date>2023-05-10T00:06:22Z</dc:date>
    <item>
      <title>How to get OmniClass Number</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11953018#M12126</link>
      <description>&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;Do we have any way to get the OmniClass Number in the Identity Data by using API?&lt;/P&gt;&lt;P&gt;For example : I have Engine Generators has OmniClass Number = "23.80.10.11.11.11". How can I get this value?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 00:06:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11953018#M12126</guid>
      <dc:creator>chuong_do77UDA</dc:creator>
      <dc:date>2023-05-10T00:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OmniClass Number</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11953436#M12127</link>
      <description>&lt;P&gt;Hi! Omniclass Number is a System Type Parameter. To get it for each element first you need to get Element's Type and then try to get the&amp;nbsp;&lt;SPAN&gt;OMNICLASS_CODE parameter. If this particulat ElementType has it, then you can get its value. Here is the sample code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;foreach (Element element in elements)
{
    ElementType elementType = doc.GetElement(element.GetTypeId()) as ElementType;
    Parameter omniClassNumber = elementType.get_Parameter(BuiltInParameter.OMNICLASS_CODE);
    if (omniClassNumber != null)
    {
        string value = omniClassNumber.AsString();
        if (!string.IsNullOrEmpty(value))
        {
            Console.WriteLine(value);
        }
        else
        {
            Console.WriteLine("No Value");
        }
    }
    else
    {
        Console.WriteLine("Element does not have Omni Class Number Parameter");
    }
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 05:52:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11953436#M12127</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-05-10T05:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OmniClass Number</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11954945#M12128</link>
      <description>&lt;P&gt;Thanks for your answer. Base on your code it only gets OmniClass Number = "23.80.10.11" (&amp;nbsp;Electrical Generators)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should be "23.80.10.11.11.11" of &lt;STRONG&gt;Engine Generators&lt;/STRONG&gt;. Please review again and help. Thank you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OmniClassNumber.png" style="width: 851px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1212874i6F03A3A4CF7AD959/image-size/large?v=v2&amp;amp;px=999" role="button" title="OmniClassNumber.png" alt="OmniClassNumber.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 20:14:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11954945#M12128</guid>
      <dc:creator>chuong_do77UDA</dc:creator>
      <dc:date>2023-05-10T20:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OmniClass Number</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11955764#M12129</link>
      <description>&lt;P&gt;Hi! There is no problem to get Omni Class Number of any kind using the code I've provided you above. I've tested this code in Python and it works fine too.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="architectbim_0-1683764705998.jpeg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1213006iB203A531FE5A6E9C/image-size/large?v=v2&amp;amp;px=999" role="button" title="architectbim_0-1683764705998.jpeg" alt="architectbim_0-1683764705998.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Actually there is nothin to review, just simply use it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you don't see the last digits of the omniclass, they may simply not be printed. Or you may have made an inaccuracy somewhere. Either way, there is actually no other way to get this number. It is stored as a string parameter value. And to get it, you need the methods I mentioned above.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 00:26:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11955764#M12129</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-05-11T00:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OmniClass Number</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11956003#M12130</link>
      <description>&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;I am using FilteredElementCollector to filter elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filter = new BuiltInCategory[] {&lt;BR /&gt;BuiltInCategory.OST_ElectricalEquipment,&lt;BR /&gt;BuiltInCategory.OST_ElectricalFixtures,&lt;BR /&gt;BuiltInCategory.OST_LightingDevices,&lt;BR /&gt;BuiltInCategory.OST_LightingFixtures,&lt;BR /&gt;BuiltInCategory.OST_Wire,&amp;nbsp;&lt;BR /&gt;BuiltInCategory.OST_ElectricalCircuit,&lt;BR /&gt;BuiltInCategory.OST_WireMaterials,&lt;BR /&gt;BuiltInCategory.OST_WireInsulations,&lt;BR /&gt;BuiltInCategory.OST_WireTemperatureRatings,&lt;BR /&gt;BuiltInCategory.OST_ElecDistributionSys,&lt;BR /&gt;BuiltInCategory.OST_ElectricalVoltage,&lt;BR /&gt;BuiltInCategory.OST_MechanicalEquipment,&lt;BR /&gt;BuiltInCategory.OST_Levels,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;Do you think the filter I miss anything?&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 03:43:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11956003#M12130</guid>
      <dc:creator>chuong_do77UDA</dc:creator>
      <dc:date>2023-05-11T03:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OmniClass Number</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11956013#M12131</link>
      <description>&lt;P&gt;I'm not sure how this question relates to the omniclass number. I would advise you to accept solution for this question and create a new query in the forum if you have any new questions.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 03:53:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-omniclass-number/m-p/11956013#M12131</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-05-11T03:53:14Z</dc:date>
    </item>
  </channel>
</rss>

