Escolar Documentos
Profissional Documentos
Cultura Documentos
October 2009
DPDS3-PE-200024B
Copyright
Copyright 2005-2009 Intergraph Corporation. All Rights Reserved. Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement; contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade secret law, and international treaty, and may not be provided or otherwise made available without proper authorization from Intergraph Corporation.
Terms of Use
Use of this software product is subject to the End User License Agreement and Limited Product Warranty ("EULA") delivered with this software product unless the licensee has a valid signed license for this software product with Intergraph Corporation. If the licensee has a valid signed license for this software product with Intergraph Corporation, the valid signed license shall take precedence and govern the use of this software product. Subject to the terms contained within the applicable license agreement, Intergraph Corporation gives licensee permission to print a reasonable number of copies of the documentation as defined in the applicable license agreement and delivered with the software product for licensee's internal, non-commercial use. The documentation may not be printed for resale or redistribution.
Trademarks
Intergraph, the Intergraph logo, PDS, SmartPlant, SmartMarine, FrameWorks, I-Convert, I-Export, I-Sketch, IntelliShip, INtools, ISOGEN, MARIAN, SmartSketch, SPOOLGEN, SupportManager, and SupportModeler are trademarks or registered trademarks of Intergraph Corporation or its subsidiaries in the United States and other countries. Microsoft and Windows are registered trademarks of Microsoft Corporation. MicroStation is a registered trademark of Bentley Systems, Inc. Other brands and product names are trademarks of their respective owners.
Contents
Preface ......................................................................................................................................................... v Introduction ................................................................................................................................................ 1 Conversion Considerations and Assumptions ........................................................................................ 1 Installing and Initializing the Software .................................................................................................... 3 Installation .............................................................................................................................................. 3 Initialization ........................................................................................................................................... 4 Understanding Rules .................................................................................................................................. 5 Rule Sets ................................................................................................................................................ 5 Language ................................................................................................................................................ 5 Rule Components ................................................................................................................................... 5 Identification Criteria ...................................................................................................................... 6 Creating Drawing Sets ............................................................................................................................... 7 Adding a Drawing Set ............................................................................................................................ 7 Drawing Borders and Scale ............................................................................................................. 9 Snap To Target Behavior ............................................................................................................... 12 Finishing a Drawing Set ................................................................................................................ 14 Removing a Drawing Set ............................................................................................................... 15 Opening an Existing Drawing Set ........................................................................................................ 15 Creating Rule Sets .................................................................................................................................... 17 Adding a Rule Set ................................................................................................................................ 17 Deleting a Rule Set............................................................................................................................... 19 Adding Drawing Files to a Rule Set..................................................................................................... 19 Removing Drawing Files from a Rule Set ........................................................................................... 20 Analyzing File Structure ...................................................................................................................... 21 Group Data .................................................................................................................................... 22 Line and Line Run Data................................................................................................................. 22 Text Box Data ................................................................................................................................ 22 Recorder Assistant ............................................................................................................................... 23 Generating a Default Rule Set.............................................................................................................. 24 Generate Rule Set Dialog Box....................................................................................................... 25 Generating the Rule Set ....................................................................................................................... 26 Mapping Existing Rule Sets ................................................................................................................. 26 Using Excel Files as an Intermediate Format....................................................................................... 26
Editing Rule Sets ....................................................................................................................................... 27 Opening the Ruleset Editor .................................................................................................................. 27 Rule Criteria ......................................................................................................................................... 28 Rule Criteria for Groups ................................................................................................................ 30 Rule Criteria for Lines ................................................................................................................... 30 Removing a Rule .................................................................................................................................. 30 Mapping SmartPlant P&ID Symbols to Graphical Rules .................................................................... 31 Checking Symbol Size ......................................................................................................................... 32 Mapping a Rule to the Drawing Border ............................................................................................... 33 Creating a New SmartPlant P&ID Symbol .......................................................................................... 33 Conforming Graphics to a Rule ........................................................................................................... 34 Copying and Pasting Rules .................................................................................................................. 35 Testing Rules........................................................................................................................................ 35 Working With File Elements ............................................................................................................... 35 Creating a New Group and Rule .................................................................................................... 36 Ungrouping Graphics .................................................................................................................... 37 Adjusting Base Rotation of Graphics ............................................................................................ 38 Adjusting Origin of Graphics ........................................................................................................ 39 Recording Operations .................................................................................................................... 40 Viewing and Changing Properties of Graphics ............................................................................. 41 Measure Distance, Attribute Manager and Layer Manager commands. ....................................... 42 Applying Attributes to Graphical Rules ........................................................................................ 43 Merge Text Boxes ......................................................................................................................... 43 Attributes .............................................................................................................................................. 44 Pipelines and Attribute Data .......................................................................................................... 44 Instruments and Attribute Data...................................................................................................... 48 Explicitly Mapped Attributes ........................................................................................................ 50 Item Tag Attributes and Multiple Representation Placement ........................................................ 53 Assigning Rules to Graphics ................................................................................................................ 54 Simple Graphic-to-Symbol Association ........................................................................................ 54 Graphic-to-Symbol Association with Attributes ........................................................................... 54 Graphic Attributes and Label Symbols.......................................................................................... 55 Other Graphic Attributes ............................................................................................................... 56 VB Script Files for Attribute Mapping ................................................................................................ 60 Compiling and Testing a Rule Set ........................................................................................................... 63 Plant Item Information ......................................................................................................................... 63 Attribute and Label Information .......................................................................................................... 64 Starting the Conversion Process.............................................................................................................. 67 Auto Convert for Individual Files ........................................................................................................ 67 Snap To Target Behavior Setting .................................................................................................. 68 Batch Auto Convert ....................................................................................................................... 68 Results of Auto Convert ................................................................................................................ 69 Using VB Script Files for Attribute Mapping ...................................................................................... 69 Viewing Conversion Results ................................................................................................................ 71
ii
Cleaning up After Conversion ................................................................................................................. 73 Viewing the Auto Convert Log File..................................................................................................... 73 Converting Remaining Graphics .......................................................................................................... 73 Connector Alignment ........................................................................................................................... 75 Automatic Connector Alignment ................................................................................................... 76 Manual Connector Alignment ....................................................................................................... 76 Viewing Unconverted Graphics ........................................................................................................... 77 Converting Remaining Text ................................................................................................................. 77 Associated Text ............................................................................................................................. 78 Unassociated Text.......................................................................................................................... 79 Record Graphics ................................................................................................................................... 81 Exiting Post-Conversion Cleanup ........................................................................................................ 81 Functional Areas Not Addressed By SmartPlant Import Assistant ..................................................... 83 Regular Expressions ................................................................................................................................. 85 Regular Expressions Commonly used for SmartPlant P&ID Information........................................... 86 Index .......................................................................................................................................................... 87
Preface
This document is the installation and user's guide for Intergraph SmartPlant Import Assistant. This document introduces SmartPlant Import Assistant and explains how to set up and configure it. It also includes an introduction to its features. SmartPlant P&ID, Oracle, and all other required components must be already be installed and configured before SmartPlant Import Assistant.
Important information
This document explains how to use the SmartPlant Import Assistant tool only. Expert knowledge of SmartPlant P&ID is required. Successful results from using SmartPlant Import Assistant require users who have knowledge of the process industry. In order to achieve a successful conversion of "dumb" files to SmartPlant P&ID drawings, the user must map SmartPlant P&ID symbols to dumb graphics and assign attributes to these symbols. To do this successfully, the user must understand the process industry and have process engineering experience. Intergraph strongly recommends thoroughly reviewing this document before beginning a conversion. The SmartPlant Import Assistant tool enables conversion of much of the drawing. Finish the process with manual cleanup in SmartPlant P&ID. Intergraph gives customers permission to print as many copies of this document that they need for non-commercial use at their company. They cannot print this document for resale or redistribution outside their company. Send documentation comments or suggestions to PPMdoc@intergraph.com.
SECTION 1
Introduction
The SmartPlant Import Assistant is a SmartPlant P&ID add-on tool that imports AutoCAD, MicroStation, and PDS files into SmartPlant P&ID. The SmartPlant Import Assistant configurable rule base maps non-intelligent graphics into SmartPlant P&ID symbols and attributes to meet customer-specific P&ID conventions and formats. SmartPlant Import Assistant can be used in single or batch mode. Each P&ID must be preprocessed. After the conversion, the items that could not be resolved by the rules will be shown in an attached Smartframe to either manually resolve or to add or modify a rule. SmartPlant Import Assistant does not check or correct engineering content. Final quality assurance is the responsibility of the P&ID owner. The better the source data is structured, such as layers, colors, line weights, and so on, the better the final conversion result will be in terms of reducing the amount of manual clean-up required after the conversion.
Introduction SmartPlant Import Assistant will only create SmartPlant elements that have an explicit corresponding element in the CAD file. It will not create new elements. For example, if the CAD file contains a pipe directly connected to a piece of equipment without a nozzle in between, which is invalid in SmartPlant, SmartPlant Import Assistant will not create the nozzle since it does not exist in the CAD file. It will rely on either the necessary SmartPlant rules being in place to correct this situation automatically or the user manually adding the elements in SmartPlant P&ID. When converting a given CAD element and trying to populate the attributes of the SmartPlant symbol being created, SmartPlant Import Assistant will only use data which is: Part of the element being converted Part of an element which has been identified as a label for that element Part of a MicroStation tag element. When populating the SmartPlant attributes of an element, SmartPlant Import Assistant will not use data that is included in another element in the CAD file. For example, when converting a nozzle, SmartPlant Import Assistant will not obtain attribute information about the nozzle from the connected pipe. SmartPlant P&ID rules may automatically obtain this data. There will be no knowledge (templates) built into SmartPlant Import Assistant about the format of the CAD drawing based upon the application (such as Jacobus) that generated it. Any data external to the CAD file, such as links in an external database, will be ignored by SmartPlant Import Assistant. For 3D CAD files, SmartPlant Import Assistant will ignore the z component.
SECTION 2
Installation
1. Insert the SmartPlant Import Assistant CD into the CD-ROM drive. If the installation does not start automatically, double-click setup.exe in the main folder. 2. Click SmartPlant P&ID Import Assistant Installation. 3. Follow the steps to install the software.
Initialization
After you have installed the software, you are ready to initialize it. 1. Click Start > Programs > Intergraph SmartPlant P&ID > SmartPlant P&ID. SmartPlant P&ID starts. 2. Click SmartPlant Import Assistant. If you do not see this icon, verify that this registry key exists: "HKEY_CURRENT_USER\Software\Intergraph\Applications\SmartPlantPID.application\Envir onments\Sketch\AddIns\ImportAssistantAddIn.CImportAssistAddIn" The Import Assistant Explorer in SmartPlant P&ID opens.
SECTION 3
Understanding Rules
The rules are the core of the SPIA import process. The rules specify how to identify an element in a CAD non-intelligent file and what to do with the element after it is found.
Rule Sets
The file containing all the rules necessary to convert a CAD file is referred to as a rule set. CAD files that are created with the same symbology can be converted with a single rule set. CAD files with different symbology require different rule sets. For example, a user may have one rule set to convert AutoCAD files and another rule set to convert MicroStation files. Also, a user may have one rule set to convert the CAD files received from subcontractor A and another rule set to convert the files received from subcontractor B.
Language
The SmartPlant Import Assistant rule sets are implemented as VB Script files. VB Script, a Microsoft scripting language, is a subset of Visual Basic. Using VB Script for the rule set files provides several advantages: Microsoft provides a free Script OCX control that can read and execute VB Script files. VB Script can access methods implemented as ActiveX DLLs. Since VB Script is an industry standard language, and since it is a non-compiled language, the rule files can be modified by a particular customer to perform operations, necessary for converting the customer's CAD files, which are not available through the SmartPlant Import Assistant GUI. Each rule in the rule set is implemented as a method in this file.
Rule Components
A rule set contains a plant item rule for each group of plant items in the CAD file that share common characteristics. For example, there could be a rule for gate valves that serve as pipe components. A plant item rule has the following components: Identification Criteria Mapping of CAD element to SmartPlant symbol Zero or more sub-rules to find elements that serve as labels for the plant item in the CAD file Mapping of CAD label text, optionally as a sub-string to SmartPlant attribute(s), and optionally to a SmartPlant label symbol. Note that the CAD label text can come from an actual text element in the CAD file or from an "intelligent" label such as an AutoCAD block attribute
Understanding Rules
Identification Criteria
A rule's identification criteria are the components of the rule that are used to specify how CAD elements, which represent the item being searched for, will be identified. Each criterion has a corresponding method in SmartPlant Import Assistant that performs the actual processing. For example, the Element Type criterion, which tests that a CAD element is of a certain type (line, circle, text, etc.), has a method in SmartPlant Import Assistant named ElementType that actually tests the type. SmartPlant Import Assistant has several built in identification criteria. Examples include: Element type such as line, text, or cell Name of cell or block Color Layer name Line width Line type Structured element contains text box element with string " " The identification criteria are based on graphic symbology or graphic relationships. There is no P&ID-specific knowledge built in at the rule level. When a new rule is created, SmartPlant Import Assistant determines which of its built-in Identification Criteria apply and adds them to the rule. The user can turn the criteria on/off in the Rule Set Editor. These built-in Identification Criteria are the only criteria available when working in the Rule Set Editor. Outside of the Rule Set Editor however (i.e. in Notepad), the user can edit the rule set file and add additional criteria as needed, provided an ActiveX DLL exists with the corresponding method.
SECTION 4
3. Enter a drawing set name. SmartPlant Import Assistant Installation and User's Guide 7
Creating Drawing Sets 4. Browse for the rule set, temp, and non-converted graphics file folder locations. The default path for these locations is the current User Profile directory. When files are converted to SmartPlant P&ID drawings (see the Starting the Conversion Process (on page 67) section for more information), the file that contains the graphics that were not converted will be placed in the location specified under Non-converted graphics file directory. The system will automatically create a subfolder using the drawing set name under the paths defined. 5. If desired, browse for a VB Script file for Attribute Mapping. This file can be added to the Drawing Set information at any time by selecting the Properties option on the Drawing Set menu. The purpose of this file will be discussed later in the section. 6. Select SmartPlant P&ID Information: plant group and template (project cannot be changed, defaults to active project). To change the active project, exit out of this dialog and then use SmartPlant P&ID to change the active project.
All plant groups will be shown here, regardless of SmartPlant P&ID hierarchy levels. Be sure to select a plant group that is allowed to contain drawings. 7. Select the desired group from the pick list and click OK. 8. Select a template file. The template file chosen here will be the template used in translating the foreign file into an intermediate RAD file. In order to ensure that the graphics are properly fitted to the sheet, the template file chosen here must match the sheet size of the original file. If the user wishes for the final SmartPlant P&ID drawing to have a different sheet size, there will be another opportunity to use a different template file before the file is converted. This second template file selection will be discussed in Starting the Conversion Process (on page 67). 9. You can also specify a document category and document type to be used when the SmartPlant P&ID drawings are created with Auto Convert (see "Starting the Conversion Process" on page 67). These fields can remain blank. These fields are also available (and changeable) on the drawing set's Properties dialog. The user can also change these values just before Auto Convert on the Drawing Name and Number dialog box. Note that to successfully assign document type and document category to the new drawing created in
Creating Drawing Sets Auto Convert, both values must be entered. If just one is entered, neither will be set on the new drawing, and the values can't be changed once the drawing is created.
Creating Drawing Sets 5. Create a template file in SmartSketch for the drawing size required for the drawing conversion with SmartPlant Import Assistant. Start a new file in SmartSketch using the normal.igr template. Modify the following settings: a. Click File > Sheet Setup and set the sheet size and scale.
b. Click File > Move Sheet Border and set the sheet origin to the settings recorded from step 4. (Note that the settings were converted to inches since we did not change the default units setting to meters in the File > Properties > Units tab of the drawing.)
6. Click File > Save as Template to save the template file {Template File.igr} used for converting the input drawing to SmartSketch. It will also be used in the SmartPlant template file. 7. Modify settings in the itmstn.ini (itacad.ini) file for the following parameters:
Template File=D:\Program Files\SmartSketch\Template\{Template file.igr created in step 6}
8. To create the actual border file for SmartPlant PID, create a border file in SmartSketch based on the input drawing size and sheet origin. a. Start a new drawing in SmartSketch using the Template File.igr template
10
Creating Drawing Sets b. Click File > Open and choose the border file in MicroStation (AutoCAD) format. c. Click File > Properties and set the properties as desired. d. Click File > Save As to save the border file used in the SmartPlant Template file. Be sure to save this file in the proper reference data location. e. Set the active project in SmartPlant PID. Open SmartPlant P&ID and click File > New Template. Set desired units in the File > Properties > Units tab. Set the drawing size on the Page Setup dialog box. Click Edit > Insert > Object to embed/link the SmartSketch border file to the SmartPlant PID template file. Be sure to use a UNC path. Click File > Save As to save the SmartPlant template file used to generate drawings. The template file you select must match the sheet size of the "dumb" file.
14. Select the desired template from the directory and click Open. 15. Select Font Manager to display the following dialog box so you can edit the font mappings.
11
Use the Font Manager to view and change the font mappings for importing the foreign CAD files, whether the mappings exist in the Pidacad.ini file (for the import of AutoCAD files) or in resource directories. Click Apply or OK to save changes made under Font Mappings in the AutoCAD Fonts section in the Pidacad.ini file.
When the setting is checked and a SmartPlant P&ID symbol is placed, the Snap To Target setting is set to True. This means that when a symbol of item type piping component is placed close to a symbol already on the drawing, the existing symbol becomes a target. The second symbol will "snap" to the first.
12
Turn Snap To Target on for piping components Turn Snap To Target off for piping components Decide on a drawing-by-drawing basis
Turning on Snap To Target will result in slight differences in placement location between the intermediate file and the SmartPlant P&ID drawing.
13
All essential fields have been filled in, so the OK button is enabled. Click OK to accept the values. SmartPlant Import Assistant creates subdirectories as noted in rule set and temp folder fields above. An .INI file is created in the user profile directory for each Drawing Set created. A master SmartPlant Import Assistant .ini file (SPIADrawingSets.ini) also exists there. To view the properties of this Drawing Set, click Drawing Set > Properties. A new Drawing Set has been created. The following graphic shows the Drawing Set shortcut menu options.
14
Accept or decline deletion of the folders associated with the Drawing Set.
If the drawing set to open was created when a different plant was active in SmartPlant P&ID, the user will get notification of the situation and the drawing set will not be opened.
To open this drawing set, connect to the correct site and plant through the Drawing Manager.
15
16
SECTION 5
17
Creating Rule Sets If Create New Rule Set is selected, the user can type in the name to be used as the rule set name and a new, blank rule set file is created in the rule set directory of the drawing set. If Link to Existing Rule Set is chosen, you can browse for rule set files (Excel files) that have already been created for other drawing sets.
In the case of linking to an existing rule set, a shortcut to the chosen rule set will be added to the rule set directory instead of an actual Excel file. This means that changes to one rule set will be reflected in the other. A shortcut to the CAD input file used in the existing rule set is also created in this drawing set's temporary directory. Changes to this file will be reflected in both places the rule set is used. However, the rule sets will each have unique compiled rule set (.rst) files (discussed in Compiling a Rule Set), nonconverted graphics files (discussed in Starting the Conversion Process) and log files. Only the rule set file (.xls) and translated CAD input file (.pid) will be shared.
18
Creating Rule Sets The new rule set will be added in the Import Assistant Explorer under the Drawing Set name. The picture below also shows the shortcut menu options available for the rule set. Different options will be enabled when the rule set is at different stages of development.
19
Creating Rule Sets Click OK. The files are added to the rule set tree in the Import Assistant Explorer.
The software supports the addition of drawings with the following file formats: AutoCAD (.dwg), MicroStation (.dgn), and PDS (.pid).
Click OK to accept changes. The selected files are removed from the rule set tree in the Import Assistant Explorer.
Right-click on a file name to display a menu that includes the Include or Exclude File option. A red X by a file means the file is excluded from the rule set and will be ignored. A green check by a file means the file is included in the rule set.
20
Creating Rule Sets When rule set-level actions like playing back recorded commands and batch auto-convert are performed, the commands will only be performed on files that are included. Only one file can be included in a rule set at a time when performing the Generate Rule Set (see "Generating a Default Rule Set" on page 23) step.
The Structure Analysis tool analyses the contents of a CAD file and delivers the results as an Excel file. This output file's name and location can be selected from the fields in the bottom left section of the dialog. The Analysis Criteria section lets the user select what he wants the tool to analyze, groups (blocks or symbols in the CAD file), lines, and textboxes. Once the tool has been run, clicking on the Results button opens the Excel file that was created. In the example above, all three criteria were left checked, so the Excel file has eight sheets: Group Overview, Group Data, Line Overview, Line Data, LineRun Overview, LineRun Data, Textbox Overview, and Textbox Data.
21
Group Data
The Group Overview sheet contains information about groups (originally symbols or blocks in the original CAD file), including the total number of groups in the file. This sheet lists all group names in the file, with the number of instances of the group, how many instances contain textboxes, how many instances do not contain textboxes and the group's layer. The Group Data sheet lists information about each instance of each group, including how many textboxes they contain and on which layer they can be found.
22
Recorder Assistant
Certain operations (Create Group, Ungroup Graphics, and Adjust Base Rotation) available in the Rule Set Editor (see "Compiling and Testing a Rule Set" on page 63) can be recorded and played back on other files in the rule set. If a rule set has a recorder file (.rhf) associated with it, if the user has already recorded operations for this rule set, the Recorder Assistant option will be enabled on the rule set's popup menu. Choosing it brings up the dialog below.
The Recorder Filename field contains the name and location of the Recorder file associated with this rule set. It is a read-only field. Listed in the window are all the procedures that the user chose to record while in the Rule Set Editor, along with the type of operation they are. When the user clicks the Play button, all the Records that are checked will be performed on all the files that are included in the rule set (the ones marked with a checkmark). Excluded files will be ignored. The records will be performed in the order that they are listed on this form, top being first. The order of the operations could be important, for example, when ungrouping a group and then regrouping it. To rearrange the order in which the records will be executed, use the Move Up and Move Down buttons. The Delete button removes a record permanently.
23
The system will open the file contained in the rule set in SmartPlant P&ID and display only those layers that contain graphics in the Generate Rule Set dialog box. By selecting individual items the user can pre-assign P&ID Content values to the layer. These values determine what the system will look for on the layer to use as rules in the rule set. Processing will be extremely slow if you enable a layer containing the border. For this reason, you should set the border layer to Ignore.
24
This dialog box allows the user to view the file chosen for conversion. The pane on the left side of the dialog controls which layers are visible as well as assigning P&ID Content values. Being able to see what is on each layer is helpful when deciding which P&ID Content value to assign to a layer in the left-hand pane. Layer Names Lists the names of the layers in the CAD P&IDs. P&ID Content These values determine what the system will look for on the layer to use as rules in the rule set. If the CAD P&IDs are well structured, these options can be used. The available options are: Default (Lbls and Pl) Layer will be scanned for labels and groups (plant items). Ignore All groups and labels on the layer will be ignored. Labels and Plant Items Labels Only Plant Items Only All Layers Makes all layers visible. Map rules to SmartPlant P&ID symbols from an existing ruleset Select to map the symbol mapping of an existing rule set to the new rule set being generated.
25
26
SECTION 6
27
Editing Rule Sets The Rule Set Editor Control Bar, a new window, displays under the SP P&ID folder as shown next.
Rules are created from groups and lines in the file to be converted. If the rule set was generated using the Rule Set Generator, the file was scanned to find all unique groups and lines. These are rules. You can map a SmartPlant P&ID symbol to each rule in the Rule Set Editor. The rules are listed in the leftmost window of the Rule Set Editor Control Bar, under the Rule Name column heading.
Rule Criteria
System defined rules (listed in the Edit Rule frame, under Rule Name and Symbol) are developed for groups and lines based on the following information: The Rule Criteria dialog box allows for the definition of specific rule criteria used in the mapping of drawing elements to SmartPlant P&ID items. Specific item mapping and conversion criteria can be defined for plant items, labels, pipelines, and other "dumb" elements. These rules are based on the element type (group or line), the element attributes (layer, color, weight, style) and even specific items within the element (such as text strings in groups). In the following example, the Line2d 164 rule is highlighted. You can see that the following criteria for this line were found: Layer, Color, Element Type, Line or Polyline, Connected At Endpoint, Line Style, and Line Width.
28
Editing Rule Sets If the rule criteria were left this way, that is, with the criteria that are checked originally, it would mean that all lines on layer LDL1A with the same color, style, and width as Line2d 164 would be mapped to the SmartPlant P&ID symbol entered in the Symbol column. This example shows the Primary Piping.sym symbol. This mapping of a SmartPlant P&ID symbol to a rule is discussed in the Mapping SmartPlant P&ID Symbols to Graphical Rules section.
You can select additional criteria or unselect criteria to create customized mapping.
Now the rule for lines that map to the Primary Piping.sym symbol have been revised. Color will no longer be a consideration when the system is finding lines to match this rule. Layer, type, style, and width will be the only deciding factors. 1. Right-click on a Rule Criteria to display the Override Value popup menu.
Changes to the value of the rule criterion here display in the Rule Criteria window. For example, changing the color value from 255 to 0 causes the rule to apply to black lines instead of red lines. Enter color values in decimal format.
29
Removing a Rule
Rules can be removed from the Rule Set by deleting the rule name from the dialog box. 1. Highlight the desired Rule Name. 2. Right-click to display the popup menu. 3. Click Delete.
30
The software scans the active Rule Set for an existing rule matching the criteria of the selected element. If the software cannot find an applicable rule, create one by selecting Add As Plant Item. 2. After the desired rule is selected in the Edit rule box, right-click on the rule and click Map Symbol > Map Symbol.
31
Editing Rule Sets 3. The Map Symbol dialog box displays. Navigate to the desired SmartPlant P&ID symbol in the Symbols tree. Double click the symbol.
The symbol is mapped to the rule and the Edit Rule dialog box displays the new assignment. To remove this mapping, click Unmap Symbol.
Click Yes to map the symbol, regardless of its size. Click No to change the tolerance setting or to turn off this check. Use the Set Symbol Tolerance dialog box to make the changes. In the Edit Rule area, rightclick on a rule and click Map Symbol > Set Symbol Tolerance. (This popup menu is shown in the Mapping SmartPlant P&ID Symbols to Graphical Rules section.) The Set Symbol Tolerance dialog box displays.
32
Editing Rule Sets The tolerance is used to determine how different in size the symbol and the group can be before the software warns about the size difference. The default tolerance is 10%, which can be changed with this dialog box. The symbol size comparison takes into account the rotation of the group and symbol. The comparison check ensures that the rotation of the group is not incorrectly comparing the apparent width of the group with the height of the symbol. If groups are extremely out of tolerance, test the rule to check whether nearby pipelines are grouped with the symbol. If this is the case, ungroup, re-group, and map the new group to the symbol. If a symbol is an incompatible size, correct it using the Create Symbol command on the Edit Rule popup menu. See Creating a New SmartPlant P&ID Symbol for information about this command. Check Do not use symbol tolerance checking to turn off size checking.
There are two options in symbol creation. You can copy the template file or copy an existing file. Both options display Catalog Manager with an open symbol file containing the graphics that were highlighted in the file when you selected the rule name. To use Copy existing symbol, enter the symbol file to be copied, the directory where the new symbol will be saved, and the name of the new symbol. The file that is opened in Catalog Manager inherits the properties of
33
Editing Rule Sets the symbol that was copied and contains the graphics that were highlighted in the file in the Rule Set Editor.
Edit the symbol in Catalog Manager and save it. If you specified a name for the new symbol on the Symbol Creation dialog box, the name is mapped to the rule in the Rule Set Editor. For parametric symbols, it is best to not map SmartPlant P&ID symbols to groups that were parametric symbols in the original CAD file in the Rule Set Editor. It is important to know that Auto Convert cannot handle mapping parametric data. These symbols can be resolved after Auto Convert in the Post-Conversion Cleanup process explained in the SmartPlant Import Assistant Installation and User's Guide. Before beginning the process, close all files in Catalog Manager. If a symbol file is open in Catalog Manager at the beginning of new symbol creation, you are prompted to close all documents.
34
Testing Rules
Use Test to find all graphics in the file that match a rule. A message box asks if you want to see each graphic that matches the rule one at a time. Click No to fit the drawing to the screen with all matching graphics highlighted. Click Yes for the software to find and zoom in on each matching graphic.
Click Tools > Options > Colors> Highlight to change the color of the highlighting.
35
The Make Group option is enabled if more than one graphic element is selected. 1. In the active window, select all of the elements to be contained in the group. Right-click to display the popup menu and then click Make Group. The New Group Name dialog box displays.
2. Enter a unique group name and click OK. This name will also become the rule name. Some special characters such as parentheses are not allowed in rule names, but dashes ( - ) are acceptable.
3. A message box prompts about finding all occurrences of the element collection. Click Yes to highlight the first occurrence and then be prompted again to convert. Accept the forms as required. When creating similar groups, start with the most complex structure and work down to the simplest. For example, group 4-way valves before grouping 2-way valves. When creating a group, choose a set of discrete graphics that have the same rotation angle as the SmartPlant P&ID Symbol that will be used during symbol mapping. 4. After a new group with a unique name has been created, right-click on one of the groups and click Add As Plant Item. The new group is added as a rule in the Edit Rule window. Adjust the rule criteria as required. Map symbols as required. 36 SmartPlant Import Assistant Installation and User's Guide
Editing Rule Sets 5. When a new rule is added using Add as Plant Item, the software scans the file near the plant item to be added for text to be used as potential attributes. Sometimes this search results in too many or too few potential attributes. Use Options on the popup menu to limit or expand the search area.
Ungrouping Graphics
Sometimes a cell or block from a foreign file is composed of pieces that could be mapped to existing SmartPlant P&ID symbols. For this reason, there exists an ungroup option. Right-click on a group and click Ungroup Graphics to display a message box asking if you want to preserve the named groups inside the groups.
Click Yes to have named groups inside the groups to be ungrouped to be left as groups. Click No to have the groups be ungrouped down to their primitive graphics. When this message box is dismissed, a message box displays asking if you want to find all occurrences of the group and ungroup them.
37
Editing Rule Sets Click No to ungroup this one instance of the group. Click Yes to ungroup this occurrence and find the next. Then a message box displays asking if you want to ungroup this occurrence.
Each matching group displays and you are asked if you want to ungroup it, unless you select the Yes To All option to ungroup all occurrences at once. After groups have been ungrouped, you can select their component graphics and create new groups and rules. If groups will not ungroup, verify that the group exists as a rule. If it does not, add the group as a plant item, ungroup, and delete the rule if it is no longer needed.
Adjust Base Rotation adjusts the selected graphic's base rotation to match the base rotation of the chosen SmartPlant P&ID symbol. In this example, the bottom window shows the group from the CAD file, and the top window shows the SmartPlant P&ID symbol at its rotation 0. 1. Click Rotate to rotate the graphics in the bottom window 45 degrees. Use Browse (next to the Symbol Name field in the top of the dialog box) to select a different SmartPlant P&ID symbol.
38
Editing Rule Sets 2. Check Mirror SmartPlant P&ID symbol on placement to mirror the SmartPlant P&ID symbol when it is placed in Auto Convert. It will not cause any visual changes on this dialog box. Changing the mirror option here mirrors the SmartPlant P&ID symbol for all instances of this rule. 3. Use Angle to enter an exact value for rotation, as shown below.
4. To rotate the group to the next 45-degree increment, enter a rotation value and click OK. Then click Rotate on the previous rotation dialog box. For example, if you enter an exact rotation value of 25 degrees and rotate the group with Rotate, the next value would be 45 degrees.
The original origin is the small cyan dot just above the text. 1. Click anywhere on the graphics window to display a small red dot that represents the new origin. 2. Click Reset to erase the new origin and reset the origin of the group back to what it was. In this example, the origin needed to be in the center of the valve, and there is a small red dot where the new origin was placed. The viewing tools buttons for the graphics window are under it. Use this tool only if the group contains text boxes outside the range of the graphics. In other cases, when the SmartPlant P&ID symbol is placed during Auto Convert, origin shifts will be automatically computed.
39
Recording Operations
Often the same operations need to be done on more than one file in the rule set. SmartPlant Import Assistant allows you to record four of the procedures that can be performed on elements in these files: Create Group, Ungroup Graphics, Adjust Base Rotation, and Adjust Origin. The recorded operations can be played back on other drawings in the ruleset by using the Recorder Assistant, a command on the ruleset menu of the Import Assistant Explorer. 1. Click Record to change to record mode. The next time this menu is brought up, it will reflect this change in state as pictured below.
After each option that can be recorded, Rec displays. Rec displays only during record mode. 2. Click an option to record (for example, Adjust Origin (Rec)) and the Record Information dialog box displays.
3. Enter a name for the record to identify the operation that is about to take place. The name will be used when this operation is played back on other files in the rule set. (Playback is 40 SmartPlant Import Assistant Installation and User's Guide
Editing Rule Sets discussed in more detail in the SmartPlant Import Assistant Installation and User's Guide in the Recorder Assistant section.) The larger window on this dialog box lists the names of previously recorded operations for this rule set. 4. Accept this dialog, and the procedure, whether it is ungroup, group, or adjust base rotation, will proceed as usual. Some operations cannot be recorded for playback. For example, if the user chooses to record an ungroup operation, but answers No to the prompt Do you want to find all occurrences of the group and ungroup them," the operation is not recorded. To record an "ungroup," choose to ungroup all occurrences. Otherwise, when the Recorder Assistant plays back the operation, it will not know which instances of the group to ungroup. If a chosen operation was not recorded, the following message displays. The operation (for example group or ungroup) was successful, but not recorded.
The Properties dialog box shows properties of group and the group or rule name, such as SYMBOL_LDL2A. Depending on what kind of element was selected (a group, graphical group, text box or basic graphical element), the appropriate fields are enabled. For some elements, these properties can be changed.
41
Editing Rule Sets Click Reset to return an element's properties to their original values. Set the Mirror SmartPlant P&ID Symbol select list to Yes to mirror the SmartPlant P&ID symbol when it is placed in Auto Convert. It will not cause any visual changes to the group in the CAD file. Changing the mirror option here mirrors the SmartPlant P&ID symbol placement for only this instance of the group.
Attribute Manager displays a dialog box that allows the user to turn off some layers for attribute processing. When a graphic is added as a plant item, only text boxes on layers marked Yes will be considered potential attributes. Click on a layer name to toggle the processing information.
42
Editing Rule Sets If No is assigned to a layer, the system will not try to automatically find attributes on that layer when an element from the file is selected to be added as a plant item. Layer Manager displays a similar dialog box to control the visibility of layers when viewed in the Rule Set Editor.
43
Editing Rule Sets 1. Select Merge Text Boxes to display the Merge Text Boxes dialog box.
2. Choose a Text box delimiter. The delimiter determines what character or string will separate the string to be joined into one text box. The first text box selected will determine the location, font and style of the resulting text box.
3. After two or more textboxes have been merged into one, Unmerge Text Boxes becomes available. This returns text boxes to their original state.
Attributes
The Ruleset Editor is also used to assign attribute data to plant items. Attribute data is used to assign properties on SmartPlant P&ID symbols in the final converted drawing.
Editing Rule Sets In order to bring dumb attributes into SmartPlant P&ID, you must define a map and assign string values using regular expressions. See Appendix A: Regular Expression. 1. Highlight a pipeline graphic and right-click Find Rule. The software highlights the rule controlling the import of this type of graphic, as defined following the process above. You can also select a rule for a piperun from the list of rules in the Rule Set Editor Control Bar. 2. After the correct rule is active, select (highlight) the text string for the Line ID and rightclick Add as Attribute. When prompted for identification of a plant item, select (data button) the line segment for the pipeline. The Edit attribute list displays and shows the string in the Samples text box. When an attribute is in bold, you can assign a list of specific values to it.
3. Click Select List on the popup menu to display only the values that can be assigned to the attribute.
4. Define the Attribute criteria desired for selection. The possible attribute criteria are: Element Type Type of the label object (the element added as attribute) Contains Text The text from the label object in parentheses. Layer Layer of the label object Color - Color of the label object
45
Editing Rule Sets Is Part Of The plant item is a parent of the label object Is Near Intersects and Inside must be false, and the distance between the plant item and the label object is in parentheses Located at End Point If the plant item is a line and Intersects is not true, then this can be true. The tolerance is the minimum distance from the label object to the endpoint. Inside The label object is inside the range of the plant item Row Number The location of the text inside the group Text or Text Node The label object is a text box or a text node. Cell Name The name of the element added as an attribute. Angle Between The angle between the plant item and the label object. Parallel The plant item and the label object are parallel. Intersects The label symbol intersects the plant item. ConnectedByLeader If the plant item and the label object are on the same layer and are the same color, this can be true. It is possible to override the values in Attribute Criteria, just as it is in Rule Criteria.
5. Right-click attribute criterion and select Override Value to display the Override Value dialog box.
6. Change the value and click OK. The change displays in the Attribute criteria window. Any attributes assigned will use the new criterion. For the Contains Text criterion, you use a regular expression to search for a pattern of text that the attribute element contains. For example, if an attribute criterion is that the element contains the text 2", you can override the value to be the regular expression (.). as shown in the following example.
46
Editing Rule Sets 7. The Contains Text attribute criterion has been overridden to look for text boxes containing strings that match this regular expression, instead of just ones that contain the original string.
Note that the attribute below is identified as Index 0. Click Edit on the Edit Attribute dialog box. The Label Symbol and Substring Format textboxes and the Test command display. In the Label Symbol text box, select a SmartPlant P&ID symbol to use as the label for the mapped attributes.
8. Click Test to display the Test Regular Expressions dialog box. Use this dialog box to check validity of regular expressions and to test the results on the selected string.
9. Enter a regular expression in the field provided and click Test. The results of the expression display in the Substring Results field.
47
Editing Rule Sets Identify as unique a string as possible when defining regular expressions. If nonspecific expressions are used, it is possible that incorrect data could be picked up by the system. For example, in the example above, (.*)-* provides the same result. However, the software searches all text matching the Attribute Criteria defined for the rule. By using the string (.*)-.*-.*, the search will exclude strings of the format xx-xxx and only find items of the format xx-xxx-xxx. Search strings should be carefully considered based on drawing standards and the consistency of the adherence to unique CAD standards for specific items within the drawing.
10. 11.
If regular expression values have been entered previously for this SmartPlant P&ID attribute for other plant items, there will be several different regular expression options in the Regular Expression field. After the regular expression is defined, click OK. The Edit Attribute dialog box displays. In this example the string (.*)-.*-.* extracts the fluid code prefix of the line. Click OK. The system returns to the Edit Rule Set dialog box and displays the string in the Edit Attributes window. Right-click the attribute, and on the shortcut menu, click Map. The system will assign an index number to the attribute map. After mapping each attribute, click Apply. Map the size, spec, and insulation purpose to the appropriate SmartPlant P&ID attributes in the same way. Continue assigning attributes or Close to exit the Rule Set Editor.
Editing Rule Sets 15029 = Tag Sequence Number <blank> = Loop Tag Suffix <blank> = Tag Suffix The attributes above are based on the delivered symbol. If this is a standard mapping for the client drawings, you could revise the symbol to remove the blank attributes. 2. After the correct rule is active, select (highlight) the text string LC and right-click Add as Attribute. You are prompted to identify a plant item. Select (data button) the instrument group. The SmartPlant P&ID attribute list displays in the Edit Attribute field and the string displays in the Samples text box. In this example, the text is divided into two attributes as previously noted.
4. As with the pipeline, right-click the attribute, select Map, and then Apply.
49
Editing Rule Sets Note that the Attribute Criteria lists a selection "Row Number 1" associated with the LC text. Select the text 15029 and assign it as an attribute to the same rule. The system will assign another index number and change the row number as shown below.
A label symbol is not required if the instrument has embedded labels for the mapped properties. 5. Note the change to the index numbers for additional items. In this manner, multiple items can be mapped to a single symbol. When complete, accept the changes to the rule set.
50
Editing Rule Sets 2. After the plant items have been selected, whether it was just the one initially chosen, or a selection of multiple plant items, the following dialog box displays.
In this example, the user has initially clicked on one text box to be the attribute and multiple plant items to map it to. Since the attribute will be assigned to multiple plant items, the Rule Name and Mapped to SmartPlant P&ID Symbol fields read Multiple plant items selected because the plant items could match different rules. The item type is what determines the available SmartPlant P&ID attributes, so it is consistent among plant items chosen. When just one plant item is chosen, Rule Name will contain the rule to which the plant item belongs, and Mapped to SmartPlant P&ID Symbol will contain the symbol mapped to that rule. The Nominal Diameter entry in the SmartPlant P&ID Attributes window is red to show that one or more of the selected plant items has previously-assigned values for that attribute. The previously mapped values for that attribute may not be consistent. This is a reminder that when an attribute is mapped here, it is mapped to all the plant items that were chosen, and it will overwrite all previous values. To assign a value to a SmartPlant P&ID attribute, users must select Set Value on the popup menu. If the attribute has a set collection of values, choose from that list. Otherwise enter a value in the following dialog box that displays.
51
If there is more than one entry in the Available Text list and you choose to set a value for an attribute, you must choose which text box the SmartPlant P&ID attribute is to replace:
This will determine which text box will be removed from the intermediate file when this attribute is placed during Auto Convert. You can also enter a value in the Map Label Symbol field on the main explicit attribute mapping dialog box. The text box that was chosen to map as an explicit attribute will be used to position the label symbol. It is important to map the correct text box as an explicit attribute. If the wrong text box was chosen to map as an explicit attribute, the value of the attribute may be correct, but the label may be placed incorrectly. 3. After the explicit mapping for one plant item, or group of plant items is finished, the plant item popup menu offers the options, Continue Explicit Mapping, Hide/Show Explicit Attributes, and Exit Explicit Mapping. Click on the next text box or plant item to add as an explicit attribute, and choose Continue. Choose Exit to return to the normal popup menu. Click Hide Explicit Attributes, available on both popup menus, to hide all text that was chosen to be explicitly mapped to a plant item. Data for explicitly mapped attributes is saved in the intermediate file (the .pid file), not the rule set (.xls) file. If the intermediate file is deleted, the explicitly mapped attribute data will be lost.
52
53
54
1.
2. The attribute has been added at Index 2. 3. Assign a label symbol to this attribute.
In the figure above, Flow Direction.sym has been assigned as the label symbol, and the attribute criteria have been adjusted so that layer and color will no longer be considered in assigning this attribute. For symbols as attributes, the index number does not need to be assigned to a SmartPlant attribute.
55
4. The regular expressions could be modified for use with SI sizes. The connect point sizes would be populated based on the pipe runs connected to the reducer. After this happens, the label updates with the correct value.
1. Right-click the dashed line, and choose Add As Attribute. 2. Click the pipe to which you want to associate this attribute. 3. A new index will be created in the Attribute Criteria window just like when any other element is added as an attribute.
56
Editing Rule Sets 4. Right-click the chosen attribute and select Map. You must also choose a value from the list of set values or enter a value for this attribute. The difference between the procedure when a text string is added as an attribute and when a graphic element is added as an attribute comes when assigning values to the attributes. Since there is no text string to parse with regular expression substrings, it is necessary to assign an actual value to the attribute.
If the attribute name has a bold font there is a list of specific values to choose from and the Assign Attribute Value dialog box displays.
5. On the Assign Attribute Value dialog box, double click a value from the Enumerated Attributes list or select a value and click OK. The value is mapped in the Substring Format field of the Edit Attribute window.
57
Editing Rule Sets 6. If the attribute name is not in bold font, it does not have a specific list of values. You can enter a value.
7. Click OK to map the index and the value or click Cancel to not map them.
58
Editing Rule Sets If you enter a value in the Substring Format column (as it is in the previous graphic), the Test button is only enabled if a VB Script file for attribute mapping is assigned to the project. In this case, the Test Regular Expressions area of the dialog box is disabled and the Test Attribute Value area is enabled.
See Using VB Script files for Attribute Mapping section in the SmartPlant Import Assistant Installation and User's Guide for more information. 8. Since the attribute was assigned an actual value instead of a regular expression substring, all there is to test is the VB Script file. 9. Click Unmap on the SmartPlant Attribute on the popup menu (in the Edit Attribute section of the Rule Set Editor Control Bar) to unmap the index from the attribute. Choose List (if available) to display the SmartPlant P&ID Enumerated Attribute Information dialog box. Click Delete if you want to delete the active Attribute Criteria. Click Highlight to highlight the graphic in the file that was added as the attribute at the active index.
59
The Attribute Mapping Script Test area of this dialog box is available when a VB Script File for Attribute Mapping was entered on the Add Drawing Set dialog box or the drawing set's Properties dialog box. When Test is chosen with this option checked, it will also test the VB Script file specified and display the results in the Attribute Mapping Results window. Edit Script opens the attribute mapping script file for editing. After the selected VB Script file returns the proper results, it will be used in the Auto Convert process for assigning attributes to SmartPlant P&ID elements. For more information about how to use this file, see the VB Script Files for Attribute Mapping section in the SmartPlant Import Assistant Installation and User's Guide.
60
61
SECTION 7
63
Compiling and Testing a Rule Set Only those graphics that matched a rule in the rule set will be highlighted. Click a highlighted item to display the following dialog box. If an item contains text that did not get processed, that text will not be highlighted. Text that did get successfully processed will be highlighted.
A log file named TestRuleset.log is generated and saved in the root directory of the rule set. The log file lists the number of plant items processed, the number of attributes mapped to these plant items and the number of labels processed. A sample log file:
SmartPlant Import Assistant Processing Log Processing started at 1/13/2003 3:11:51 PM Processing ended at 1/13/2003 3:13:12 PM Processed 511 of 3978 graphics (12.85%) Total number of plant items = 511
64
65
66
SECTION 8
The default name and number incorporate a timestamp to avoid duplicating names or numbers in the database. If the user chooses a name that already exists in the database, he will be asked if he wants to delete the existing drawing.
Click Yes to delete the drawing in question and proceed with the conversion. Click No to return to the SmartPlant P&ID Drawing Name and Number dialog box. On the Drawing Name and Number dialog box, the Template file field allows you to specify the template file to use for creating the SmartPlant P&ID drawing.
67
Starting the Conversion Process Use the Document Category and Document type fields to specify that information for this drawing. Values entered when the drawing set was created appear here as the defaults. Enter values on this dialog box to be the defaults for the drawing set. Both values are required to successfully assign document type and document category to the new drawing created in Auto Convert. If only one of the values is entered, neither will be set on the new drawing. The values can't be changed after the drawing is created.
68
69
Starting the Conversion Process SPIA_AttrManipulator.SPPIDSymbolName() - This is the name of the plant item to which the attribute is being tagged. SPIA_AttrManipulator.SPPIDSymbolItemType() - This is the item type of the SmartPlant P&ID plant item to which the attribute is being tagged, such as Piping Component. SPIA_AttrManipulator.SPPIDAttributeKey() - This is a concatenation of the RAD Attribute object name (for example, "TextBox 310"), the regular expression to be applied to the dumb text, the SP Label symbol (if one is defined), and true or false for whether a leader is visible. SPIA_AttrManipulator.SPPIDAttributeTypeIsEnumerated() - This returns true or false based on whether the attribute name in question has a list of specific values that can be assigned to it. SPIA_AttrManipulator.SPPIDAttributeEnumeratedList() - This returns a collection containing the list of values mentioned above, under SPPIDAttributeTypeIsEnumerated(). The example code in AttributeMap.ams in the ProcessAttributes function demonstrates showing all the values in the list in a message box. This is really only useful in viewing all the possible values in this list (or writing them out to a file for future reference). Once these values are known, the user can map values he expects to encounter in this function to accepted values for this attribute. For example, if a valve in the dumb file is labeled "N.O" for Normally Open and the user added a string containing this value as an attribute in the Rule Set Editor, the DumbAttributeParsedText from the SPIA_AttrManipulator object might still read "N.O." The user could know to map this string to the value of "Normally Open," which is an accepted value. The user would then call SPIA_AttrManipulator.SetSPPIDAttributeData using the string "Normally Open" instead of the invalid value of "N.O." This mapping could be made in the ProcessAttributes function. The user can edit the data received from this object, and then reassign the data to the object using the call to SPIA_AttrManipulator.SetSPPIDAttributeData. The input to SetSPPIDAttributeData is the attribute name, the string that will be the attribute's value, and the key that is the string described above, under the SPIA_AttrManipulator.SPPIDAttributeKey section. Any of these three values could have been altered in ProcessAttributes. If SetSPPIDAttributeData is not called, and SPIA_AttrManipulator.IgnoreAttribute is False, then whatever value is contained in the DumbAttributeParsedText for the attribute value will be mapped to the attribute. Sometimes it may not be possible to set the value of an attribute during ProcessAttributes. For example, if the value of one SmartPlant P&ID attribute comes from two different dumb strings, it may be necessary to wait on another value before setting an attribute value. In this situation, the user can set SPIA_AttrManipulator.IgnoreAttribute to True and not call SetSPPIDAttributeData. The value of the attribute will not be set upon exiting the ProcessAttributes function. It is the VB Script programmer's responsibility to store attribute data, and the parameters of SetSPPIDAttributeData, while waiting to set their values. It is at this time that the two functions BeginProcessingAttributes and EndProcessingAttributes become important. The BeginProcessingAttributes function is called by SmartPlant Import Assistant's Auto Convert (see "Starting the Conversion Process" on page 67) code to notify the user that the following calls to ProcessAttributes apply to the RAD Graphic object identified by the string strRADGraphicName. The EndProcessingAttributes function is called by SmartPlant Import Assistant's Auto Convert code to notify the user that all calls to ProcessAttributes that apply to the RAD Graphic object identified by the string strRADGraphicName are complete. If SetSPPIDAttributeData is called in EndProcessingAttributes note that the strAttrKey from ProcessAttributes that went with strAttrName must be used. Remember that this RAD Graphic name passed in to both of these functions is also included in the SPPIDAttributeKey, available
70
Starting the Conversion Process on the SPIA_AttrManipulator object in ProcessAttributes. BeginProcessingAttributes serves as a signal that the processing of a new graphics is starting. The VB Script writer can use this callback to clear out any data being held onto by the script. The AMS file should be used to convert data when the authoring tool uses fonts containing special characters. For example, an input of the character "" can be captured and recognized by the VB Script code. The VB Script code can then assign a valid SmartPlant P&ID attribute value to the attribute based on the fractional data it received.
71
72
SECTION 9
If the user clicks Yes, he will get the opportunity to convert only groups whose rule name matches the original group selected at the beginning of the command, one at a time. If the user clicks No, then only the one group will be converted. The process is very similar to the process described below, except that only groups of this type will be offered for conversion. If there were no groups selected when this command was started (or there was more than one group selected) the process will collect all unconverted graphics and ask the user about the fate of each. If something other than a group was selected at the time the command was started, the following error message displays:
73
Cleaning up After Conversion 'The item selected is not valid for this command. Only graphics that are groups are valid for the Convert Remaining Graphics command. Exiting command.'
Click Cancel to terminate the Convert Remaining Graphics process and allow access to the PostConversion Cleanup ribbon bar. Click No to have SmartPlant Import Assistant go to the next group. Click Yes to display the Map Symbol dialog box, which is similar to the one in the Rule Set Editor.
Here the user can choose an existing symbol to place in the drawing or create a new symbol. If the user chooses an existing symbol, it will be placed in the drawing and highlighted, and the user can accept it or reject it. If a symbol that is an actuator or a nozzle is chosen, its placement will be deferred until the end of the convert remaining graphics process because its placement depends on other elements in the SmartPlant P&ID drawing. If the user cancels out of the convert remaining graphics process, he will be asked if he wants to place the deferred symbols at that time. If he chooses yes, the
74
Cleaning up After Conversion placement of deferred symbols will begin, and the user will have the same opportunities to accept placement of the symbols, or choose different ones, or cancel out of the process that he gets when placing other symbols. Click No to return to the Map Symbol dialog box to choose another symbol. Click Cancel to go to the next unconverted group in the dumb file. Click Yes to display the Properties dialog box for the newly-placed symbol. Assign properties to the symbol and click OK. The process goes to the next unconverted group. The other option on the Map Symbol dialog box is Create New Symbol. As in the Rule Set Editor, the user must choose a symbol to use as a template for creating a new symbol.
However, in this case, the option to copy the template file is not available. An existing symbol to copy and a name for the new symbol must be supplied. Clicking OK on this dialog creates a new symbol from the graphics in the highlighted group, and saves it in the specified directory with the specified name. The user is prompted to place the symbol now.
You can edit the symbol in Catalog Manager before placing it in the SmartPlant P&ID drawing. Click Yes to place the symbol (with the same behavior as when an existing symbol was placed). Click No to return to the Map Symbol dialog box to choose or create a different symbol for this group.
Connector Alignment
Post-Conversion Cleanup also includes the capability to make connectors orthogonal. Click Connector Alignment to display the Line Alignment dialog box.
75
Cleaning up After Conversion There are two options for connector alignment: Automatic and Manual. The tolerance angle is the largest angle that the system will assume should be orthogonal.
Click Yes To All to align all the connectors without further prompts. Click No to go to the next unaligned connector. Click Cancel to exit the Alignment command. Click Yes to align the connector and display the results, with an option to accept or reject the placement.
Click No to return the graphics to their previous locations and allow the system to go on to the next unaligned connector. Click Yes to accept the placement.
In Manual Mode, users select graphics in the file for alignment. If graphics are selected that cannot be aligned, the following message box displays.
Click Do Not Notify to dismiss the dialog. If other inappropriate graphics are selected, they are removed from the select set without notification.
76
Cleaning up After Conversion After graphics that can be aligned are selected, click Align on the Alignment ribbon bar to make the graphics orthogonal. A message box displays for the user to accept or reject the results. Exit is the last command on the right side of the Alignment ribbon bar. Click it to exit the Alignment process.
Click OK to scan the layers in the nonConvertedGraphics.pid file that are marked Yes for text boxes that were not processed. Make the non-converted graphics document the active document. Select the text boxes you want to convert. Starting the 'Convert Remaining Text' procedure this way skips the layer selection and the Associated Text process. Only unassociated text is valid for selection. Associated text must be collected by SmartPlant Import Assistant. If something other than a text box is selected when the command is started, the following error message displays: One or more of the items selected are not valid for this command. Only text boxes are valid for the Convert Remaining Text command. Exiting command.
77
Associated Text
The first text to be processed will be text that was not processed, but is associated with a plant item that was processed. The properties dialog box for the plant item to which the text is associated will appear, as pictured below.
The unprocessed text, in this case, NC, has been copied to the clipboard and can be pasted into the correct property for its plant item. After this dialog box has been completed, the user is prompted to place a label for the attribute.
78
Cleaning up After Conversion Choosing Yes displays the same symbol explorer dialog box seen in the Rule Set Editor (see "Compiling and Testing a Rule Set" on page 63) and the Convert Remaining Graphics (see "Converting Remaining Graphics" on page 73) function in Post Conversion Cleanup. The user will then select a label symbol to place. If a symbol that is not of type label is chosen, the user must choose a symbol that is a label or exit the process. When a label is selected, it is then placed in the file.
Then, if there are more unprocessed text boxes associated with plant items, the system will move on to the next one. The system assumes the user will take care of all associated text the first time he runs the Convert Remaining Text process, and the next time he starts the process, it will start with unassociated text.
Unassociated Text
After all the associated text has been addressed, the Convert Remaining Text process will begin the unassociated text. This can be a note, text from elements that did not get processed, or any other text that was not clearly associated with a plant item. The first time Convert Remaining Text is run on a drawing in Post Conversion Cleanup, the user has an option to continue with the unassociated text at this time or not.
This dialog will only appear if the user has addressed associated text already in the same session of Convert Remaining Text.
79
Cleaning up After Conversion For each unassociated text box, the user will have to decide how to process it. Choosing Skip will do nothing to the highlighted text, and go on to the next.
Item Notes
If Item Note is chosen, the system will place an item note in the place of the text. The item note label for SmartPlant Import Assistant is called SmartPlant Import Assistant-Item Note & Label.sym and it is based on the SmartPlant P&ID symbol Item Note & Label.sym. When a label is placed, SmartPlant Import Assistant attempts to match its size to the size of the original text box. This size is appended to the name of the symbol.
Drawing Properties
If Drawing Property is chosen, the SmartPlant P&ID property dialog will appear with the properties for the drawing. The text is copied to the clipboard, so the user can paste it into the desired drawing property on the property dialog and then dismiss the form to go on to the next text box.
80
Record Graphics
The Record Graphics function in Post-Conversion Cleanup allows the user to capture or record graphics from a SmartPlant P&ID drawing in a way that can then be interpreted by Intergraph development for problem solving purposes. When this button is pressed, the user is prompted to select a script file to write to; he may choose an existing one, (which will be overwritten) or create a new one. This is a file with the extension .AGP (automatic graphics placement). Any graphics that are highlighted are written out to this file. This is not related to the Record and Record Playback in the Ruleset Editor.
81
82
SECTION 10
83
84
APPENDIX A
Regular Expressions
Pattern Syntax 1998 by Stinga This table explains special characters and sequences used in writing patterns for regular expressions.
Character
\ ^ $ * + ? . (pattern)
Description
Marks the next character as special. "n" matches the character "n". The sequence "\n" matches a linefeed or newline character. Matches the beginning of input or line. Matches the end of input or line. Matches the preceding character zero or more times. "zo*" matches either "z" or "zoo." Matches the preceding character one or more times. "zo+" matches "zoo" but not "z." Matches the preceding character zero or one time. "a?ve?" matches the "ve" in "never." Matches any single character, except a newline character. Matches pattern and remembers the match. The matched substring can be retrieved from the Substrings collection. To match parentheses characters, (), use "\(" or "\)". Matches either x or y. "(z|f)ood?" matches "zoo" or "food." A character set. Matches any one of the enclosed characters. "[abc]" matches the "a" in "plain." A negative character set. Matches any character not enclosed. "[^abc]" matches the "p" in "plain."
85
Regular Expressions
To use special characters, including a period ( . ), as a delimiter in a regular expression, enter a backslash (\ ). The backslash stands for the special character, instead of meaning "match any single character." Other special characters include an asterisk ( * ), plus sign ( + ), and question mark ( ? ).
86
Index
A
Analyzing file structure 21 Assigning rules to graphics 55 Attributes Attributes for graphical rules 43 Explicitly mapped attributes 51 Instruments and attribute data 49 Item tag attributes 54 Pipelines and attribute data 45 Using VB Script files for Attribute Mapping 69 Attributes for graphical rules 43 attributesVB scripts for attribute mapping 61 Setting Snap To Target for drawing sets 12
E
Explicitly mapped attributes 51
G
graphicsadjusting base rotation of graphics 38 graphicsadjusting origin of graphics 39 graphicsassigning rules to graphics 55 graphicsattributes 43, 57 graphicsdashed lines 57 graphicsgraphic attributes and label symbols 56 graphicsgraphic to symbol association with attributes 55 graphicsMerge Text Boxes 44 graphicsproperties 41 graphicsreducer labels 57 graphicssimple graphic to symbol association 55 graphicsungrouping graphics 37
C
Checking symbol size 32 Conforming graphics to a rule 34 Connector alignment in Post Conversion Cleanup 75 Conversion Auto convert individual files 67 Cleaning up after conversion 73 Conversion considerations 1 conversionbatch conversions 68 Snap To Target Behavior for Auto Convert 68 Viewing the Auto Convert log file 71, 73 Convert Remaining Text in Post Conversion Cleanup 77 Converting remaining graphics to symbols 73 Creating new groups and rules 36 Creating new P&ID symbols 33
I
Initialization of the software 4 Installation of the software 3 Instruments and attribute data 49 Item tag attributes 54
L
labelslabel symbols 56 labelsreducer labels 57
M
Mapping P&ID symbols to graphical rules 31
D
Drawing borders and rules 33 Drawing borders and scale 9 Drawing sets Adding a drawing set 7 Finishing a drawing set 14 Opening a drawing set 15 Removing a drawing set 15 SmartPlant Import Assistant Installation and User's Guide
O
OPC tag numbers 54
87
Index
P
Pipelines and attribute data 45
R
Record graphics in Post Conversion Cleanup 81 recording operations 40 regular expressions 85 Removing a rule 30 Rule Criteria dialog box 28 Rule Set Editor Control Bar 27 Rule sets 5 Adding rule sets 17 Advanced rule set generation dialog box 25 Compiling and testing a rule set 63 Creating new rule sets 17 Deleting rule sets 19 Excel files as intermediate format 26 Generating a default rule set 24 Generating rule sets 26 Mapping existing rule sets 26 Recorder assistant 23 Removing drawing files from rule sets 20 Rule Set Editor Control Bar 27 VB Script and rule sets 5 Viewing attribute and label information after testing the ruleset 64 Viewing plant item information after testing the ruleset 63 Rules Assigning rules to graphics 55 Conforming graphics to a rule 34 Creating new groups and rules 36 Drawing borders and rules 33 Mapping P&ID symbols to graphical rules 31 Removing a rule 30 Rule components 5 Rule Criteria dialog box 28 Testing rules 35 rules simple graphic to symbol association 55 rulescreating new P&ID symbols 33 rulesgraphic attributes 57 rulesgraphic attributes and label symbols 56 rulesgraphic to symbol association with attributes 55 88
S
SmartPlant P&ID symbols 31 symbols SmartPlant P&ID symbols 31
T
Testing rules 35
V
Viewing Unconverted Graphics in Post Conversion Cleanup 77
W
Working with file elements 35 Working with file elements in the Ruleset Editor 35