<?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 Getting TextSymbols from Layerfile in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getting-textsymbols-from-layerfile/m-p/1100200#M7155</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to read a Layer-File (.stylx) fom disk and get the TextSymbols (with all properties) by Name.&lt;/P&gt;&lt;P&gt;I need this information to generate a AnnotationClass with the right TextSymbols.&lt;/P&gt;&lt;P&gt;Is it possible to do this from a Core.Host C# Application, not as an add-in, and how can I do it?&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 08:01:48 GMT</pubDate>
    <dc:creator>TOPOGRAPHICS</dc:creator>
    <dc:date>2021-09-21T08:01:48Z</dc:date>
    <item>
      <title>Getting TextSymbols from Layerfile</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getting-textsymbols-from-layerfile/m-p/1100200#M7155</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to read a Layer-File (.stylx) fom disk and get the TextSymbols (with all properties) by Name.&lt;/P&gt;&lt;P&gt;I need this information to generate a AnnotationClass with the right TextSymbols.&lt;/P&gt;&lt;P&gt;Is it possible to do this from a Core.Host C# Application, not as an add-in, and how can I do it?&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 08:01:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getting-textsymbols-from-layerfile/m-p/1100200#M7155</guid>
      <dc:creator>TOPOGRAPHICS</dc:creator>
      <dc:date>2021-09-21T08:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting TextSymbols from Layerfile</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getting-textsymbols-from-layerfile/m-p/1100365#M7161</link>
      <description>&lt;P&gt;You cannot do this in a corehost application only in an add-in because styles can only be managed within the context of an ArcGIS Pro project.&amp;nbsp; &amp;nbsp;You can create the style from a .stylx input file by using the StyleHelper class: .&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//Full path for the new style file (.stylx) to be created
string styleToCreate = @"C:\Temp\NewStyle.stylx";
await QueuedTask.Run(() =&amp;gt; StyleHelper.CreateStyle(Project.Current, styleToCreate));
var stylxProjectItem = Project.Current.GetItems&amp;lt;StyleProjectItem&amp;gt;().FirstOrDefault(i =&amp;gt; i.Path == styleToCreate);&lt;/LI-CODE&gt;&lt;P&gt;And then you can use LookupItem to find specific content:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public Task&amp;lt;SymbolStyleItem&amp;gt; GetSymbolFromStyleAsync(StyleProjectItem style, string key)
{
    return QueuedTask.Run(() =&amp;gt;
    {
    if (style == null)
        throw new System.ArgumentNullException();

    //Search for a specific point symbol in style
    SymbolStyleItem item = (SymbolStyleItem)style.LookupItem(StyleItemType.PointSymbol, key);
    return item;
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 16:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getting-textsymbols-from-layerfile/m-p/1100365#M7161</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-09-21T16:11:25Z</dc:date>
    </item>
  </channel>
</rss>

