AnsweredAssumed Answered

Exception while creating the schematic diagram for selected features?

Question asked by sreerajan on Jul 19, 2014
Latest reply on Jul 22, 2014 by sreerajan

I am trying to generate schematic using the below code, this code is working fine to generate schematic for logical data. But the same code is raising exception "while creating the schematic for selected featues in map". I have used the"Geo initial position" layou.

Please help me to resolve this isse.

 

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.AccessWorkspaceFactory");

IWorkspaceFactory sWorkspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);

IWorkspace sWorkspace = sWorkspaceFactory.OpenFromFile(@"xxxxxx.mdb", 0);

ISchematicWorkspaceFactory oSchematicWorkspaceFactory = new SchematicWorkspaceFactory();

ISchematicWorkspace sSchematicWorkspace = oSchematicWorkspaceFactory.Open(sWorkspace);

ISchematicDataset sSchematicDataset = sSchematicWorkspace.get_SchematicDatasetByName("TestDataset");

ISchematicDiagramClassContainer oSchDiagramClassContainer = (ISchematicDiagramClassContainer)sSchematicDataset;

ISchematicDiagramClass sSchematicDiagramClass = oSchDiagramClassContainer.GetSchematicDiagramClass("TestTemplate");

ISchematicBuilder sSchematicBuilder;

ISchematicStandardBuilder sSchematicStandardBuilder;

Type.GetTypeFromProgID("esriSchematic.SchematicStandardBuilderContext");

Activator.CreateInstance(objClassType);

ISchematicBuilderContext sSchematicBuilderCtxt = (ISchematicBuilderContext)objApp_Late;

ISchematicBuilder)sSchematicDiagramClass;

ISchematicStandardBuilder)sSchematicDiagramClass.SchematicBuilder;

sSchematicStandardBuilder.InitializeLinksVertices = false;

sSchematicStandardBuilder.AutoCreateElementClasses = true;

ITrackCancel oTrackCancel = new TrackCancelClass();

ISchematicDiagramContainer)sSchematicDataset;

objSchemaDiag = sSchematicBuilder.GenerateDiagram("xxxxx", pSchematicDiagramContainer, null, sSchematicBuilderCtxt, oTrackCancel); //Exception raised

 

Exception in Generate diagram

COMException was CaughtError

HRESULT E_FAIL has been returned from a call to a COM component.

 

Regareds

Sreerajan P

Outcomes