<?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: Cannot find Name of ColorFillSchemeEntry by API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239042#M26584</link>
    <description>&lt;P&gt;What if you use the ElementId value there to get the element?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Apr 2021 21:28:49 GMT</pubDate>
    <dc:creator>Sean_Page</dc:creator>
    <dc:date>2021-04-14T21:28:49Z</dc:date>
    <item>
      <title>Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10238917#M26580</link>
      <description>&lt;P&gt;I'm looking into API to retrieve Color for given Area Type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick search:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var schemes = new &lt;/SPAN&gt;&lt;SPAN&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN&gt;Revit&lt;/SPAN&gt;.&lt;SPAN&gt;DB&lt;/SPAN&gt;.&lt;SPAN&gt;FilteredElementCollector&lt;/SPAN&gt;(&lt;SPAN&gt;doc&lt;/SPAN&gt;)&lt;BR /&gt;    .&lt;SPAN&gt;OfCategory&lt;/SPAN&gt;(&lt;SPAN&gt;Autodesk&lt;/SPAN&gt;.&lt;SPAN&gt;Revit&lt;/SPAN&gt;.&lt;SPAN&gt;DB&lt;/SPAN&gt;.&lt;SPAN&gt;BuiltInCategory&lt;/SPAN&gt;.&lt;SPAN&gt;OST_ColorFillSchema&lt;/SPAN&gt;)&lt;BR /&gt;    .&lt;SPAN&gt;Select&lt;/SPAN&gt;(&lt;SPAN&gt;s &lt;/SPAN&gt;=&amp;gt; &lt;SPAN&gt;s &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;&lt;SPAN&gt;ColorFillScheme&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;var rentable = schemes&lt;BR /&gt;    .Where(s =&amp;gt; s.Name == "Rentable Area")&lt;BR /&gt;    .FirstOrDefault();&lt;BR /&gt;&lt;BR /&gt;List&amp;lt;ColorFillSchemeEntry&amp;gt; entries = rentable.GetEntries();&lt;/PRE&gt;&lt;P&gt;If I look on fields of each entry, I can find proper color, but not the name of given Area Type or any index. Entry.Caption or entry.GetStringValue() return empty string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On GUI I clearly can see which color applies to which type, how can I find this relation by API?&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="supportT7RUE_0-1618432151521.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906547i5BF1F0F6DA21E73D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="supportT7RUE_0-1618432151521.png" alt="supportT7RUE_0-1618432151521.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 20:39:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10238917#M26580</guid>
      <dc:creator>supportT7RUE</dc:creator>
      <dc:date>2021-04-14T20:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10238981#M26581</link>
      <description>&lt;P&gt;It looks like you just need to use .GetStringValue() method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--Revit Lookup is invaluable--&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spage_0-1618434067738.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906566iB1BD5B56AAF7949B/image-size/large?v=v2&amp;amp;px=999" role="button" title="spage_0-1618434067738.png" alt="spage_0-1618434067738.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:02:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10238981#M26581</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-14T21:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239004#M26582</link>
      <description>&lt;P&gt;This was quick in Dynamo via Python, but it worked fine.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spage_0-1618434544977.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906571iB394C3A903C5067C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="spage_0-1618434544977.png" alt="spage_0-1618434544977.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure you are getting a specific&amp;nbsp; entry to use the method on and not the list.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;string name = entires[0].GetStringValue()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:11:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239004#M26582</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-14T21:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239030#M26583</link>
      <description>&lt;P&gt;GetStringValue() works for entries of Rooms color scheme, but not for Areas. Elements inside GetEntries() have empty values under GetStringValue(). That was first what I've tried (second after entry.Caption).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mut9lu_0-1618435357984.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906574i7C1F50B9F3C5BFA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mut9lu_0-1618435357984.png" alt="mut9lu_0-1618435357984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:24:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239030#M26583</guid>
      <dc:creator>mut9lu</dc:creator>
      <dc:date>2021-04-14T21:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239042#M26584</link>
      <description>&lt;P&gt;What if you use the ElementId value there to get the element?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:28:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239042#M26584</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-14T21:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239061#M26585</link>
      <description>&lt;P&gt;Ahhh, it was not element itself, but its GetDependentElements()&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mut9lu_0-1618436090375.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906582iD16CDBC754DB15A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mut9lu_0-1618436090375.png" alt="mut9lu_0-1618436090375.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for pointing out RevitLookUp, I heard of it but didn't use previously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:36:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239061#M26585</guid>
      <dc:creator>mut9lu</dc:creator>
      <dc:date>2021-04-14T21:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239091#M26586</link>
      <description>&lt;P&gt;One of the solutions could be getting all unique area types as parameter values of area objects. You can make a dictionary and use it to get proper area type names and colors:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Python
area_types = {}
for area in FEC(doc).OfCategory(DB.BuiltInCategory.OST_Areas):
    area_type_parameter = area.get_Parameter(DB.BuiltInParameter.AREA_TYPE)
    area_type_id = area_type_parameter.AsElementId()
    area_type_name = area_type_parameter.AsValueString()
    if area_type_id not in area_types:
        area_types[area_type_id] = area_type_name

for scheme in FEC(doc).OfCategory(DB.BuiltInCategory.OST_ColorFillSchema):
    if scheme.Name == 'Rentable Area':
        scheme_entries = scheme.GetEntries()

entry_colors = {}
for entry in scheme_entries:
    entry_name = area_types[entry.GetElementIdValue()]
    if entry_name not in entry_colors:
        entry_colors[entry_name] = entry.Color&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:49:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239091#M26586</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-04-14T21:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239111#M26587</link>
      <description>&lt;P&gt;Is RevitLookup 2022 already available?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:56:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239111#M26587</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-04-14T21:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239119#M26588</link>
      <description>&lt;P&gt;Officially no, but since R22 has the same .Net version I assumed it would work and manually copied it to the add-ins folder. Works perfect.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 22:01:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239119#M26588</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-14T22:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find Name of ColorFillSchemeEntry by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239161#M26589</link>
      <description>&lt;P&gt;Very nice! I'll check it up &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 22:30:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-name-of-colorfillschemeentry-by-api/m-p/10239161#M26589</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-04-14T22:30:42Z</dc:date>
    </item>
  </channel>
</rss>

