Labels and Symbology based on two columns

Mar 28, 2012 at 7:47 PM

Im not sure why but I'm having trouble grasping the the category function. Cant seem to make this work. I have a point shapefile with two fields PTYPE and PCODE. I have the points with the a nice symbology with blue triangles and also have the labels generated based on PCODE but I want to take it a step further.

1. the symbology I want to change from default to a red diamond but only when a record has a PCODE that ends with a \ or starts with a > for example PCODE of "SET\" or ">WRY"

2. The labels I want to change from PCODE to <PCODE> but only for those records that have a PTYPE="Z".

I cant see how to do that with the current framework. Ive been studying the examples but cant seem to make this work. Any help appreciated.

Thanks

AGP

Developer
Mar 30, 2012 at 9:39 AM

I guess there is no fast way to do it indeed. You need to create shapefile categories and assign them to individual shapes with Shapefile.set_ShapeCategory(ShapeIndex) for the first issue. The label text should be changed using Labels.getLabel(index, part).Text. 

--

Sergei

Apr 2, 2012 at 5:06 PM

I think I am making some headway. I'm trying to use the .Expression parameter but just cant figure out its syntax. The Help says its a SQL based but not what engine so some characters may not work as expected. What I'm trying to do is use the LIKE and also the literal character asterisks in the expression. Something like .expression = "PCODE LIKE '*%'". Ive tried escaping the asterisks with a backslash and enclosing it with square brackets. Ive also tried using single quotes or double quotes around the match parameters. Nothing seems to work. Has anyone done something like this?

 

AGP