Using XML API

  XML_API > CAD XML API Reference >

Using XML API

Previous pageReturn to chapter overviewNext page

XML API is universal. It can be used in different ways to realize data exchange.

 

Dynamic Data Exchange (DDE) is the protocol that allows exchange data between applications. The DDE is supported by ABViewer. So integrating DDE support into a custom-developed application (app) will allow interact with ABViewer. The following steps are required to realize DDE interaction with ABViewer:

1. ABViewer must be specified as a DDE client. The "service" and "topic" parameters for the client must be specified as "abviewer"

2. The connection must be eastablished between the server(app) and the client (ABViewer)

3. A command execution by the client. ABViewer will automaticaly initialize the feedback connection (ABViewer server -> app client) when it is necessary. So the app name as parameter ("appsender=app_name") must be provided within a command body.

 

Exchange data with COM (CADEditorX, CADViewX) objects based on using a single function and a single event.

ProcessXML function is used for instructions processing. To process the XML instructions, call ProcessXML method and pass the XML document that contains the XML data as a parameter.

Syntax:

Delphi
function ProcessXML(const AInputWideString): WideString

C#
public string ProcessXML(string AInput)

VB.NET

Public Function ProcessXML(aInput As String) As String

C++
BSTR ProcessXML(BSTR AInput) 

JScript
public function ProcessXML(AInput : String) : String

Parameters

AInput - the input XML API document.

Return value

XML document that contains some output data.

 

OnProcess event fires when the ProcessXML function handled the provided instruction. This makes the event useful for parsing the returned XML data.

Syntax (CADEditorX):

Delphi
property OnProcess = procedure(ASenderTObject; const AXMLWideString) of object

C#
public event AxCADEditorLib.ISgCADEditorEvents_OnProcessEventHandler OnProcess

public delegate void ISgCADEditorEvents_OnProcessEventHandler(object ASender, AxCADEditorLib.ISgCADEditorEvents_OnProcessEvent e)

VB.NET

Public Event OnProcess(ByVal aSender As Object, ByVal e As AxCADEditorLib.ISgCADEditorEvents_OnProcessEvent)

C++/ATL
public IDispEventSimpleImpl<1, CCADEditorXEvents, &__uuidof(CADEditorLib::ISgCADEditorEvents)> 

JScript
public event OnProcess(ASender : ObjectAXML: String)

Parameters

ASender - the control providing the data.

AXML - the XML document that contains output data.

Go to ABViewer