AnsweredAssumed Answered

IRepresentationRule.InsertLayer has not desired effect

Question asked by GisUser3333 on Feb 21, 2014
Latest reply on Feb 23, 2014 by GisUser3333
I am trying to create line-Representations with several Layers.
Therefore I am using the IRepresentationRule.InsertLayer method within a loop.
The line-representation should have several symbol-layers
but only the last inserted symbol-layer is visible in my created style.

Hereâ??s the code for creating the line-representations.

Dim pRepresentationRule As IRepresentationRule 'Repräsentationsregel
Dim pBasicSymbol As IBasicSymbol = New BasicLineSymbol
Dim pBasicLineSymbol As IBasicLineSymbol = New BasicLineSymbol
Dim pGraphicAttributes As IGraphicAttributes
Dim pColor As IColor = New RgbColor
Dim varColor As Object
Dim intCounter As Integer
Dim pStyleGalleryItems As IEnumStyleGalleryItem
Dim pStyleGalleryItem As IStyleGalleryItem
Dim pStyleGalleryClass As IStyleGalleryClass
Dim newOBJECT As Object
Dim newRepRuleItem As IRepresentationRuleItem

��������

For Each pLineElem In pLineComponent.listLineElems

pGraphicAttributes = pBasicLineSymbol.Stroke
varColor = pColor
pGraphicAttributes.Value(0) = pLineElem.dblWidth 'Width
pGraphicAttributes.Value(1) = "Stumpf" 'Cap
pGraphicAttributes.Value(2) = "Spitz" 'Join
pGraphicAttributes.Value(3) = varColor 'Color

pBasicSymbol = pBasicLineSymbol

pRepresentationRule.InsertLayer(intCounter, pBasicSymbol)
Debug.Print(pRepresentationRule.LayerCount)


intCounter = intCounter + 1

Next

'add to gallery
'Create object
pStyleGalleryClass = New RepresentationRuleStyleGalleryClass

newOBJECT = pStyleGalleryClass.NewObject("Linienrepräsentationsregel")

newRepRuleItem = newOBJECT
newRepRuleItem.RepresentationRule = pRepresentationRule

pStyleGalleryItem = New StyleGalleryItem

pStyleGalleryItem.Name = strName
pStyleGalleryItem.Item = newRepRuleItem
pStyleGallery.AddItem(pStyleGalleryItem)


Thanks for any help!

Outcomes