Dashed lines created programatically in ArcMap using ISimpleLineSymbol, print as solid lines.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM001365
已提交
March 2, 2006
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.1
状态
Known Limit
经开发团队审核,已确定此问题与不受 Esri 控制的软件的已知限制有关。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
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