Document Information
Document Type: TechNote
Product(s): AutoPlant Piping
Version(s): 08.11.08.123
Original Author:Jesse Wolfe; Bentley Technical Support Group
Add a prompt for topworks when placing a control valve
Currently, when a control valve is placed, operators must be added manually. A simple change to the script files will force the user to select a topworks during control valve placement and avoid the need to manually add topworks to control valves. Please note the change below. It is recommended that all files be copied prior to modification and the original be kept as a backup.
The file that should be modified is the cntinput.ebs that is located at C:\Program Files\Bentley\Plant V8i\Modules\Base\common. A section should be added that creates a function for automatic topworks. For reference, this function is already present for standard valves in the vlvinput.ebs file.
If you prefer the easier option, rather than making hte changes yourself you can download a copy of the cntinput.ebs file here with the changes below already in place. Simply rename the existing one and drop the modified version into the common folder. You can find the file here
The first modification should be to the calls for the at_Valve_controlInput function. You can note the changes below by comparing the following to the installed version of the file:
'///////////////////////////////////////////////////////////////////////////////////////////
'//
'// Function - at_Valve_controlInput
'//
'///////////////////////////////////////////////////////////////////////////////////////////Sub at_Valve_controlInput()
Dim compID As At_ComponentID '// Component ID
Dim status As Integer '// Status code
Dim exitStatus As Integer '// Exit Status
Dim HELP_FILE As String '// String variable to store HELP FILE path
Dim compLen As Double
Dim shop As Double
Dim existing As Double
Dim pictureLibrary As String
Dim className As String
Dim tagNumber As String
Dim iRelType As Integer
Dim autotopworks As Integer
Dim prefStr As String 'added by Jesse Wolfe
Dim moduleName As String
Dim topworksClassName As String
Dim assocComps As String
Dim symbolName As String
Dim symbolInsertion As IntegerNext, you will want to add the actual function that will load the Topworks dialog during control valve placement. It can be added just under the help file and standard control valve dialogs are defined just below the callouts listed above. It should be changed to the following:
status = at_Component_getCurrID(compID)
status = at_Preference_getString (prefStr, "AUTO_TOPWORKS")
If (status <> AT_SUCCESS) Then
autoTopworks = 1
Else
If (prefStr = "1") Then
autoTopworks = 1
Else
autoTopworks = 0
End If
End Ifstatus = at_Component_getString(symbolName, compID, "3D_INSERTION_SYMBOL")
If (status = AT_SUCCESS) And (symbolName <> "") Then
symbolInsertion = 1
End IfIf (autoTopworks = 1) And (symbolInsertion = 0) Then
status = at_Component_getString(topworksClassName, compID, "OPERATOR")
If ((status <> AT_SUCCESS) Or (topworksClassName = "")) Then
status = at_Component_getString(topworksClassName, compID, "TOPWORKS_CLASS")
End If
If ((status <> AT_SUCCESS) Or (topworksClassName = "")) Then
status = at_Component_getString(moduleName, compID, "MODULE")
status = at_Module_selectComponentClass(topworksClassName, moduleName, "topworks.ini")
End IfIf (status = AT_SUCCESS) Then
status = at_Component_getString(assocComps, compID, "ASSOC_COMPS")
If (status = AT_SUCCESS) Then
assocComps = assocComps + ";" + topworksClassName
Else
assocComps = topworksClassName
End If
status = at_Component_putString(assocComps, compID, "ASSOC_COMPS")
End If
End If
External Links
Bentley Technical Support KnowledgeBase
Comments or Corrections?
Bentley's Technical Support Group requests that you please submit any comments you have on this Wiki article to the "Comments" area below. THANK YOU!