Create a prompt for automatic loading - PDS - Installation

Plant Design System (PDS) Project Setup Technical Reference

3D Design and Visualization

While still in the BASIC editor for your Macro, you can create a prompt to accept the setting of the ACS when the model is loaded.

  1. Click Edit > Custom Dialog > Edit.

    The Builder dialog box opens. Here you define the dialog box to open and the options associated with it.

  2. Click New.

    A new dialog box opens allowing you to edit the text.

  3. To include a message, add a label from the Builder Tools menu and place that label on the dialog box.

  4. In the Builder window labeled PushButton, double-click the items you want to label.

  5. Change the text for these items to provide Yes and No buttons, and a label asking what to do next.

  6. Save the dialog box and return to your Script

Edit script to accept input from the user

The following is an edit to the example using this new Startup dialog box.

'Author : INTERGRAPH Corp
Project : Some Project
'Template file : Unit1.bas
'Date : 3/1/2010
Sub main
Dim startPoint As MbePoint
Dim point As MbePoint, point2 As MbePoint
Dim Button As Long
Dim Msg As Integer

Button = MbeOpenModalDialog (1)
If (Button = MBE_BUTTON_OK) Then
'First remove existing ACS from design file if update required
MbeSendKeyin "Delete Acs UNIT#1"
'Define ACS 0,0,0 origin within MicroStation design file
MbeSendKeyin "Define Acs Points "
MbeSendKeyin "XY=100,75,0"
'Define ACS X Axis (if rotation required use DI=distance,angle)
MbeSendKeyin "DL=100"
'Define ACS Y Axis (if rotation required use DI=distance,angle)
MbeSendKeyin "DL=-100,100"
'Save and Attach New ACS tp design file
MbeSendKeyin "Save Acs UNIT#1"
MbeSendKeyin "Attach Acs UNIT#1"
MbeSendKeyin "Attach Acs"
MbeSendKeyin "Reset"
'Set your tentative point readout to use the new Coord System
MbeSendKeyin "SET TPMODE ACSDelta"
MbeSendKeyin "SET TPMODE ACSLocate"
'Once the ACS is set pass a Message Box to the user saying it was set
Msg = MbeMessageBox ("Your Auxiliary Coordinate system is set to Unit#1")
'Here we can tell the user via the Microstation prompt that the
Call MbeWritePrompt ("You have declined to set an Auxiliary Coordinate system")
End If
End Sub