How to use 3D Symbol with IFeatureLayer (GlobeControl)

03-23-2012 05:46 AM
by Anonymous User
Not applicable
Original User: fabpuddu


I used 3D Symbol in GlobeControl using IGlobeGraphicsLayer and AddElement, and work fine.
Now I'm trying to using IFeatureLayer but I have a problem with .3DS symbol.
The symbol not displayed in 3D but it seems on the surface, the symbol does not seem to be the symbols loaded and displays a label '3D Marker'

In attachments the symbol using GraphicLayer and using FeatureLayer

I can manage 3D symbols using IFeatureLayer ? How I can do ?

This is my code:

        Dim pFeatureClass As IFeatureClass
        pFeatureClass = CreateFeatureClass(esriGeometryType.esriGeometryPoint)

        Dim pFLy As IFeatureLayer
        pFLy = New FeatureLayer

        With pFLy
            .FeatureClass = pFeatureClass
            .Name = m_NameLayer
            .Cached = True
            .Selectable = True
        End With

        Dim marker3dSymbol As IMarker3DSymbol = New Marker3DSymbol

        marker3dSymbol.UseMaterialDraping = True
        TryCast(marker3dSymbol, IMarkerSymbol).Size = 50

        Dim pColor As IColor = New RgbColor
        pColor.RGB = RGB(0, 255, 0)
        pColor.Transparency = 255

        Dim pMarker3DPlace As IMarker3DPlacement
        pMarker3DPlace = marker3dSymbol
        pMarker3DPlace.Size = 50
        pMarker3DPlace.Color = pColor
        pMarker3DPlace.Units = esriUnits.esriMeters

        Dim pRend As IFeatureRenderer
        Dim pSimpleRend As ISimpleRenderer

        Dim pGeoFL As IGeoFeatureLayer

        ' create a new CustomSimpleRend
        pRend = New SimpleRenderer

        ' set symbol.  we must use ISimpleRenderer interface
        pSimpleRend = pRend
        pSimpleRend.Symbol = TryCast(marker3dSymbol, ISymbol)

        pGeoFL = pFLy

        pGeoFL.ScaleSymbols = True

        ' set the new renderer to the layer and refresh the map
        pGeoFL.Renderer = pRend

        m_objGlobeControl.Globe.AddLayerType(TryCast(pFLy, ILayer), esriGlobeLayerType.esriGlobeLayerTypeDraped, True)

Thanks at all

0 Kudos
1 Reply
New Contributor
anyone can help me?

0 Kudos