Applies To Product(s): AutoPLANT Piping Version(s): AutoPLANT V8i /AutoPLANT Modeler Environment: Windows 7 32 bit, Windows 7 64 bit Area: Component Subarea: N/A Original Author: Abhijit Bute, Bentley Technical Support Group Background During modeling, user should know the exact elevation of component. One convenient option, by flying a pointer on particular component and it should list the Elevation of that component in tooltip. See desired tooltip image below. Below are the steps to configure the settings. Steps to Accomplish Edit Methods.ini file. Make Sure AutoPLANT applications are completely closed. Open the file C:\Program Files (x86)\Bentley\Plant V8i\Modules\Base\Methods.ini in Notepad. Find the section [BASE_WORL D_METHODS]. Uncomment the following line by removing the characters ;// that exist at the beginning of the line as seen below: TOOLTIPS_METHOD = Common\Tooltips ; at_Tooltips_setTooltip Save and close the methods.ini file. Edit Tooltips.ebs. Open the file C:\Program Files (x86)\Bentley\Plant V8i\Modules\Base\common\Tooltips.ebs using the Script Editor. Add the customized code by finding the following section. status = at_Component_getString(fldVal, compID, "Long_Descr") If(status = at_SUCCESS) Then tooltipsString = tooltipsString + ebLf + fldVal End If 3. Copy the following section and paste it below the above. `// ******************************************************************************************************** `// Routine to output Elevation Top, Center and Bottom of pipe to the tool tip `// `// By default this outputs the Top of Pipe Elevation. To use a different elevation comment out the one in use using `// `// then remove `// from the new one required. The top of each set is the default calculation using 2 ports. The second uses `// the center point for its calculations and the third uses the insertion point. They are included if the default 2port does not `// display the correct value. `//********************************************************************************************************** status = at_Component_getCurrID(CompID) If(status = at_SUCCESS) Then `//Top of Pipe Elevation fldVal = annotateGetElevationText (compID, "TOP", "2port") `// Top of Pipe Elevation Annotation Defualt `// fldVal = annotateGetElevationText (compID, "TOP", "CP") `// Top of Pipe Elevation Annotation using the CP `// fldVal = annotateGetElevationText (compID, "TOP", "InsPt") `// Top of Pipe Elevation Annotation using insertion points `// Center of Pipe Elevation `// fldVal = annotateGetElevationText (compID, "COP", "2port") `// Top of Pipe Elevation Annotation Defualt `// fldVal = annotateGetElevationText (compID, "COP", "CP") `// Top of Pipe Elevation Annotation using the CP `// fldVal = annotateGetElevationText (compID, "COP", "InsPt") `// Top of Pipe Elevation Annotation using insertion points `// Bottem of Pipe Elevation `// fldVal = annotateGetElevationText (compID, "BOP", "2port") `// Top of Pipe Elevation Annotation Defualt `// fldVal = annotateGetElevationText (compID, "BOP", "CP") `// Top of Pipe Elevation Annotation using the CP `// fldVal = annotateGetElevationText (compID, "BOP", "InsPt") `// Top of Pipe Elevation Annotation using insertion points tooltipsString = tooltipsString + ebLf + "EL: "+ fldVal `// Edit the "EL: " to change the text that appears in the tooltip Ex "TOP: " End If ‘// End of Elevation section 4. Go to the bottom of the file and copy and paste the following to the bottom of the file. `// ******************************************************************************************************** `// Routine to output Elevation Top, Center and Bottom of pipe to the tool tip `// `// Taken from the annotation file `//********************************************************************************************************** Function annotateGetElevationText (compID As At_ComponentID, pointType As String, pointName As String) As String Dim status As Integer Dim pointText As String Dim pointText1 As String Dim portName As String Dim annoPoint As At_Point `// General location point Dim annoPoint1 As At_Point `// Temporary location point Dim pickPoint As At_Point `// Location of a selected port Dim ODMainSize As Double Dim elevation As Double Select Case pointName Case "CP" status = at_Component_getPoint(annoPoint, CompID, "CP.Loc") Case "InsPt" status = at_Component_getPoint(annoPoint, CompID, "InsPt.Loc") Case "2Port" status = at_Component_getPoint(annoPoint, CompID, "Port1.Loc") status = at_Component_getPoint(annoPoint1, CompID, "Port2.Loc") If (status = at_SUCCESS) Then status = at_CAD_strFromDouble (pointText, at_Point_getZ(annoPoint), AT_CADUNITS_USECADDEFAULT, AT_CADPREC_USECADDEFAULT) status = at_CAD_strFromDouble (pointText1, at_Point_getZ(annoPoint1), AT_CADUNITS_USECADDEFAULT, AT_CADPREC_USECADDEFAULT) `// Check if the two elevations are the same within the tolerance of the output. If (StrComp (pointText, pointText1, 1) 0) Then status = at_Component_selectPort(portName, compID, pickPoint, 0, 0, at_Msg("Sloped component detected, select required port", "PIP", 3)) If (status = AT_SUCCESS) Then status = at_Component_getPoint(annoPoint, CompID, portName+".Loc") End If Else End If End If End Select Select Case pointType Case "TOP" status = at_Component_getReal( ODMainSize, CompID, "PIPE_OD_M" ) elevation = at_Point_getZ(annoPoint) + (ODMainSize / 2.0) Case "COP" elevation = at_Point_getZ(annoPoint) Case "BOP" status = at_Component_getReal( ODMainSize, CompID, "PIPE_OD_M" ) elevation = at_Point_getZ(annoPoint) - (ODMainSize / 2.0) End Select status = at_CAD_strFromDouble (pointText, elevation, AT_CADUNITS_USECADDEFAULT, AT_CADPREC_USECADDEFAULT) annotateGetElevationText = pointText Exit Function End Function `//********************************************************************************************************* `// End of Elevation mod `//************************************************************************************************************ 5. Save and close the Tooltips.ebs file. 6. Start AutoPLANT, place a component, and hover over this component to review the Tooltip changes.
↧