POST
|
I used ArcObjects for .NET to create a schematic dataset, then a schematic diagram class (aka "schematic template" in the UI) wherein I load feature classes. To do that, I followed the sample: "Create A Standard Builder Schematic Diagram Class From Scratch". But when I generate diagrams, I get from ArcMap a "missing spatial reference" warning. So how to set the spatial reference? In ArcMap, it's possible in the properties of the schematic template. But using ArcObjects, I can't find an interface of the class SchematicDiagramClass to set the ISpatialReference. I would appreciate any help on that. Thanks!
... View more
01-27-2015
02:35 AM
|
0
|
10
|
5057
|
POST
|
As a temporary solution, I will use C# instead of Java, only for the schematic diagram generation.
... View more
09-10-2014
06:54 AM
|
1
|
0
|
975
|
POST
|
Yes, I realize that too. And it seems that there is not many developers using ArcObjects + Java + Schematics...
... View more
09-10-2014
06:48 AM
|
0
|
1
|
975
|
POST
|
Thanks for this helpful set of samples. According to the "Create A Standard Builder Schematic Diagram Class From Scratch" snippet, we must instanciate a SchematicStandardBuilder object like that: objectType = Type.GetTypeFromProgID("esriSchematic.SchematicStandardBuilder"); ESRI.ArcGIS.Schematic.ISchematicStandardBuilder pSchStandardBuilder; if (objectType == null) return null; pSchStandardBuilder = Activator.CreateInstance(objectType) as ESRI.ArcGIS.Schematic.ISchematicStandardBuilder; So, I found an equivalent way in Java to calling Activator.CreateInstance: ISchematicStandardBuilder schematicStandardBuilder = (ISchematicStandardBuilder)Class.forName("esriSchematic.SchematicStandardBuilder").newInstance(); At this line, I get a "java.lang.ClassNotFoundException: esriSchematic.SchematicStandardBuilder" exception. Does it means that it's not possible to create a Java instance of the SchematicStandardBuilder class?
... View more
09-08-2014
07:31 AM
|
0
|
0
|
322
|
POST
|
OK, thanks for your explanations. So in my simple case, it seems clear it's better to use the standard builder. However, I don't know how to create a ISchematicStandardBuilder, as there is no SchematicStandardBuilder object class in Java, and the function schematicDataset.getSchematicBuilder() returns an ISchematicBuilder which is not castable to ISchematicStandardBuilder. So, for example, I can't turn on the option "AutoCreateElementClasses". I also tried instantiating with ISchematicStandardBuilderProxy: ISchematicStandardBuilder schematicStandardBuilder = new ISchematicStandardBuilderProxy(); but I have a NullPointerException when calling: schematicStandardBuilder.setAutoCreateElementClasses(true); Do you know how to create a standard builder using Java?
... View more
09-08-2014
05:54 AM
|
0
|
2
|
322
|
POST
|
I prefer the SQL query method, but actually it doesn't matter as I want to associate all GIS features to schematic features. I'm trying to automate the schematic dataset, template and diagram creation by code because I have to create a lot of geodatabases containing each one a geometric network and a schematic diagram based on it.
... View more
09-08-2014
02:35 AM
|
0
|
5
|
960
|
POST
|
I just tried to create a SchematiAttributeField instead of a attribute associated field and the createSchematicAttribute function works. So I have the following code: UID attributeFieldUID = new UID(); attributeFieldUID.setValue(SCHEMATIC_ATTRIBUTE_FIELD_UID); ISchematicAttribute schematicAttribute = schematicElementClass.createSchematicAttribute(fieldName, attributeFieldUID); ISchematicAttributeManagement schematicAttributeManagement = (ISchematicAttributeManagement)schematicAttribute; schematicAttributeManagement.setEvaluationMode(esriSchematicAttributeEvaluationMode.esriSchematicAttributeBuildEvaluation); schematicAttributeManagement.setStorageMode(esriSchematicAttributeStorageMode.esriSchematicAttributeFieldStorage); But now I have the following error when casting the ISchematicAttribute to ISchematicAttributeManagement: java.lang.ClassCastException: com.esri.arcgis.schematic.SchematicAttributeField cannot be cast to com.esri.arcgis.schematic.ISchematicAttributeManagement However, when I look in the Schematic Dataset Editor, I get the attribute field well created. The Storage mode is set to Field and the Evaluation mode to "on genete/update", so that's what I expected.
... View more
09-08-2014
02:26 AM
|
0
|
0
|
322
|
POST
|
Thanks for your reply. I understand how this sample works, but I don't know how to rewrite this kind of instantiation in Java: Dim objectType As Type = Type.GetTypeFromProgID("esriSchematic.SchematicStandardBuilderContext") considering there isn't any SchematicStandardBuilderContext class in the ArcObjects class package. Do you know what's the equivalent?
... View more
09-08-2014
01:44 AM
|
0
|
3
|
975
|
POST
|
And OK, I will try to create a SchematicAttributeField instead of a SchematicAttributeAssociatedField. Now, in ArcCatalog, I see my schematic dataset containing a schematic template, containing the schematic NODE and EDGE feature classes I created, so that's a good start.
... View more
09-08-2014
01:37 AM
|
0
|
8
|
960
|
POST
|
Yes, by using an SQL query when creating the node schematic element class, I expect to generate a diagram containing every node of my feature class. When you say that the standard builder will no longer manage them, that's to say node features selection has no effect on the diagram generation? Actually, in addition to this attribute issue, I don't manage to create a schematic diagram because I don't see how to instantiate (in java) a ISchematicStandardBuilder in order to use the generateDiagram function.
... View more
09-08-2014
01:30 AM
|
0
|
1
|
960
|
POST
|
Yes Anne-Yvonne, thanks for your reply. Actually, I was inspired by this .NET sample to write my Java code. I used the same method: after creating the ISchematicElementClass, the UID corresponding to the SchematicAttributeAssociatedField class is created, then I invoke the function createSchematicAttribute with the field name and this UID. So, maybe it's not the right time to invoke this function. I don't see how/when to do it.
... View more
09-05-2014
05:17 AM
|
0
|
12
|
960
|
POST
|
Hi, I would like to generate a schematic diagram using ArcObjects (Java) but I didn't find any sample or documentation on how to do it, even in the .NET samples. I only found this sample: Generating Standard Builder diagrams by code but it dates from ArcObjects 9.2 and is for VB. I can't find any equivalent in java to this kind of instantiation: Set pSchStandardBuilder = CreateObject("esriSchematic.SchematicStandardBuilder") Does anyone knows how to use the Schematics ArcObjects API? Thanks.
... View more
09-03-2014
08:02 AM
|
1
|
7
|
4637
|
POST
|
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
... View more
09-02-2014
08:55 AM
|
0
|
14
|
4231
|
POST
|
I have a map inside a page layout in ArcMap. Currently, I use this code to convert geographic coordinates to page coordinates: IMap map = ...
IPageLayout pageLayout = ...
IDisplayTransformation mapTransformation = ((IActiveView)map).getScreenDisplay().getDisplayTransformation();
IDisplayTransformation pageTransformation = ((IActiveView)pageLayout).getScreenDisplay().getDisplayTransformation();
IPoint mapPoint = ...
int x[] = {0};
int y[] = {0};
mapTransformation.fromMapPoint(mapPoint, x, y);
IPoint pagePoint = pageTransformation.toMapPoint(x[0], y[0]); The problem of this method is that x[0] and y[0] are device coordinates (integers). For example, if mapPoint = 913767.624037, 6458100.4284 (in meters) I get: x[0], y[0] = 18, -2 Then: pagePoint = 18.0, 2.0 (in centimeters) These values are corrects but they are rounded. I would expect for this example a pagePoint = 18.42 cm, 2.19 cm Is there another way to get directly map to page coordinates conversion without going through device coordinates? Or what's wrong in my conversion method? I would appreciate any help on this problem. Thanks!
... View more
04-07-2014
01:56 AM
|
0
|
1
|
619
|
Title | Kudos | Posted |
---|---|---|
1 | 05-27-2015 06:48 AM | |
1 | 09-10-2014 06:54 AM | |
1 | 09-03-2014 08:02 AM |
Online Status |
Offline
|
Date Last Visited |
01-19-2023
03:07 PM
|