Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Frequent Contributor
Posts: 155
Registered: ‎01-14-2018
Accepted Solution

Setting a style property with value from a table

Dear all,

 

In GeoMedia, I am working on giving a certain advanced style for a text feature;

for example, I want the rotation a value from a field called 'angle'

 

PView.StyleService ss = new PView.StyleService();
s.StyleProperties[PView.StylePropertyConstants.gmgroPropertyRotation].Value = ???

so what to write instead of the ???

 

Thanks

Khaled

Technical Evangelist
Posts: 523
Registered: ‎09-11-2015

Re: Setting a style property with value from a table

Hi Khaled,

 

if you want to use a property based on a field value, you should use the StyleProperty.Expression property. So in your case the pseudocode would look like this:

 

StyleService ss = new StyleService();

StyleDefinition oStyle = null;

ss.GetStyle("SymbolStyle", out oStyle);

try

{

  oStyle.StyleProperties["Rotation"].Expression = "Input.Angle";

}

catch

{

  StyleProperty oProp = new StyleProperty();

  oProp.Name = "Rotation";

  oProp.Expression = "Input.Angle";

  oStyle.StyleProperties.Add(oProp);

}

 

 

Pavel

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.