PreviousNext
Help > Programming PhotoModeler - Scripting/DDE Interface > Command Structure
Command Structure

PhotoModeler's API commands take a very simple form.  All PhotoModeler API commands are ASCII text strings and are of the format: "commandName commandParam1 commandParm2 ...". All commands return values and a return code indicating success or failure. PhotoModeler's API commands are NOT case sensitive. For example, the commands "GetNextPoint", "getnextpoint" and "GETNEXTPOINT" are all equivalent.

For external access, use the DDE interface of PhotoModeler this way:

        Start PhotoModeler.

        Start your DDE client program.

        The DDE client opens a DDE channel to PhotoModeler using "DDE Initiate" with the server name: "PhotoModeler" and the topic: "Data".

        The DDE client sends DDE commands using "DDE Request" to PhotoModeler.

        The DDE client closes the DDE channel to PhotoModeler using "DDE Terminate".

Each programming or macro language has different syntax and methods for using DDE. Look into the manuals for your language for further instructions.  As an example, using the Microsoft Word Visual Basic language step 3 above would be:

c = DDEInitiate(App:="PhotoModeler", Topic:="Data")

and a step 4. request to open a project would be:

DDERequest(Channel:=c, Item:="OpenProject d:\test1.pmr")

See the Example External Script / DDE Use  section for more detail.

Note 1: The command string sent to the DDERequest must not be longer than 254 characters or an error will result. The biggest problem this causes is with very long file names in the OpenProject and other file related commands.

Note 2: On some systems and with some languages the DDE command acknowledgment is not received back from PhotoModeler.  As a result, your client may give "time out" errors (or similar). You can usually get around this problem by "trapping" the TimeOut error message and ignoring it.