Example 8: VBScript
This VBScript example exercises some typical end user functions. It also highlights some customization API calls, like setting titles and icons.
To run this example:
2. Run vbscript example.vbs using Command Prompt. A Windows Script Host notification window opens. Click OK to dismiss this window.
3. PTC Mathcad Prime opens. A Windows Script Host notification window opens to inform you that PTC Mathcad Prime started successfully. Click OK to dismiss this window.
4. The API opens a test.mcdx worksheet. A Windows Script Host notification window opens that shows the number of input regions in the worksheet, and the alias for the first input.
5. In the worksheet, note the two input regions that define the input1 and matrixInput1 variables. Click OK to dismiss this window.
6. A Windows Script Host notification window opens informing you the API uses the SetRealValue method to change Input1 from 45 kg to 12.2341 km. Click OK to dismiss this window.
7. The value of Input1 changes to 12.2341 km. A Windows Script Host notification window opens showing the number of output regions in the worksheet, and the alias for the first output. Click OK to dismiss this window.
8. A Windows Script Host notification window opens informing you that the API is using the GetRealValue method to read the new value of output1. Click OK to dismiss the window.
9. A prompt displays to confirm you want to save changes you made to the test worksheet. Click Don’t Save to close the worksheet and close PTC Mathcad Prime.