Access Violation when creating MOLE Symbology in ArcGlobe 10.1

396
1
08-07-2012 12:44 PM
BryanKardisco
New Contributor
Transitioning from 10.0 to 10.1 and creating MOLE symbology in ArcGlobe - the application crashes at the following line of code

Globe.AddLayerType(graphicsLayer.GlobeGraphicsLayer as ILayer , esriGlobeLayerType.esriGlobeLayerTypeUnknown, false);


Leading up to this I do the following:

I have a custom class called 3DDataLayer which has the following properties:  IForceElementLayer (named MoleLayer) , IGlobeGraphicsLayer (named GlobeGraphicsLayer) and other properties that aren't relevant.


The first thing I do is create a workspace by doing the following
IFeatureWorkspace featureWorkspace;

myWorkspace = myWorkspaceFactory.CreateNewScratchWorkspace();
featureWorkspace = myWorkspace as IFeatureWorkspace;

myFields = new FieldsClass();
//... // Setting my field names and alianses and properties
featureWorkspace.CreateFeatureClass(inName, myFields,  null  , null , esriFeatureType.esriFTSimple , "Shape" , String.Empty);


//Create a mole layer



I create the mole layer as follows

IFeatureClass featureClass = LoadFeatureClass(inName);

IGeofeatureLayer featureLayer = new FeatureLayer() as IGeofeatureLayer;
featureLayer.FeatureClass = featureClass;

ICachedGraphicFeatureLayer moleLayer = new ForceElementLayer() as ICachedGraphicFeatureLayer;
moleLayer.FeatureLayer = featureLayer;

//Set properties such as size / 3d settings / 

ILayer layer = moleLayer as ILayer;
layer.Name = inName;

Globe.AddLayerType(layer , esriGlobeLayerType.esriGlobeLayerTypeDraped, false);
myMoleFeatureClass = featureClass;



Any ideas why this is blowing up?  I need this so I can turn on Military Symbology based upon certain trigger conditions.
0 Kudos
1 Reply
BryanKardisco
New Contributor
After looking online a bit it looks like the issue is resolving from loading a Feature Class from an existing GeoDatabase (GDB).

Is this something others have seen?

I need this ability to create MOLE Symbology and be able to switch back between MOLE Symbology and generic graphics that I draw when not enabling said symbology.
0 Kudos