AnsweredAssumed Answered

VB.NET Add Relates using IMapTableInfo

Question asked by cdebruin on May 17, 2016
Latest reply on Jun 22, 2016 by cdebruin

Hi everyone,

 

I've come across an issue with MXD relates and I need a .NET solution to add them to a map. I started with a sample that uses ArcObjects, but I hit a stumbling block with the IMapTableInfo Interface. I have no idea how to get or set this object. I've read the documentation page, but it doesn't seem to have any useful information (that I understood).

 

Has anyone used this object?

Does anyone have code samples using IMapTableInfo that can help me?

Does anyone have code samples that can help me add MXD relates?

 

This is the code sample I've already found (the problem being that it expects a valid IMapTableInfo object as a parameter):

IRelateInfos pRIs = null; 
IRelateInfo pRI = null;
pRIs = pMTI.RelateInfos;
if (pRIs == null) 
{
  Console.WriteLine(“No relationship is available”); 
  return;
}
for (int j = 0; j < pRIs.Count; j++)
{
  pRI = pRIs.get_Element(j);
  Console.WriteLine(pRI.Name + “, " + pRI.RelationshipID + “, ” + pRI.RelatedTableID + “\n”);
}


I've also explored Python and geoprocessing as options. There is no method to "Add Relates" in ArcMap. It does exist in ArcGIS Pro, but that product is basically nonfunctional.

Outcomes