Get Point Coordinates

Plugin Introduction:

This sample is used to add the x and y coordinates of the interior points of geometric objects to the attribute table of a dataset.

Control/Object/Interface:

Control/Object/Interface Properties Methods
Plugin   Initialize(), ExitInstance()
CtrlAction   Run()
Application ActiveApplication, MainForm Output()
IFormMain FormManager  
IFormManager ActiveForm  
IFormTabular TabularControl  
TabularControl Recordset  
DatasetVector FieldInfos GetRecordset()
FieldInfo Name, Type, MaxLength, Caption  
Recordset Dataset SetFieldValue()
FieldInfos   Add(), Remove()

Basic Steps:

  1. Open GetPointXY.sln in the SuperMap iDesktop 8C\SampleCode\GetPointXY with Microsoft Visual Studio 2008 and compile it.
  2. When succeeded, you can find two files generated: SuperMap.Desktop.GetPointXY.dll located in the SuperMap iDesktop 8C\Bin\Plugins\GetPointXY folder and SuperMap.Desktop.GetPointXY.config located in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.
  3. Copy the SampleIcons folder from the SuperMap iDesktop 8C\SampleCode folder to SuperMap iDesktop 8C\SampleCode\Resources.
  4. Start SuperMap iDesktop 8C and you will find the Additional Functions tab with the Generate Coordinates Fields button.
  5. Open World.udb provided in the SuperMap iDesktop 8C\SampleData\World folder and open the attribute table of the Capitals dataset.
  6. Click the Additional Functions tab and click the Generate Coordinates Fields button.
  7. The Add Point Coordinates function is performed and the attribute table is closed.
  8. When you see "Succeeded to add interior point coordinates to the attribute table!" in the Output Window, open the attribute table of the dataset to view the results. You will find that two fields are added to the attribute table: UserX and UserY.

Data:

SuperMap iDesktop 8C\SampleData\World\World.udb.

Note:

When you successfully compile GetPointXY.sln, SuperMap.Desktop.GetPointXY.dll and SuperMap.Desktop.GetPointXY.config will be generated and copied to SuperMap iDesktop 8C\Bin\Plugins\GetPointXY and SuperMap iDesktop 8C\WorkEnvironment\Default respectively. Each time you start SuperMap iDesktop 8C, the GetPointXY plugin will be loaded.

If you want to remove the GetPointXY plugin from SuperMap iDesktop 8C, you only need to delete SuperMap.Desktop.GetPointXY.config in the SuperMap iDesktop 8C\WorkEnvironment\Default folder.