0

I have FeatureClasses (point, line and polygons) with symbology in cartographic representation. How I can get each symbol's parameters (e.g. for polyline: width, colour, style)? enter image description here

Dim featureClass As IFeatureClass = featureWorkspace.OpenFeatureClass('feature_name') Dim featureLayer As IFeatureLayer = New FeatureLayer featureLayer.FeatureClass = featureClass Dim gfl As IGeoFeatureLayer = featureLayer Dim pLegInfo As ILegendInfo = featureLayer 'Dim pLineSymb As ICartographicLineSymbol = TryCast(pLegInfo.LegendGroup(0).Class(3).Symbol, ICartographicLineSymbol) 

pLineSymb type is IMultiLayerLineSymbol, so

Dim pLineSymb As IMultiLayerLineSymbol = TryCast(pLegInfo.LegendGroup(0).Class(3).Symbol, IMultiLayerLineSymbol) MsgBox("Color " & pLineSymb.Layer(0).Color.RGB) MsgBox("Width " & pLineSymb.Layer(0).Width) 

Color and width i get, but line has dashes

4
  • Maybe its not a multilayerlinesymbol but a hashlinesymbol? Commented May 9, 2022 at 19:49
  • I check with TypeOf (ICartographicLineSymbol, IHashLineSymbol, MarkerLineSymbol, ISimpleLineSymbol, IPictureLineSymbol, IMultiLayerLineSymbol): If TypeOf pLegInfo.LegendGroup(0).Class(3).Symbol Is ICartographicLineSymbol Then ... Commented May 9, 2022 at 20:29
  • What exactly is it about the dashed line you want, the dash length or dashed frequency? Commented May 11, 2022 at 10:46
  • Your screen shot is from the representation editor, you might be barking up the wrong tree here, maybe look at IRepresentation resources.arcgis.com/en/help/arcobjects-net/componentHelp/… to get the override symbology. The stroke pattern is an ITemplate resources.arcgis.com/en/help/arcobjects-net/componentHelp/…, cast from ICartographicLineSymbol cast from ILineSymbol. Commented Sep 7, 2022 at 4:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.