Check internal settings on the drawing.

(At_dwgdata_getfldlist “at_rebis_app” “at_rebis_app_db”)

Couple of examples of setting the field data

(at_dwgdata_setfld "at_rebis_app" "at_rebis_app_db" "AT_REBIS_APP_DB_DOCTAGID" "C" "1111" 1 1 )

NOTE THE UPPERCASE "C"

(at_dwgdata_setfld "at_rebis_app" "at_rebis_app_db" "AT_REBIS_APP_DB_PROJECTROOT" "C" "\\\\Devserver-3d\\projects\\DEV_Projects\\" 1 1)

Spool prefix example for opcfhdr.ebs

'//

'// Write pipeline reference

'//

nStat = at_XchgGetCriteriaName(xfile)

nStat = at_XchgWriteText("PIPELINE-REFERENCE ")

nStat = at_XchgWriteText(xfile)

nStat = at_XchgWriteln()

'//

'// Write SPOOL-PREFIX

'//

nStat = at_Component_getCurrID(compID)

nStat = at_Component_getString (LineNum, compID, "LineNumber")

nStat = at_Component_getString (Module, compID, "ModuleNo")

nStat = at_Component_getString (Sheet, compID, "IsoSheetNo")

nStat = at_XchgWritelnText("SPOOL-PREFIX PM#-" + Module + "-" + LineNum + "-" + Sheet + "-0")

'// Re-set Data Source to Pipe Component to get component information

'//

stops spec break on instruments

add to opcfhdr.ebs

'//

'// Function to write component's piping spec

'//

Public Function PCF_PIPING_SPEC(indentFlag As Integer) As Integer

Dim nStat As Integer

Dim compID As At_ComponentID

Dim specName As String

Dim inopcfspec As Integer

nStat = at_Component_getCurrID(compID)

nStat = at_Component_getString (specName, compID, "SPEC")

specName = UCase(specName)

nstat = at_component_getint(inopcfspec, compid, "nopcfspecentry")

If (inopcfspec = 1)Then

Exit Function

End If

If (nStat = AT_SUCCESS) Then

If (indentFlag = 1) Then

nStat = at_XchgWriteText (" ")

End If

nStat = at_XchgWritelnText ("PIPING-SPEC "+specName)

End If

PCF_PIPING_SPEC = nStat

End Function

(at_pipingsystem_displayvariables)

****************************************

Piping System Variables:

COMP_PREF_INI_FILE = COMPPref

DESCRIPTION = AutoPlant Piping

LOCALDIR = C:\Documents and Settings\All Users\Application Data\Bentley\Plant

XM\PIPING

MENU_SELECTABLE = 1

PROGRAMDIR = C:\Program Files\Bentley\Plant XM\PIPING

REGAPP = at_pipe

STARTUP_FILE = at_pipe.lsp

STARTUP_FUNC = at_pipe_startup

SYS_PREF_INI_FILE = SYSPref

UNLOAD_FUNC = at_pipe_unload

USER_PREF_INI_FILE = UserPref

CADAPP = c:\Program Files\AutoCAD 2006\acad.exe

ACADCMDLINE = /p "C:\Documents and Settings\All Users\Application

Data\Bentley\Plant XM\AutoPLANT_PDW89ACAD_4001_409.arg" /b loadpiping

CFG_NAME = proj001

PIPVERSION = 0

PIPRELEASE = 1

BASE_MODULE = Base

MENU_LOCATION = 8

DRAW_REPS = 3D; 2D

DRAW_TYPES = Double; Single

UNITS_LIST = Imperial ; Metric ; Mixed Metric

DATA_MODE_LIST = From Settings; From Connecting Component

ORIENTATION_MODE = 1

RADIUSDIAMKEY = R

BENDRADIUSLIST = 1R; 1.5R; 3R; 5R ;6R

DRAW_MODE = 3D

DRAW_REP = 3D

DRAW_TYPE = Double

SURF_RESOL = 12

COMP_COLOR_MODE = 1

COMP_LAYER_MODE = 1

COMP_SHOW_INS = 0

POLY_COLOR_MODE = 1

POLY_LAYER_MODE = 1

POLY_VISIBILITY = 0

AT_ATTACHMENT_COLOR = 32

AT_ATTACHMENT_LAYER =

AT_ATTACHMENT_LINETYPE = Dot

AUTO_TOPWORKS = 1

COMP_DATA_MODE = 1

DEBUG_MODE = 0

AUTOROUTER_MODE = 0

SAVE_CADLINKS = 0

SAVE_PORTDATA = 0

ADVANCE_TAPMETHOD = 0

CURR_MODULE = Base

WELD_GAP_ALLOWANCE = 0.125

WELD_SIZE = 0.1

DISCONNECT_ZOOM_MAG = 50.0

MAX_JOINT_GAP = 0.0625

CONN_CHKR_HILITE_COLOR_1 = 1

CONN_CHKR_HILITE_COLOR_2 = 3

CONN_CHKR_IGNORENOTINSET = 1

COLOR_MODE_LIST = By Size; By Layer; By Spec; By Line number; By Paint; By

Service

LAYER_MODE_LIST = By Spec; By Line number; By Service; By Service + Line number

HIGHLIGHT_SIZE = 0.5

HIGHLIGHT_INSPT_COLOR = 2

HIGHLIGHT_CONNPT_COLOR = 3

HIGHLIGHT_REFPT_COLOR = 6

ORIENT_SYM_SIZE = 5

AUTOMATEFLAG = 1

OPTIMIZED_2D_GRAPHICS = 1

SQUARE_ELBOW = 0

INSULATION_LAYER = Insulation

INSULATION_COLOR = BYLAYER

INSULATION_LINESTYLE = DOT

AUTOPLANT_SELECTIONS = 1

PCF_STARTCOMP_SELECT = 0

PIPE_BREAK_STYLE = 0

PIPE_BREAK_STYLE_LIST = Curved; Straight; Invisible

NOMINAL = 10

SPEC = CS150

INSTHICK = 0.0

INSULATION = AA

PAINT_CODE = 2

TRACING = 0

WELDGAP_FLAG = 0

DISABLETOOLTIPS = 0

LINENUMBER = II-1008

UNIT = HEHAW

SERVICE = BR

SPOOL =

ISOSHTNO = 1

NORTH_DIRECTION = 90.0

ORIGIN_X = 0.0

ORIGIN_Y = 0.0

ORIGIN_Z = 0.0

WORLD_LENGTH = 100'

WORLD_WIDTH = 60'

NORTH_ARROW_SCALE = 50

NORTH_ARROW_FLAG = 0

LIMITS_FLAG = 1

SYMBOLS_DIR = C:\wink\proj001\config\piping\symbols

TEMPLATE = C:\wink\proj001\config\model\template\modtmpl

MENU_FILE = C:\Documents and Settings\All Users\Application Data\Bentley\Plant

XM\piping\At_Pipe

BORDERS_DIR = C:\wink\proj001\config\borders

ARROWS_DIR = C:\wink\proj001\config\model\symbols\narrows

SYMBOLS = C:\wink\proj001\config\piping\symbols\symbol.ini

BORDER = ABORD

NORTH_ARROW = NARROW

UNITS = Imperial

UNITS_TYPE = 1

ISOGEN_ROOT = C:\wink\proj001\Config

ISOGEN_PROJECT = Isogen

ROOT_SPECS_DIR = C:\Program Files\Bentley\Plant XM\specs\imperial

ROOT_SPECGEN_REPORTS = C:\Program Files\Bentley\Plant XM\Reports

DB_CONFIG_DIR = C:\Program Files\Bentley\Plant XM\database

ROOT_MODULES_DIR = C:\wink\proj001\Config\modules

MODULES_INI_FILE = C:\wink\proj001\Config\modules\modules.ini

MAX_SLOPE_TOL = 0.0625

MAX_WELDSLOPE_TOL = 0.0625

MAX_FLANGEDSLOPE_TOL = 0.01

MAX_THREADEDSLOPE_TOL = 0.01

MAX_MJSLOPE_TOL = 0.07

MAX_CLAMPEDSLOPE_TOL = 0.06

MAX_MISCSLOPE_TOL = 0.01

LENGTH_WEIGHT_FACTOR = 12.0

SPEC_VALIDATION = 0

SPEC_CACHESIZE = 10

WARN_BEFORE_CLEAN = 1

ISOGEN_UNITS_COORDINATE = INCH

ISOGEN_UNITS_BORE = INCH

ISOGEN_UNITS_BOLTDIA = INCH

ISOGEN_UNITS_BOLTLENGTH = INCH

ISOGEN_UNITS_WEIGHT = LBS

ISOGEN_BOLTDIACONVERSION = 1.0

NPSTOMETRICCONV = 1.0

INSTRUMENT_SPEC = INSTRUMENTS

COMP_CACHE_SIZE = 15

DEL_FASTENERS_FLAG = 1

DEL_ATTACHMENTS_FLAG = 0

SL_MINPORTRADIUS = 2

SL_THICKNESS = 0.0625

SL_HIDERADIUS = 1

COG_DENSITY = 0.036

COG_FILLED = 100

SPECGENPROJECTEDITMODE = 0

._XLOADCTL = 2

._DBLCLKEDIT = off

PIPINGSYS_NAME = PIPING

DOCUMENT_TYPE = 1

AT_SPECFIX_SCANNED = 1

V111_REPAIR_MARKER = 1

HLR_ENABLED = 1

AT_COMP_PORT_SYM = 86

AT_COMP_INSPT_SYM = A5

SPEC_DEFAULTS_FLAG = 0

USE_SYMBOL = 0

EQPAPP_NAME = AT_EQP

AT_REF_POINT_SYM = 281

PRELOAD_MODULES = AT_INSTR

AT_COMPONENT_SHOWENDS = 1

****************************************

Example of resetting a variable

(at_pipingsystem_setvariable “NORTH_DIRECTION” “90”)

parsing in annotate.ebs

'//////////////////////////////////////////////////////////////

'//

'// Line Number Short Annotation

'// Annotate the Size + Service + Spec + Line Sequence Number

'//

'//////////////////////////////////////////////////////////////

Sub at_Component_annotateLineNo()

Dim compID As At_ComponentID

Dim status As Integer

Dim lineNoStr As String

Dim specStr As String

Dim sizeStr As String

Dim annoText As String

Dim PnumStr As String '//added to for Tag_no parsing (C. Helms 1/25/06)

Dim Servicestr As String '//added to for Tag_no parsing (C. Helms 1/25/06)

Dim iDashPos As Integer '//added to for Tag_no parsing (C. Helms 1/25/06)

status = at_Component_getCurrID(compID)

If (status = AT_SUCCESS) Then

'// Set the line number based on part of the linenumber (Tag_no) - Tag equals Pserv-Pnum (c. Helms 1/25/06)

status = at_Component_getString( PnumStr, CompID, "LineNumber" )

If (status = AT_SUCCESS) Then

'// If the line has a dash get the text after it otherwise use the full string if the is no dash

iDashPos = InStr(1, PnumStr, "-", 1)

'// Call at_CAD_print (" in at_Component_annotateLineNo <-> located in " & PnumStr & " at position " & iDashPos & ebCrLf)

If (iDashPos > 0) Then

LineNoStr = Mid$(PnumStr, iDashPos + 1, Len(PnumStr))

Else

LineNoStr = PnumStr

End If

End If

status = at_Component_getString( specStr, CompID, "Spec" )

status = at_Component_getString( sizeStr, CompID, "Main_Size" )

status = at_Component_getString( ServiceStr, CompID, "Service" )

If sizestr = "" Then

'// Changed for new line number format (C. Helms 1/25/06)

annoText = ServiceStr + "-" + lineNoStr + "-" + specStr

Else

'// Changed for new line number format (C. Helms 1/25/06)

annoText = formatSizeStr(sizeStr) + "-" + ServiceStr + "-" + specStr + "-" + lineNoStr

End If

status = at_ScriptBuffer_putString( annoText, "AnnoText" )

End If

status = at_ScriptBuffer_putInteger( status, "Status" )

End Sub

Example of removing " marks in EBS files

last = right(BOLTLENSTR, 1)

If (last = Chr(34)) Then

BOLTLENSTR = left(BOLTLENSTR, Len(BOLTLENSTR) - 1)

End If

Example of adding a new annotation

Adding manufacturer name as an annotation

At_pipe.mnu

AT_Anno_DB [/MManufacturer ]^C^CAT_Annot_Manuf

At_pipe.mnl

(defun c:AT_Annot_manuf () (at_Piping_annotateComponent "Manufacturer") (princ))

Methods.ini (in piping section of base module)

Ann_manuf_Method = %APP_DIR%\Util\Annotate ; at_Component_annotatemanuf

Annotate.ebs

'//////////////////////////////////////////////////////////////

'//

'// Manufacturer field Annotation

'//

'//////////////////////////////////////////////////////////////

Sub at_Component_annotatemanuf()

Dim compID As At_ComponentID

Dim status As Integer

Dim manufStr As String

status = at_Component_getCurrID(CompID)

If (status = at_SUCCESS) Then

status = at_Component_getString( manufStr, CompID, "manu_fact" )

status = at_ScriptBuffer_putString( manufStr, "AnnoText" )

End If

status = at_ScriptBuffer_putInteger( status, "Status" )

End Sub

Annotate.ini

[manufacturer]

textfunction = Ann_manuf_Method

Process order the software uses.

At_Pipe.mnu à At_Pipe.mnlà Annotate.inià Methods.inià Annotate.ebs

To Change color or layer being used on Equipment

Class.ini

[VESHORPLN]

Type = EQUIP

SHAPE = HRZVESSEL

DRAW_METHOD = METHODS\DRAW\VESSEL ; VESSEL_HORIZ_PLAIN

DBEDIT_FILE = METHODS\UTIL\EDITDB ; EQPDBDLG

PXF_OUT_FILE = METHODS\UTIL\PXFOUT ; EQP_PXFOUT

PXF_IN_FILE = METHODS\UTIL\PXFIN ; EQP_PXFIN

JSM_OUT_FILE = METHODS\UTIL\JSMVESSEL ; EQP_JSMVESL_HP

LAYER = VESSEL

COLOR = bylayer

TAG_PREFIX = VH-

STATUS = Plain Horizontal Vessel

PICT_NAME = horizv

Process order the software uses.

At_Eqp.mnuà At_eqp.mnlà Class.inià appropriate.ebsà Limits.ini

Adding a new component to piping (using existing draw routine)

At_pipe.mnu

// Valves

//

AT_COMP_VALV [->/VValves]^C^C

AT_COMP_VALV [/TTopworks Browser]^C^Cat_SUpportsBrowser_load

[--]^C^C

AT_COMP_VALV [/BBall]^C^CAT_VALVE_BALL

AT_COMP_VALV [->/GGate]^C^C

AT_COMP_VALV [/GGate]^C^CAT_VALVE_GATE

AT_COMP_VALV [/KKnife Gate]^C^CAT_VALVE_Knife_GATE

AT_COMP_VALV [/EExtended Gate]^C^CAT_VALVE_EXT_GATE

At_pipe.mnl

(defun c:AT_VALVE_GATE () (at_Component_insert "Base" "AT_VALVE_GATE") (princ))

(defun c:AT_VALVE_Knife_GATE () (at_Component_insert "Base" "AT_VALVE_Knife_GATE") (princ))

(defun c:AT_VALVE_EXT_GATE () (at_Component_insert "Base" "AT_VALVE_EXT_GATE") (princ))

Class.ini

;//

;// Knife Gate Valve class

;//

[AT_VALVE_Knife_GATE]

PARENT_CLASS=BASE_VALVES_CLASS

SPEC_KEY=VALVE_Knife_GATE

METHOD_KEY=AT_VALVE_Knife_GATE

PICT_NAME=VALVE_GATE

CLASS_DESCRIPTION=Base Knife Gate Valve

SHORT_DESC=Knife GATE

SPEC_GROUP=VALVE

;//ISO_SYMBOL = GATE

Methods.ini

[AT_VALVE_Knife_GATE]

DRAW_METHOD = %APP_DIR%\Draw\Valves ; at_gvalve_draw

JSM_OUT_METHOD = XCHG\JSM\ValveOut ; JSM_OUT_gvalve

COG_PIPING = Common\BomDescr ; at_Pipe_cog

Speckey.ini

[VALVE_Knife_GATE]

SPEC_TABLE = VALVBW;VALVFL;VALVSCSW;VALVE

WHERE_CLAUSE = GTYPE = 'VALV' AND STYPE = 'KGAT' AND MAIN_SIZE = '$$Nominal$$'

SPECKEY_SCRIPT = at_SpecKey_Valves

DISPLAY_FIELDS= MAIN_SIZE;RATING;END_COND_1;TAG;FACING_1;TRIM_1;LONG_DESCR

Be sure to add the appropriate records to the catalog so they can be added to the spec.

Process order the software uses

At_pipe.mnuà At_pipe.mnlà Class.inià Methods.inià appropriate.ebsà Speckey.ini

Note: When customizing the software it is best to place the customized files in the project. Remember to maintain the same structure under the config directory of the project that is used in the software.

Setting up new Component Preferences

Compref.ini

To make an existing preference available change the compreftype = 0

To change an existing preference to use a pick list.

;Insulation thickness for newly inserted components.

;Insulation thickness

;INSTHICK 0.0

[Ins. Thk.]

ToolTip=Insulation thickness

Resulttype=STRING

ResultField=INSTHICK

ComPrefType=0

Type=Fixedlist

ApplicationType=ISO,Piping

DEFAULT=0

Filter = Off

numlist = 4

list1 = 0

list2 = 0.5

list3 = 1.0

list4 = 1.5

To add a new preference

[Def. Spec. Choice]

Type = FixedList

Numlist = 2

List1 = OFF

List2 = ON

ResultField = spec_defaults_flag

Tooltip = Specify whether AutoPLANT Selections is on or off

Resulttype = index_0

ComPrefType = 0

ApplicationType=Piping,ISO

Default = ON

Note: The resultfield variable is either an existing field in the piping table or a flag, the example above is a flag. If the comppref.ini is modified after the designers have started working in the project you will need them to go to the Documents and settings\all users\application data\bentley\plant xm\config directory and find the project directory. Once they have located the directory they will need to delete the cplpiping.ini file so that when they open a model in the project it will reread the comppref.ini file.