AnsweredAssumed Answered

ArcObjects C# - Use Maplex

Question asked by n.faget.mobigis on Mar 8, 2016
Latest reply on Mar 8, 2016 by n.faget.mobigis

Hi everyone,

 

I have a problem with the use of Maplex in C#. I have to create symbology on Layer. Everything is working except maplex properties.

My need is to add a separator ('-') on "label stacking properties".

 

My code :

// The labels placement 

IMaplexOverposterLayerProperties maplexOverposterLayerProperties = new MaplexOverposterLayerPropertiesClass();

maplexOverposterLayerProperties.FeatureType = esriBasicOverposterFeatureType.esriOverposterPoint;                           

maplexOverposterLayerProperties.PointPlacementMethod = esriMaplexPointPlacementMethod.esriMaplexNorthOfPoint;

maplexOverposterLayerProperties.CanTruncateLabel = false;

maplexOverposterLayerProperties.CanStackLabel = true;

maplexOverposterLayerProperties.LabelStackingProperties.AddSeparator("-", true, false, true);

...

ILabelEngineLayerProperties2 pLabelEngineLayerProps = (ILabelEngineLayerProperties2)pAnnoLayerProps;

pLabelEngineLayerProps.Symbol = pTextSymbol;

pLabelEngineLayerProps.OverposterLayerProperties = (IOverposterLayerProperties)maplexOverposterLayerProperties;

pLabelEngineLayerProps.Expression = "[" + strFieldName + "]";

IActiveView m_ActiveView = pMapDoc.ActiveView;

m_ActiveView.Refresh();

 

There is no error in the execution but the separator is not added.

 

Do you have an idea of the problem ?

 

Thanks in advance

Outcomes