Dashed lines created programatically in ArcMap using ISimpleLineSymbol, print as solid lines.
Last Published: August 25, 2014No Product Found
Bug ID Number
NIM001365
Submitted
March 2, 2006
Last Modified
June 5, 2024
Applies to
No Product Found
Version found
9.1
Status
Known Limit
After review by the development team, it has been determined that this issue is related to a known limitation with the software that lies outside of Esri's control. The issue's Additional Information section may contain further explanation.
Additional Information
No Public Explanation
Workaround
All dashed simple lines have problems with printing and vector export, regardless of whether they are created in the ArcMap UI or programatically. The answer is to use cartographic lines instead (this is one reason why the 6:6 line symbol is of type Cartographic Line instead of Simple Line).=============================================Use ICartographicLineSymbol and specify a template. Please see the sample VBA code below. This code will produce a dashed line which prints as dashed.Sub AddLine_DataView_CartographicLineSymbol() Dim pMxDoc As IMxDocument Dim pPageLayout As IPageLayout Dim pGC As IGraphicsContainer Dim pPointColl As IPointCollection Dim pElement As IElement Dim pLineElement As ILineElement Dim pPoint1 As IPoint Dim pPoint2 As IPoint Dim pPoint3 As IPoint Dim pColor As IRgbColor Dim pLineSymbol As ICartographicLineSymbol 'ISimpleLineSymbol Dim pMap As IMap Dim pLineProps As ILineProperties Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap '.Maps.Item(0) Set pGC = pMap Set pPageLayout = pMxDoc.PageLayout Set pPointColl = New Polyline Set pElement = New LineElement Set pLineElement = New LineElement Set pPoint1 = New Point Set pPoint2 = New Point Set pPoint3 = New Point Set pColor = New RgbColor Set pLineSymbol = New CartographicLineSymbol 'pLineElement.Symbol Set pLineProps = pLineSymbol Set pElement = pLineElement Dim eLineTemplate As ITemplateSet eLineTemplate = New TemplateeLineTemplate.Interval = 2eLineTemplate.AddPatternElement 5, 1Set pLineProps.Template = eLineTemplatepLineSymbol.Width = 1pLineSymbol.Cap = esriLCSButtpLineSymbol.Join = esriLJSBevel With pColor .Blue = 125 .Red = 180 .Green = 42 End With pLineSymbol.Color = pColor pLineElement.Symbol = pLineSymbol With pPoint1 .X = -104 .Y = 26 End With With pPoint2 .X = -97 .Y = 35 End With With pPoint3 .X = -87 .Y = 42 End With pPointColl.AddPoint pPoint1 pPointColl.AddPoint pPoint2 pPointColl.AddPoint pPoint3 pElement.Geometry = pPointColl pGC.AddElement pElement, 0 pMxDoc.ActiveView.Refresh End Sub