Guide to Using DWG and Other Formats
Guide to Using DWG and Other Formats
Guide to Using DWG and Other Formats

Sending key-ins to MicroStation through a DDE link

You can send key-ins to MicroStation through a DDE link. For example, you can create a macro in a spreadsheet to start a DDE “conversation” with and send key-ins to MicroStation.

MicroStation understands the following types of DDE requests:

Applications that can make these DDE requests include Excel, Lotus 1-2-3, Object Vision, Visual Basic, and Word Basic.

To send a key-in to MicroStation via a DDE link from an application
  1. Send the INITIATE request to establish the DDE link with MicroStation.

  2. Use the EXECUTE request to send the key-ins to MicroStation.

  3. Send the TERMINATE request to end the conversation with MicroStation.
    In each of these steps, you must use the syntax of the application that is sending key-ins to MicroStation to make the DDE requests.

Sample DDE “conversation”

The following Microsoft Excel macro rotates the contents of MicroStation's View 1 in 5° increments about the horizontal axis.

In this macro, chan is any Excel variable name, and it is needed to refer to this particular conversation in subsequent DDE requests. The contents of the macro are explained in the following table:

=INITIATE("Ustn","Keyin")

Opens the conversation with MicroStation. The constants Ustn and Keyin are mandatory.

=EXECUTE(chan,"rv=5")

Passes the key-in RV=5 to MicroStation.

=FOR("Count",1,40)

Starts a loop for 40 times.

=EXECUTE(chan,"selview 1")

Uses the key-in SELVIEW 1 to simulate the entry of a data point in View 1.

=NEXT()

Marks the end of the loop.

=TERMINATE(chan)

Terminates the DDE conversation with MicroStation.

=RETURN()

Marks the end of the Excel macro.