AnsweredAssumed Answered

How to create schematic attribute as associated field using ArcObjects?

Question asked by kevinlecocq on Sep 2, 2014
Latest reply on Sep 8, 2014 by kevinlecocq

Hi,

I'm trying to automate the complete creation of a schematic template with ArcObjects SDK for Java (10.2).

I've managed to create the GDB, the schematic dataset and the schematic diagram class (template).

Then, I created a schematic element class associated with a feature class taken from the same GDB, which works.

I would like to share a field "NAME" between the feature class and the schematic element class, in order to label the nodes of a schematic diagram.

So, I tried that:

     ...

     ISchematicElementClass nodeSchematicElementClass = schematicDataset.createSchematicElementClass("NODE", esriSchematicElementType.esriSchematicNodeType);

     nodeSchematicElementClass.setSchematicDataSourceByRef(schematicDataSource);

     nodeSchematicElementClass.alterAssociatedObjectClass(schematicDataSource, nodeFeatureClass.getObjectClassID());

     nodeSchematicElementClass.setGeometryType(esriGeometryType.esriGeometryPoint);

     nodeSchematicElementClass.setExternalQueryEvaluationMode(esriSchematicExternalQueryEvaluationMode.esriSchematicQueryBuildEvaluation);

     nodeSchematicElementClass.setQueryString("SELECT * FROM NODE");

     schematicDiagramClass.associateSchematicElementClass(nodeSchematicElementClass);

 

     UID associatedFieldUID = new UID();

     associatedFieldUID.setValue("{7DE3A19D-32D0-41CD-B896-37CA3AFBD88A}"); // taken from the file ...\Desktop10.2\bin\configuration\CLSID\esri.clsid.ecfg

     ISchematicAttribute schematicAttribute = nodeSchematicElementClass.createSchematicAttribute("NAME", associatedFieldUID);

 

then I get the following ArcObjects error in the last line:

 

AutomationException: 0x80040a28 - Additional field can't be added : NAME in 'Esri Schematics'

 

I get the same error with any other field name.

Does anybody have a solution? Am I doing something wrong with my attribute field association?

I would appreciate any help! Thanks,

Kevin

Outcomes