We are using ArcGIS 10.0 and I am building a Java custom tool (for a toolbox) using the java ArcObjects API. In my tool, I am taking in the location of an MXD file and the location of a file GDB. I am taking the features from the file GDB and creating a layer within the MXD. No problem with any of that. What I also am doing is updating the layer's symbology to give a specific fill color to the features (polygons) when added to the MXD map document. No problem with that either. The problem that I am running into deals with the polyon line thickness. I give a black border line color but I would like the thickness of the line to be some value bigger than 1. This is the code that I am using in relation to the feature layer's symbology:
SimpleRenderer sr = (SimpleRenderer) featurelayer.getRenderer();
ISymbol sym = sr.getSymbol();
SimpleFillSymbol sfs = (SimpleFillsymbol) sym;
sfs.setColor(rgb);
ILineSymbol ls = new SimpleLineSymbol();
ls.setWidth(5);
ls.setColor(blackColor);
sfs.setOutline(ls);
Here is the oddity. When the MXD file is just an empty MXD, the features added to the map document have a blcak line with a width of 5, which is just what I wanted. If, however, the MXD is a template (which contains things like a North arrow, legend, scale, etc), the line thickness for the features stays at 1, although the outline in the legend of the template is 5 and the outline in the ArcMap's TOC for that layer is also 5. I am not sure why feature polygon outline is not changed. Any clues as to why this is happening? Is there some template property I need to set?
Thanks for any thoughts - Peter
Solved! Go to Solution.
Hallo Peter,
I guess that there's a reference scale defined in the data frame of your template so that your line symbol is scaled. Open the properties-dialog of your data frame, set the reference scale to <none> (I hope the value is defined like that - I just have a german version) and check the appearance of your outline
Frank
Hallo Peter,
I guess that there's a reference scale defined in the data frame of your template so that your line symbol is scaled. Open the properties-dialog of your data frame, set the reference scale to <none> (I hope the value is defined like that - I just have a german version) and check the appearance of your outline
Frank
Frank - Thanks for the response. Yes, if I set the reference scale to None then I do get the line thickness. Excellent find. The scale had been set to 1:500,000 on the template but don't know if that was done for a reason. I will have to do some checking to see if changing the scale to None will have some adverse effect. Thanks again - Peter