Opening a schematic diagram in v.10 [C#]

457
2
Jump to solution
08-23-2012 06:16 AM
Hassene_Heridi
New Contributor
Hi everyone,

We're actually working on migrating 9.3 Schematics code into v.10 but we have some problems.
In the 9.3 version, we used to use the method "OpenDiagram" (from the INgDiagramType) to open a schematic diagram in the current map.
But impossible to find an equivalent to this method in the v.10.

Is anyone know which method to use instead? or if there's no equivalent, how can we try to open a diagram by code?

Thanks,

H.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RickAnderson
Occasional Contributor III
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/#/DisplayDiagram_Method/003t0000001...

You should use the ISchematicDisplayDiagramHelper.

You need first to have a handle to the ISchematicDataset, then you get the desired diagram class (the old diagram type).  From the class, you get the diagram and finally use the diagram helper to 'display' the diagram.

Dim pSchematicDiagramClass As ISchematicDiagramClass
  Dim pDiagramClassContainer As ISchematicDiagramClassContainer

  pDiagramClassContainer = m_pSchematicDataset
  pSchematicDiagramClass = pDiagramClassContainer.GetSchematicDiagramClass("INTERNAL_DIAGRAM")
Dim pDiagram As ISchematicDiagram
  pDiagram = pSchematicDiagramClass.SchematicDiagramByName(plant_name)
...
m_pDispDiagramHelper.DisplayDiagram(pDiagram, Nothing)



More information about migrating code:
http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/d/000100000m29000000.h...

View solution in original post

0 Kudos
2 Replies
RickAnderson
Occasional Contributor III
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/#/DisplayDiagram_Method/003t0000001...

You should use the ISchematicDisplayDiagramHelper.

You need first to have a handle to the ISchematicDataset, then you get the desired diagram class (the old diagram type).  From the class, you get the diagram and finally use the diagram helper to 'display' the diagram.

Dim pSchematicDiagramClass As ISchematicDiagramClass
  Dim pDiagramClassContainer As ISchematicDiagramClassContainer

  pDiagramClassContainer = m_pSchematicDataset
  pSchematicDiagramClass = pDiagramClassContainer.GetSchematicDiagramClass("INTERNAL_DIAGRAM")
Dim pDiagram As ISchematicDiagram
  pDiagram = pSchematicDiagramClass.SchematicDiagramByName(plant_name)
...
m_pDispDiagramHelper.DisplayDiagram(pDiagram, Nothing)



More information about migrating code:
http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/d/000100000m29000000.h...
0 Kudos
Hassene_Heridi
New Contributor
Hi,

Thank you for the answer.
0 Kudos