<< Click to Display Table of Contents >> Getting and setting PlanMaker properties |
As soon as a connection with PlanMaker has been made, you can "control" the application. For this, properties and methods are provided – this has already been discussed in the section OLE Automation.
Let's first talk about properties. Properties are options and settings that can be retrieved and sometimes modified.
For example, if you wish to retrieve PlanMaker's application name, you can use the Name property of the Application object:
MsgBox "The name of this application is: " & pm.Application.Name
Application.Name is a property that can only be read, but not written to. Other properties can be both retrieved and changed from BasicMaker scripts. For example, the coordinates of the PlanMaker application window are stored in the properties Left, Top, Width and Height. You can retrieve them as follows:
MsgBox "The left window position is at: " & tm.Application.Left
But you can also change the content of this property:
pm.Application.Left = 200
PlanMaker reacts immediately and moves the left border of the application window to the pixel position 200. You can also mix reading and changing the values of properties, as in the following example:
pm.Application.Left = pm.Application.Left + 100
Here, the current left border value is retrieved, increased by 100 and set as the new value for the left border. This will instruct PlanMaker to move its left window position 100 pixels to the right.
There is a large number of properties in the Application object. A list of them can be found in the section PlanMaker's object model.