GraphicAccess interface methods
- Last UpdatedJul 08, 2024
- 2 minute read
The IGraphicAccess interface includes separate graphic export and import methods.
ExportGraphicToXml method
Exports an Industrial Graphic to an XML file. Galaxy, graphic name, and the XML file path are passed as parameters to the ExportGraphicToXml function.
Syntax
IGraphicAccessResult ExportGraphicToXml(IGalaxy galaxy, string graphicName, string xmlFilePath);
Parameters
galaxy
IGalaxy obtained from GRAccess, returns the galaxy containing the graphic to export.
graphicName
Name of the graphic to export.
xmlFilePath
Directory folder to place the XML file containing the exported graphic.
ImportGraphicFromXml method
Imports a graphic from an existing XML file. Galaxy, graphic name, the XML file path, and an overwrite flag are passed as parameters to the ImportGraphicfromXml function.
Syntax
IGraphicAccessResult ImportGraphicFromXml(IGalaxy galaxy, string graphicName, string xmlFilePath, bool bOverWrite);
Parameters
galaxy
IGalaxy obtained from GRAccess, returns the galaxy where the graphic will be imported.
graphicName
Name of the graphic to import.
xmlFilePath
Directory folder location of the XML file.
bOverWrite
Boolean flag that indicates if an existing graphic can be overwritten by an imported graphic with the same name.
ValidateSymboltoExport method
Validates the graphic before exporting it to an XML file. For more information, see Validate Objects in Application Server Help.
Syntax
void ValidateSymboltoExport(IGalaxy galaxy, string graphicName);
Parameters
galaxy
IGalaxy obtained from GRAccess, returns the galaxy that contains the graphic that requires validation.
graphicName
Name of the graphic to validate.
After an import or export operation is complete, the results are set to IGraphicAccessResult which is derived from ICommandResult. A message appears and indicates if the operation succeeded or failed. For detailed information about the ICommandResult interface, see the GRAccess Toolkit API User's Guide.
A succeeded message only means the import or export operation finished successfully. It does not indicate the quality of the exported XML file or the imported graphic. Check the SMC log file for any warning or error messages after each export or import operation.