<?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: How to extract symbol properties using VBA? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510377#M13745</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What's the difference between interface and co-class?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When we use 'TypeOf', should we use 'TypeOf xxx Is' followed by an interface or followed by a co-class?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I ask this because when I check a linesymbol against the interface of different linesymbols, I got no match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when I use co-class, I got all match.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jan 2012 02:16:48 GMT</pubDate>
    <dc:creator>ChristineGo</dc:creator>
    <dc:date>2012-01-25T02:16:48Z</dc:date>
    <item>
      <title>How to extract symbol properties using VBA?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510374#M13742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am writing a VBA program to extract symbol properties under feature layers of a MxDocument.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm able to extract properties like symbol colors and line width, but when I try to get more detail,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not able to tell whether a symbol is SimpleLineSymbol or MarkerLineSymbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My program is like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pGFL As IGeoFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pSbl As ISymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pSPR As ISimplyRenderer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMLS As IMarkerLineSymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If TypeOf pGFL.Renderer Is ISimpleRenderer Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSPR = pGFL.Renderer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If pFL.FeatureClass.ShapeType = esriGeometryPolyline Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMLS = pSbl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "Marker Symbol Size = " &amp;amp; pMLS.MarkerSymbol.Size&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I got error when I came over Set pMLS = pSbl.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I define pMLS as MarkerLineSymbol instead of IMarkerLineSymbol, the statement Set pMLS = pSbl works,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but then it'll say pMLS.MarkerSymbol is a undefined method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I declare pMLS as ILineSymbol, I can set pMLS = pSbl, but I'm not able to get the MarkerSymbol related properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could anyone share with me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(1) How to obtain the Marker Symbol related properties from a ISymbol?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(2) How to determine the type of Symbol, e.g., SimpleLineSymbol or MarkerLineSymbol?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 11:44:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510374#M13742</guid>
      <dc:creator>ChristineGo</dc:creator>
      <dc:date>2012-01-24T11:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract symbol properties using VBA?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510375#M13743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You do it the same way you're checking for the renderer type in your code, by using TypeOf.&amp;nbsp; The symbol for a polyline layer will be of type ILineSymbol.&amp;nbsp; There are several coclasses that implement ILineSymbol&amp;nbsp; - MarkerLineSymbol and SimpleLineSymbol are only two of them so you'll need to check for all of the others as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim lineSymbol As ILineSymbol = simpleRenderer.Symbol
If TypeOf lineSymbol Is IMarkerLineSymbol Then
&amp;nbsp; ' marker line symbol
ElseIf TypeOf lineSymbol Is ISimpleLineSymbol Then
&amp;nbsp; ' simple line symbol
End If&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:21:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510375#M13743</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2021-12-11T22:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract symbol properties using VBA?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510376#M13744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did something like this, but why it didn't work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The program error out in the 'Set' statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim Symbol As ISymbol = simpleRenderer.Symbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim MLSymbol As IMarkerLineSymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim SLSymbol As ISimpleLineSymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If TypeOf Symbol Is IMarkerLineSymbol Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set MLSymbol = Symbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf TypeOf Symbol Is ISimpleLineSymbol Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set SLSymbol = Symbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 13:08:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510376#M13744</guid>
      <dc:creator>ChristineGo</dc:creator>
      <dc:date>2012-01-24T13:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract symbol properties using VBA?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510377#M13745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What's the difference between interface and co-class?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When we use 'TypeOf', should we use 'TypeOf xxx Is' followed by an interface or followed by a co-class?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I ask this because when I check a linesymbol against the interface of different linesymbols, I got no match;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;when I use co-class, I got all match.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 02:16:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510377#M13745</guid>
      <dc:creator>ChristineGo</dc:creator>
      <dc:date>2012-01-25T02:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract symbol properties using VBA?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510378#M13746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You use the interface when checking types with TypeOf.&amp;nbsp; Keep in mind that a symbol can be many different types.&amp;nbsp; If you look at the help for ISymbol then you'll see a list of all the coclasses that implement that interface.&amp;nbsp; In theory, it could be any of them but you can rule some of them out simply because it's a symbol being used by a line layer.&amp;nbsp; That's why I suggested only testing for the ILineSymbol types.&amp;nbsp; If you look at the help for ILineSymbol then you'll see the list of coclasses that you should be checking for.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 12:31:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-extract-symbol-properties-using-vba/m-p/510378#M13746</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-01-25T12:31:41Z</dc:date>
    </item>
  </channel>
</rss>

