Академический Документы
Профессиональный Документы
Культура Документы
Design Series
2004 Edition
Microsoft, Windows, and Windows NT are registered trademarks of the Microsoft Corporation
in the United States and/or other countries.
Adobe, Acrobat, and the Acrobat logo are registered trademarks of Adobe Systems Incorporated.
Primavera Project Planner and P3 are registered trademarks of Primavera Systems, Inc.
RealityWave and the RealityWave logo are registered trademarks and VizStream is a trademark of
RealityWave Inc.
Other brands and product names are used for identification purposes and are trademarks of their
respective owners.
Copyrights
Information in this manual is subject to change without notice and does not represent a
commitment on the part of Bentley Systems, Incorporated. The software in this document is
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators i
furnished under a license agreement or a non-disclosure agreement. It is against the law to copy
the software on any medium except as specifically allowed in the license or non-disclosure
agreement. No part of this manual may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying or recording, for any purpose without
the written permission of Bentley Systems, Incorporated. If this manual is being received
electronically, you may print one copy for each licensed user, to whom the manual relates, for
informational, non-commercial purposes, provided that any copy of this document (or any
portion thereof) contains this copyright notice.
Copyright 1991-2004, Bentley Systems, Incorporated. All rights reserved. Including software, file
formats, and audiovisual displays; may only be used pursuant to applicable software license
agreement; contains confidential and proprietary information of Bentley Systems, Incorporated
and/or third parties which is protected by copyright and trade secret law and may not be
provided or otherwise made available without proper authorization. Published in the United
States of America.
Unpublished rights reserved under the copyright laws of the United States and international
treaties. All rights reserved.
IGDS file formats Copyright 1981-1988 Intergraph Corporation. Used with permission.
Intergraph raster file formats Copyright 1993 Intergraph Corporation. Used with permission.
PIC001 Practice Copyright 2002 Process Industry Practices. Used with permission.
ii PlantSpace Design Series Reference Guide for Administrators April 23, 2004
About This Reference Guide
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators iii
About This Reference Guide
Style Conventions
The following conventions explain the style of the text in this Reference Guide.
Style
Use in Text
Convention
ALL CAPITAL Names of acronyms and terms in object-oriented
LETTERS programming such as classes, properties, and methods
Letter Text that you type in a field, messages displayed online,
Gothic and programming code or syntax
Bold Names of commands, menus, buttons, and items that you
select
Italic Variables such as a filename, terms defined in text, and
names of books as references
Important information that the user must know (for
example, to avoid losing data)
Information of note that is useful to know
Related Documentation
The following related publications provide supporting information.
JSpace Concepts and Technical Reference Help
This online help provides a comprehensive overview of the JSpace object-oriented
environment. It also provides technical information about fundamental aspects of
JSpace that are employed in JSpace-based applications.
JSpace Class Editor User Help
This online help provides information on using the Class Editor and the technical
details about object classes, properties, methods, relationships, and inference rules.
JSpace MicroStation Connection User Guide
This Guide provides information on using the JSpace MicroStation Connection to
extract CAD model data and create JSpace object model files.
iv PlantSpace Design Series Reference Guide for Administrators May 19, 2004
About This Reference Guide
Online Documentation
User documentation is provided in online help on the Help menu of the
MicroStation menu bar. Administrator and tutorial (QuickStart Guide)
documentation is provided in PDF (Portable Document Format) files.
PDF Files
PDF files are platform independent. You can browse, search, and print them,
regardless of your operating system, by using the supplied Acrobat Reader utility
from Adobe Systems, Incorporated. PDF files of the documentation are displayed
on the Help menu on the MicroStation menu bar or in the
...\Bentley\Documentation directory created after the software is installed.
For more information on using the Acrobat Reader to browse, search, and print
PDF files, see the Help menu in the Acrobat Reader program.
Customer Support
Please contact your local authorized Bentley Value-Added Reseller (VAR) for
support. To find out the name and contact information for a Bentley VAR near you,
please call Bentley Systems, Incorporated at:
E-mail: family@bentley.com
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators v
About This Reference Guide
E-mail: support@bentley.com
For more information about Bentley Systems, Incorporated, please visit our Internet
web site at:
http://www.bentley.com
vi PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators vii
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
viii PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Table of Contents
Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Quick Lookup of Individual Components. . . . . . . . . . . . . . . . . . . . . 3-1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Quick Lookup by Database Table Name. . . . . . . . . . . . . . . . . . . . . . 4-1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Explanation of Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Types of Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Array Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Syntax Conventions Used in Function Statements . . . . . . . . . . 5-4
Argument Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Examples of Syntax Summaries . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators ix
Table of Contents
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
Direction Cosines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30
ABS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30
ABS_POINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30
ACOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31
ADOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
ASIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32
ATAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33
ATTRIBUTE_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33
BUD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-36
BUILD_LABEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41
CELL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-44
CELL_DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47
CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-53
CHAR_TO_INT (formerly CHAR$INT). . . . . . . . . . . . . . . . . . . . . 5-55
CHAR_TO_REAL (formerly CHAR$REAL) . . . . . . . . . . . . . . . . . 5-56
CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-57
COLLECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-58
CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-59
COS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-63
DELETE_COMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-63
ENDSURF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-64
EVALUATE (formerly PARAM$VALU). . . . . . . . . . . . . . . . . . . . . 5-64
EXTRACT_VALUE (formerly LABEL$VALU) . . . . . . . . . . . . . . . 5-65
EXTRACT_VALUE2 (formerly LABEL$VALU2) . . . . . . . . . . . . . 5-66
INHERIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67
INSERT_LABEL (formerly TEXT_LAB) . . . . . . . . . . . . . . . . . . . . 5-68
LEAD_CHARS (formerly LEAD$CHARS). . . . . . . . . . . . . . . . . . . 5-70
LOAD_VALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-70
LOCAL_POINT (formerly LOCAL_PT). . . . . . . . . . . . . . . . . . . . . 5-72
LOG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-72
LOG_FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-73
MATRIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-76
MAX (formerly MAX$VALU). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-82
MESSAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-82
x PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Quick Lookup by Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Primitives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
ARC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
CIRCLE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
CIRCELB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
CIRCLELL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
CONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators xi
Table of Contents
CUBE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
CYLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
DUCT_ECC_RED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
DUCT_RED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
DUCT_SEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
ECONE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
ECYLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
ELBOW. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
ELLIPSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
EPYRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
ETRCONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
HEMISPH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
LINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
LINESTRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19
PIPE_ECC_RED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20
PIPE_ELB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21
PIPE_HUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24
PIPE_RED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24
PIPE_SEG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
POINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
POLYCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
PYRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
RECTANGLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
RECTELL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
RIGHT_PRYSM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
SEMI_PRYSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
SHAPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
SQTORND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
TRCONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
xii PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Table of Contents
Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
How Does the System Execute a Rule File? . . . . . . . . . . . . . . . . . . . 7-6
How Do You Step Through a Rule? . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
Index
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators xiii
xiv PlantSpace Design Series Reference Guide for Administrators May 2004
1 Text Files for Setting Up the Design
Series
Introduction
This chapter explains how the system uses the text files referred to in the chapter
Configuring Your Project in the PlantSpace Design Series Administrator Guide. The Database
Setup Tool uses a number of text files to initialize and control program operation.
These files, unless otherwise noted in the text file descriptions, use various common
features.
Keyword/Value Pairs
Several of the text files employ the typical Windows style keyword = value format
for assigning a meaning (for example, value) to a program parameter (for example,
keyword). Related keyword/value pairs may be grouped using a bracketed name (for
example, [Group 1]).
Comment Character
A semi-colon (;) or an exclamation point (!) can be used to comment out a line or a
portion of a line. All text following the comment character is ignored.
Escape Character
A literal semi-colon (;) or an exclamation point (!) can be used within a line by
immediately preceding it with the escape character which is a back-slash (\).
Consider the examples shown.
x = y ; comment portion
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 1-1
1 Text Files for Setting Up the Design Series
Common Text File Features
x = z \; comment portion
In the first example, the keyword x has a value of y because the semi-colon
serves as a comment character, and so the comment portion is removed when the
file is parsed. However, in the second example, x has a value of z ; comment
portion because the escape character was used to create a literal semi-colon within
the value.
Line Continuation
A long line may be broken into multiple lines using the line continuation character,
which is a back-slash (\). Any comments or white spaces after the continuation
character are replaced by a single space and the line is concatenated with the
following line. Consider the example shown.
x = y \; comment portion
z \; comment portion
To use this feature, define the value of any required static text and one or more other
keywords enclosed by brackets and forward slashes (i.e., {//<keyword>//}). When
this keyword is used within the setup program, any embedded keywords in the value
are translated at that time.
1-2 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Text Files for Setting Up the Design Series
Text Files
Text Files
SETUP.INI
This file provides values to the Database Setup for a number of database-
independent program parameters. It also provides default values for many of the
Install dialog box fields. Values are stored in this file in keyword = value format. This
file is typically read by the program from the current working directory or from the
directory where the Database Setup program was loaded
SETUP.CFG
This file provides values to the Database Setup for a number of database-specific
program parameters. Values are stored in this file in keyword = value format.
PERSONAL.INI
Upon exiting the Database Setup, you can save the current parameters in a personal
configuration file if any of the parameters were changed from their initial values
during program execution.
When you save the file, you must remember to enter the extension for your
configuration file because the Database Setup tool does not add the extension.
You may assign any name to this new file; however, it is recommended that the INI
file be named setup.ini and stored in your usual working directory for the program. In
this case, the Database Setup will automatically load this file with its latest values.
Another alternative for user support personnel who must maintain multiple data
sources is to save the file with a name indicative of the database, such as
ORA_PROJ.INI or ACC_PROJ.INI. In this manner, the program will prompt the
user when the configuration file is required. The user can then select the proper file
for the database to be maintained.
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 1-3
1 Text Files for Setting Up the Design Series
Text Files
out, an existing database for re-installation. Install.scr lists the steps to install the
database.
Both script files are typically specific to a particular database and so are located in
the database vendor specific directory. However, the Database Setup program by
default searches both the database vendor specific directory and the generic setup
directory for these files.
This allows a particular database to use a specific set of these files while other
databases might use the generic set or individual script file.
FILES.DAT
Files with the *.dat extension are database table creation and/or loading files.
These files do not use keyword/value pairs and do not support the escape character
or run-time keyword evaluation features described above. They are generic to all
databases and so are usually located in the generic setup directory.
FILES.SQL
Files with the *.sql extension are SQL command files used for setting privileges or
modifying settings within the database during installation. Any valid SQL command
for the database in question may be used. For this reason, they may be specific to a
particular database, but may also be generic to the extent that the SQL commands
are generic ODBC. Thus, they may be found in the generic setup directory as well as
the database vendor specific directory.
1-4 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
2 Design Series Modeling Tables
Introduction
This is a reference for the Design Series modeling tables in your project database
mentioned in the chapter Configuring Your Project in the PlantSpace Design Series
Administrator Guide.
Be sure that you familiar with the MCS tables, the other set of tables that
(together with the Design Series modeling tables) make up your project
database. The MCS tables listed below are explained in the chapter Setting Up
and Maintaining Your Project Database in the Model Control System (MCS) Guide on
the TriForma Help menu or in the ...\Bentley\Documentation\TriForma
directory.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-1
2 Design Series Modeling Tables
Quick Lookup
LEVEL_MAP_ACCESS table
MODULES table
PROBLEM_LOG table
PROJECT_CONFIG table
PROJECT_VOLUMES table
SITE_CONFIG table
STAND_ATTR table
MCS sequence tables (or sequences in Oracle)
BUD_ID_SEQ table or BUD_ID sequence
CHECKOUT_ID_SEQ table or CHECKOUT_ID sequence
LEVEL_ID_SEQ table or LEVEL_ID sequence
MCS_LOCK_SEQ table or MCS_LOCK_SEQ sequence
PRBM_ID_SEQ table or PRBM_ID sequence
Quick Lookup
The Design Series Modeling tables are arranged in alphabetical order as follows:
2-2 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
Attribute Definition Tables
The attribute definition tables define the attributes associated with each component.
Within MicroStation, the attributes of a Design Series component are stored in a
text element. This text element is commonly referred to as the component label.
These tables are referenced to create, edit, read, and parse the component attributes.
When placing the first component, the user sees the default values in the attributes
dialog box, as shown in this generic example of an attributes dialog box.
When the user places subsequent components, the values used in the last operation
are displayed in the attributes dialog box. Although these values are not updated in
the database, they are updated in the prompting software.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-3
2 Design Series Modeling Tables
Attribute Definition Tables
Design Series provides the following three attribute definition tables to address this
issue:
The attribute definition tables can be broken down into three layers where the
ATTRDEFN table is the main layer or Layer 0, and the ATTRCDEF table is Layer
1. Layer 2 of attribute definition tables can also be used to define an attribute for an
2-4 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
ATTRDEFN Table
The following sections describe each attribute definition table in more detail.
ATTRDEFN Table
The ATTRDEFN table (Layer 0 attribute definition table) defines attributes
associated with each component and forces Design Series to be specification driven.
The ATTRDEFN table is the only table that defines the label position, width,
precision, and type of attributes.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-5
2 Design Series Modeling Tables
Attribute Definition Tables
Example
ATTRCDEF Table
The ATTRCDEF table (Layer 1 attribute definition table) is used only when the
user selects the catalog-driven option from within Design Series. Because the
2-6 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
ATTRCDEF Table
As you recall, if a user selects the Specifications option in the Placement Mode field
from within Design Series, the ATTRDEFN table is used. However, if the user
selects the Catalogs option, the ATTRCDEF table overlays the ATTRDEFN table.
The following example explains how both options can be used. You are placing two
elbows, one placed according to a specification and the other placed from a catalog
table. The elbow placed by the specification needs a SPEC attribute. The valid
values for the elbow attribute SIZE_1 are taken from the specifications table
PIPE_PELB_SPEC based on SPEC. The elbow placed by catalog does not have a
SPEC attribute. The valid values for the elbow attribute SIZE_1 are taken from the
catalog table PIPE_PELB.
Both elbows must have the same set of attributes, so the attribute definition table
ATTRCDEF hides the SPEC attribute by using the value BEMCR for the
APP_FLAGS, and assigns the value NOSPEC to the SPEC attribute by setting
NOSPEC as the default value for SPEC. The ATTRCDEF elbow attribute SIZE_1
has a different value for the INPUT_METHOD causing it to query the
PIPE_PELB table, instead of the PIPE_PELB_SPEC table.
When the user places a pipe component and selects the Specifications option in the
Placement Mode field of the Place Component dialog box, the user must select a
specification before placing the elbow. If the user selects the Catalogs option, a
specification is not required before placing the elbow.
You can control whether to make specifications or catalogs available to users in the
Placement Mode field of the Place Component dialog box. For example:
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-7
2 Design Series Modeling Tables
Attribute Definition Tables
The ATTR_XXn tables are used together with the ATTRDEFN table. Because each
ATTR_XXn table is a Layer 2 attribute definition table, it overlays the ATTRDEFN
table so that only certain columns of the ATTRDEFN table are used.
ATTRC_XXn Tables
The ATTRC_XXn tables are used together with the ATTRCDEF table. Because
each ATTRC_XXn table is a Layer 2 attribute definition table, it overlays the
ATTRCDEF table so that only certain columns of the ATTRCDEF table are used.
2-8 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
Catalog Tables
The Layer 2 attribute definition tables enable a user to configure the Design Series
label for that standard. The standards attribute definition (ATTR_XXn) tables
overlay the ATTRDEFN table. To access any of these tables, the user simply selects
the standard from the attributes dialog box. If the selected standard corresponds to
a standards attribute definition table, the attributes dialog box displays the attributes
that are specific to that standard.
Design Series uses the standard attribute definition tables ATTRC_XXn with
the ATTRCDEF table in the same manner as described in the previous
sections.
The European Data Set standard has an attribute called REIHE, which is specific
only to the European Data Set standard. Therefore, when the user is placing pipe
components in Design Series, the user should see only the REIHE attribute when
using the European Data Set standard. REIHE should not be displayed with any
other standard.
Refer to the section Editing the Text Files Containing Attribute Definitions on page
2-12 in the chapter "Configuring Your Project" in the PlantSpace Design Series
Administrator Guide. The REIHE attribute is added to all pipe components in the
ATTRDEFN table that are required to display the attribute. However, they will be
commented out by setting the APP_FLAGS to BEMCR. The REIHE attribute is
added to the same pipe components in the ATTR_EDS table. However, the
application flags will not be set (that is, APP_FLAGS is empty).
When the user places a pipe component in Design Series and selects European Data
Set as the standard, the ATTR_EDS table overlays the ATTRDEFN table and the
APP_FLAGS is empty, resulting in the display of the REIHE attribute.
Catalog Tables
The catalog tables contain dimensional data for all of the components. Each table
contains data for a logical grouping of components of a certain product. For
example, the table PIPE_PBRN contains dimensional data for piping branches, and
the table PIPE_PELB contains dimensional data for piping elbows.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-9
2 Design Series Modeling Tables
Classes Table
Example
Classes Table
The CLASSES table defines all BUDs (Basic Unit of Design) and their associated
attributes, namely: rule name, table name, and corresponding database and
component type. The CLASSES table (in the classes.dat and pip_cls.dat files) either
defines or controls the following:
2-10 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
Classes Table
Defines the colors used by the Model Control System (MCS). Three
columns in the CLASSES table called BUD_COLOR,
CHECKOUT_COLOR, and LOCKED_COLOR are used when
components are checked into or out of the project database.
Example
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-11
2 Design Series Modeling Tables
Configuration Tables
Configuration Tables
Configuration tables are created from *.dat files that pertain to the configuration of
the project database. These are project-specific tables that control user check-in/
check-out, and assign project volumes, project working units, site identification, and
pipe component symbology. The following tables are involved in configuration.
User Tables
Three user tables are provided as follows:
USERS table
Stores the names of users who can access the Design Series
database. The USERS table controls the products that users are
allowed to check out and check in based on the group ID assigned
to them from the GROUP_USAGE table.
GROUP_CODE Table
The GROUP_CODE table assigns a code letter to each Design
Series product. This code letter is used by the GROUP_USAGE
table.
GROUP_USAGE Table
The GROUP_USAGE table enables you as the Design Series
administrator to create group names and assign group codes from
the GROUP_CODE table to those names. The group usage names
are then assigned to the users in the USERS table.
PIPE_SYMB Table
The PIPE_SYMB table stores the pipe line system or service names and assigns a
line weight, color, line style, and level to each system or service. This table is
accessed every time a user places a pipe component in a 3D model, and works as
follows:
2-12 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
PIPE_SYMB Table
The PIPE_SYMB table is in the Symbolgy.dat file (spelled this way to keep the file
name to eight characters), in your ...\{ProjectName} \dbload\data\pipe directory.
The table contains the default color symbology delivered with the software.
However, you can customize the colors designated for each system by editing this
file.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-13
2 Design Series Modeling Tables
Configuration Tables
PROJECT_CONFIG Table
The PROJECT_CONFIG table identifies the properties for the system units and
site ID of your project. This table is set from either the imperial or SI (metric) file:
2-14 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
PROJECT_VOLUMES Table
The system units and working units defined in the PROJECT_CONFIG table
must match the system units and working units defined in the following files:
PROJECT_VOLUMES Table
The PROJECT_VOLUMES table contains a list of project specific areas defined by
the master volume definition file. Users can define their own discipline volume
definition files containing areas to be specified during a Model Control System
(MCS) operation.
Description Tables
The Description tables define the codes and descriptions for the common attributes
of the most frequently used component types. The Description tables affect the
Value column of the attributes dialog box. Description tables also enable you to
store an abbreviation but display a long description to users, or the reverse.
In the following example, by editing the Description table containing the value for
the End Preparation attribute, users will see either the full name BUTT WELD or
the abbreviation BW (or if not an abbreviation, the actual value in the label).
Full Name
Abbreviation
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-15
2 Design Series Modeling Tables
Description Tables
This configuration is useful in this example because if your company uses lengthy
full names and you need to conserve space in the Value field, you can set up
abbreviations.
Most piping components have an attribute EPREP_1 that stores the type of end
preparation for the component. You can enter the following coded values for
EPREP_1:
When the system converts the 3D model components into JSpace objects, the
coded values automatically expand into their full descriptions and are stored in the
COMP_DESC property of the object.
2-16 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
Description Table Format
is the attribute or property name. CONN_DESC is the database table name. The
next two columns are the Code and Description.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-17
2 Design Series Modeling Tables
Description Tables
The definition and data values for all description tables are in the glossary.dat file,
which is in your ...\{ProjectName} \dbload\data directory.
2-18 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
Automatic Expansion of Description Names
BUD_TYPE = "PIPE_PELB"
B_ANGLE = 90
B_RADIUS = "L"
CONN_1 = "BW"
BUD_TYPE = "PIPE_PBRN"
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-19
BR_TYPE = "ITE"
CONN_1 = "SD"
The values shown, for example for Size 1 and Size 2, are controlled by the
Psnomdsc.txt file in the ...\Bentley\Program\DesignSeries\default directory.
During the installation of Design Series when you select the SI (metric) or Imperial
radio button, the system copies either the SI contents in Psnomdscm.txt or the
imperial contents in Psnomdsce.txt to the Psnomdsc.txt file. This file tells the
system where to find the appropriate table in the project database to display the SI
or imperial value in the Value column of the attributes dialog box.
For example for the attribute SIZE_1, the system is instructed to go to the
PIPE_DIAMETER table in the project database to get the SI value from the
2-20 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
Expert Rules Table
The CLASSES table specifies the parametric rule used to build each component.
Modeling rules have an application name PSDS. Rules are selected based on the
following:
Example
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-21
2 Design Series Modeling Tables
Specification Tables
Specification Tables
Piping specifications are contained in *_SPEC tables, where * is the name of the
catalog table. You can populate these tables by using the Specification Maker
program, and you should make all changes to the data contained in these tables by
using Specification Maker.
Example
2-22 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Design Series Modeling Tables
MANUFACTURERS Table
MANUFACTURERS Table
This table maps a manufacturer standard name to a generic standard name (for
example, that piping uses for an end preparation).
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 2-23
2-24 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
3 Diagrams of Parameterized
Components
Introduction
This chapter displays diagrams of the parameters for raceway and piping
components. The information on the piping components expands on the piping
components described in the chapter Configuring Your Project on page 2-1 in the
PlantSpace Design Series Administrator Guide.
Dimensions
The following diagrams show connect point locations and critical dimensional
parameters excluding those that you would look up in common tables such as pipe
outside diameters (PIPE_DIAMETER) and valve operator data (PIPE_PVOP and
PIPE_PVLT).
The dimensions are in the table name listed below the name of the drawing.
For more information on the tables, see the chapter Configuration Data for Your
Project Database Tables on page 4-1.
Raceway components
Piping components
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-1
3 Diagrams of Parameterized Components
Introduction
3-2 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Quick Lookup of Individual Components
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-3
3 Diagrams of Parameterized Components
Introduction
3-4 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Quick Lookup of Individual Components
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-5
3 Diagrams of Parameterized Components
Drawings of Raceway Components
3-6 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Drawings of Piping Components
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-7
3 Diagrams of Parameterized Components
Drawings of Piping Components
Trap Adapter
(no table)
3-8 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Inline Pipe Components
Basket Strainer
(table PIPE_PSTR)
Inline Strainer
(table PIPE_PSTR)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-9
3 Diagrams of Parameterized Components
Drawings of Piping Components
Nipple
(table PIPE_PNPL) Union
(table PIPE_PUNI)
Coupling
(table PIPE_PCPL)
Bellows
(table PIPE_BLLW)
Spool
(table PIPE_PSPL)
3-10 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Inline Pipe Components
Flow Meter
Vertical Type: Rotameter
(table PIPE_FMTR)
Flow Meter
Horizontal Type: Water Meter
(table PIPE_FMTR)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-11
3 Diagrams of Parameterized Components
Drawings of Piping Components
Flow Meter
Horizontal Type: Rotary Piston Meter
(table PIPE_FMTR)
3-12 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Branches
Pipe Branches
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-13
3 Diagrams of Parameterized Components
Drawings of Piping Components
Tee Wyes
Double Wyes
(table PIPE_PBRN) (table PIPE_PBRN)
(table PIPE_PBRN)
3-14 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Closures
Pipe Closures
Cap
(table PIPE_PBND)
(table PIPE_PELB)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-15
3 Diagrams of Parameterized Components
Drawings of Piping Components
Return Bend
Point-of-Use Straight
(table PIPE_RBND)
(table PIPE_POUS)
S-Bend
(table PIPE_PSBN)
Point-of-Use Bend
(table PIPE_POUB)
3-16 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Flanges and Clamps
Detail at Point A
Single Blind
Ring Spacer
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-17
3 Diagrams of Parameterized Components
Drawings of Piping Components
Spectacle Blind
(table PIPE_PFLG)
(table PIPE_PFLG)
P3 - (minus) 1/16 "
if P5 = 0
3-18 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Flanges and Clamps
Stub-End Flange
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-19
3 Diagrams of Parameterized Components
Drawings of Piping Components
Weld Neck
(table PIPE_PFLG)
Blind, Victaulic, AWWA Ring
(table PIPE_PFLG)
3-20 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Flanges and Clamps
Ferrule O-Ring
Clamp
(table PIPE_CLMP)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-21
3 Diagrams of Parameterized Components
Drawings of Piping Components
Pipe Reducers
Swage
(table PIPE_PSWG)
Reducer
(table PIPE_PRED)
Insert Bushing
3-22 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Taps
Pipe Taps
(table PIPE_PTAP)
Tangential Tap
(table PIPE_TTAP)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-23
3 Diagrams of Parameterized Components
Drawings of Piping Components
Angle Valve
Check Valve
(table PIPE_PVLV)
(table PIPE_PVLV)
3-24 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Valves and Operators
(table PIPE_PVLV)
Relief Valve
(table PIPE_PVLV)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-25
3 Diagrams of Parameterized Components
Drawings of Piping Components
(table PIPE_PVLV)
(table PIPE_PVLV)
3-26 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Valves and Operators
Cylinder Operator
(table PIPE_PVOP)
Chain Operator
(table PIPE_PVOP)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-27
3 Diagrams of Parameterized Components
Drawings of Piping Components
Gear Operator
(table PIPE_PVOP)
3-28 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Valves and Operators
Handwheel Operator
(table PIPE_PVOP)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-29
3 Diagrams of Parameterized Components
Drawings of Piping Components
Lever Operator
Motor/L120_10 Operator
including MSMB, MSMB3, ML120_20,
ML120_40, ML120_80, ML120_190
(table PIPE_PVLT)
3-30 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Diagrams of Parameterized Components
Pipe Valves and Operators
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 3-31
3 Diagrams of Parameterized Components
Drawings of Piping Components
Plain
(table PIPE_PEND)
Grooved
(table PIPE_PEND)
Beveled
(table PIPE_PEND)
Ferrule
(table PIPE_PEND)
Compression
(table PIPE_PEND)
3-32 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
4 Configuration Data for Your Project
Database Tables
Introduction
This chapter expands on the chapter Configuring Your Project in the PlantSpace Design
Series Administrator Guide. This chapter describes the format of the pipe and electrical
database tables.
The component names are arranged in alphabetical order. However, you can
also search by the database table name in the following quick lookup section.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-1
4 Configuration Data for Your Project Database Tables
Introduction
4-2 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Quick Lookup by Database Table Name
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-3
4 Configuration Data for Your Project Database Tables
Introduction
4-4 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Standards Delivered with Design Series
For example, the ANSI industry standard B16.1 maps to the B16_1 subdirectory in
pipe. B16_1 contains various component types that meet this standard. The file
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-5
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
naming convention begins with an abbreviated name for the component type and
ends in the number or name relating to the standard.
4-6 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Bolts
BOLT_STANDARDS STNDRD Standard or manufacturer name
BOLTS.DAT CODE Standard or manufacturer number
DIAMETER Bolt diameter
LENGTH Bolt length
TYPE Bolt type (MACH or STUD)
UNITS Units (IN or MM)
Branches
PIPE_PBRN BR_TYPE Branch type
PBRN.DAT EPREP1 End connection 1
SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
EPREP3 End connection 3
SCH_RAT3 Schedule/rating of end connection 3
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
SIZE_3 Nominal diameter 3 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
FACE Flange facing
REIHE Wall thickness option
P1_PAR (See Chapter 3 in this Guide)
P2_PAR (See Chapter 3 in this Guide)
P3_PAR (See Chapter 3 in this Guide)
P4_PAR (See Chapter 3 in this Guide)
P5_PAR (See Chapter 3 in this Guide)
P6_PAR (See Chapter 3 in this Guide)
PAR_UNITS Units for columns with names ending
with _PAR
Bushings
PIPE_PBUS EPREP1 End connection 1
PBUS.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
STYLE Head or body style
P1_PAR Bushing length
P2_PAR Thread length
P3_PAR Head diameter
PAR_UNITS Units for columns with names ending
with _PAR
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-7
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Clamps
PIPE_CLMP EPREP1 End connection 1
CLMP.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
CLMPTYPE Type of clamp
P1_PAR Clamp diameter
P2_PAR Clamp width
P3_PAR Bolt width/height
P4_PAR Bolt length
P5_PAR Wing-nut height
PAR_UNITS Units for columns with names ending
with _PAR
Couplings
PIPE_PCPL EPREP1 End connection 1
PCPL.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
FACE Flanged face of the component
STYLE Style number
P1_PAR Coupling length
PAR_UNITS Units for columns with names ending
with _PAR
Elbows (Mitered)
PELB_NUMSEG SIZE_1 Nominal diameter 1 (in inches)
NUM_SEG.DAT SIZE_2 Nominal diameter 2 (in inches)
ANGLE Bend angle
RADIUS Elbow radius
NUM_SEG Number of segments
P1_PAR Center to run end
P2_PAR Center to reducing end
P3_PAR Bend radius, 0=calculate
PAR_UNITS Units for columns with names ending in
_PAR
4-8 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-9
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
End Preparations (Not Flanged) used to query attributes for end-preps that are not flanged
PIPE_NOT_FLANGE EPREP1 End preparation value (that is not
PNFL.DAT STNDRD flanged)
CODE Used to set the flange standard to #
SERIES Used to set the flange code to #
TYPE Used to set the flange series to #
RATING Used to set the flange type to #
Used to set the flange rating to 0 (or
FACE other value)
REIHE Used to set the flange face to #
Used to set the flange REIHE to #
End Preparations (PVC Fittings)
PVC_PEND PART_NUM Part number for PVC fitting
PVC_PEND.DAT EPREP1 End connection 1
EPREP2 End connection 2
EPREP3 End connection 3
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
SIZE_3 Nominal diameter 3 (in inches)
P1_PAR Outer diameter of flange or band for end
connection 1
P2_PAR Width of flange or band for end
P3_PAR connection 1
P4_PAR Inset of connect point for end
connection 1
P5_PAR Outer diameter of flange or band for end
P6_PAR connection 2
P7_PAR Width of flange or band for end
connection 2
P8_PAR Inset of connect point for end
P9_PAR connection 2
PAR_UNITS Outer diameter of flange or band for end
connection 3
Width of flange or band for end
connection 3
Inset of connect point for end
connection 3
Units for columns with names ending in
_PAR
End Preparations (Rating Only) used to provide sch_rat to place end-preps for components
that have only rating
PIPE_END_RATING STNDRD Standard or manufacturer name
END_RATG.DAT CODE Standard or manufacturer number
RATING Pressure rating
END_RATING Schedule-rating for end-prep placement
4-10 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
End Preparations (Valve Code) used to query another code to use for getting end preparation
data
PIPE_VALVE_CODES VLV_CODE Code on valve
VLV_CODE.DAT EPREP1 end connection
RATING Fitting rating (maximum)
END_CODE Code to use for end-prep data
Equipment PNOZ Data (BW, SW, and SC)
PIPE_PNOZ_ENDS EPREP1 Nozzle connection code
PNOZ.DAT SIZE_1 Nominal diameter (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
SERIES Flange series
TYPE Flange type
RATING Pressure rating
FACE Flange facing
REIHE Wall thickness option
Ferrules
PIPE_FERR EPREP1 End connection 1
FERR.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
FERRTYPE Type of ferrule
P1_PAR Length of ferrule
PAR_UNITS Units for columns with names ending
with _PAR
Field Welds, Reserved Area for
PIPE_FWLD SIZE_1 Nominal diameter (in inches)
FWLD.DAT P1_PAR Radius of reserved area
P2_PAR Length of reserved area
PAR_UNITS Units for columns with names ending
with _PAR
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-11
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Flanges
PIPE_PFLG SIZE_1 Nominal diameter 1 (in inches)
PFLG.DAT SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
SERIES Flange series
TYPE Flange type
RATING Pressure rating
FACE Flange facing
GKT_TYPE Required gasket type
REIHE Wall thickness option
EPREP1 End connection (always FL)
P1_PAR Flange diameter
P2_PAR Flange thickness
P3_PAR Flange length
P4_PAR Hub diameter
P5_PAR Start hub diameter or inset depth
PAR_UNITS Units for columns with names ending
with _PAR
BOLT_NUM Number of bolts required
BOLTD_PAR Diameter of bolts required
BOLTL_PAR Length of bolts required
BOLT_TYP Type of bolt (machine or stud)
Flanges (with End Preparations) used for end preps allowed for the non-bolted side of a flange
(end 1) by flange type
PIPE_FLANGE_ENDS FL_TYPE Flange type
FLG_ENDS.DAT EPREP1 End connection
Flexible Hoses
PIPE_FLEX SIZE_1 Nominal diameter (in inches)
FLEX.DAT STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
LENGTH Standard length
P1_PAR Outer diameter
PAR_UNITS Units for columns with names ending
with _PAR
4-12 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Assumptions:
1. The operator diameter of small size is
taken as 0.75 times the diameter of P5.
2. The thickness of operator (X) cover is
taken 0.125 times the operator diameter.
For example, X = 0.125*P5
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-13
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Assumptions:
1. The operator diameter of small size is
taken as 0.8 times the diameter of P5.
2. The length X of the middle body is
calculated on the basis of the endprep
length and P1.
4-14 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Assumptions:
The length of the lower cone is of the
length of the middle tube, and the upper
cone is the remaining of the length of
the tube.
Gaskets
PIPE_PGKT STNDRD Standard or manufacturer name
PGKT.DAT CODE Standard or manufacturer number
SIZE_1 Nominal diameter (in inches)
RATING Pressure rating
TYPE Gasket form or type
MAT_NAME Operator
P1_PAR Ring gasket outside diameter
PAR_UNITS Units for columns with names ending
with _PAR
Gasket Thicknesses
GASKET_THICKNESS STNDRD Standard or manufacturer name
PGKT_THK.DAT CODE Standard or manufacturer number
THICKNESS_IN Gasket thickness in inches
THICKNESS_MM Gasket thickness in millimeters
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-15
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Inserts (Reducing)
PIPE_PINS EPREP1 End connection 1
PINS.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
INS_TYPE Insert type
P1_PAR Insert a length
P2_PAR Insert b length
P3_PAR Diameter: type 1 and 2
P4_PAR Diameter: type 1 only
PAR_UNITS Units for columns with names ending
with _PAR
Instrument Taps
PIPE_INST EPREP1 End connection
INST.DAT SIZE_1 Tapped component size
SIZE_2 Tap diameter
P1_PAR Length of tap
P2_PAR Tap outer diameter
PAR_UNITS Units for columns with names ending
with _PAR
Intelligent Line String (Connection Codes)
PIPE_IL_CONN CORNER Corner code
LPILCONN.DAT EPREP1 End connection
Intelligent Line String (Corners) used to query a flange face for corner types that do not use
flanges
PIPE_IL_BEND CORNER Corner type (elbow, bend, and so on)
LPILBEND.DAT FACE Flange face value (#)
Intelligent Line String (Gasket Thickness)
PIPE_IL_GASKET EPREP1 End connection
LPILGASK.DAT THICKNESS Gasket thickness
THICK_MM Thickness in millimeters
4-16 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-17
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Limitorque Operators
PIPE_PVLT OP_TYPE Operator type
PVLT.DAT P1_PAR Handwheel diameter
P2_PAR Center of stem to center of handwheel
P3_PAR Face of housing to outer handwheel
P4_PAR limits
P5_PAR Back of housing to outer motor limits
P6_PAR Motor diameter
Center of stem to limit switch
P7_PAR compartment back
Center of stem to limit switch
P8_PAR compartment front
P9_PAR Limit switch compartment height
P10_PAR Center of stem to limit switch
P11_PAR compartment
P12_PAR Limit switch compartment length
P13_PAR Housing height
P14_PAR Center of stem to center of motor
P15_PAR Bottom of housing to center of motor
P16_PAR Center of stem to front of housing
PAR_UNITS Center of stem to side of housing
Bottom of housing to center of
handwheel
Units for columns with names ending
with _PAR
Nipples
PIPE_PNPL NPLTYPE Description of connections
PNPL.DAT EPREP1 End preparation 1
EPREP2 End preparation 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
REIHE Wall thickness option
NOM_LNTH Length of nipple, include _units
P1_PAR P3 plus the thickness of the hexagon
(See Chapter 3 in this Guide)
P2_PAR Male face-to-hexagon length
(See Chapter 3 in this Guide)
P3_PAR Face-to-face length of hexagon
(See Chapter 3 in this Guide)
PAR_UNITS Units for columns with names ending
with _PAR
4-18 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Nominal Dimensions for Conduit, Tray, HVAC, and Pipe Insulation Thickness (not pipe
diameter) used to show imperial - SI (metric) equivalents
EQUIV_NOM_SIZE IMP_SIZE Imperial size
EQNOMSIZ.DAT MET_SIZE SI size
Nominal Dimensions for Gasket, Orifice Plate, and O-ring Thicknesses used to show imperial
- SI (metric) equivalents
EQUIV_THICK IMP_SIZE Imperial size
EQNOMSIZ.DAT MET_SIZE SI size
Nominal Lengths
EQUIV_NOM_LENGTH IMP_SIZE Imperial size
EQNOMSIZ.DAT MET_SIZE SI size
Nozzle Codes
PIPE_THREADS EPREP1 Nozzle connect code
THREADS.DAT THREAD Thread type
O-Rings
PIPE_ORNG SIZE_1 Nominal diameter (in inches)
ORNG.DAT STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
MAT_NAME Material name
THICK Nominal thickness
P1_PAR Outside diameter
P2_PAR Actual (compressed) thickness
PAR_UNITS Units for columns with names ending
with _PAR
Orifice Plates
PIPE_POPL SIZE_1 Nominal diameter 1 (in inches)
POPL.DAT SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
RATING Pressure rating
THICK Thickness
P&ID Data used in placing a component using the P&ID component as a template
PID_MAP PID Expression for name of P&ID attribute
PIDATTR.DAT Design_Series Name of Design Series attribute
MAP_TABLE Name of table used to map a Design
Series attribute value to a Design Series
description when the P&ID attribute
value is in the form of the description
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-19
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Pipe
PIPE_PIPE SIZE_1 Nominal diameter (in inches)
PIPE.DAT SCHEDULE Schedule value
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
MAT_NAME Material name
REIHE REIHE (row) for wall thickness
EPREP1 Used for querying schedule
P1_PAR Unused
P2_PAR Unused
PAR_UNITS Units for columns with names ending in
_PAR
Pipe (PVC Part Numbers) used to find part numbers for PVC fittings
PVC_PARTNUM STNDRD Standard or manufacturer name
PVC_PTNO.DAT SCH_RAT Schedule rating of end-prep1
CODE Standard or manufacturer number
BUD_TYPE Component type
SUB_INFO Component grouping
EPREP1 End connection 1
EPREP2 End connection 2
EPREP3 End connection 3
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
SIZE_3 Nominal diameter 3 (in inches)
PART_NUM Part number
Pipe Caps
PIPE_PCAP EPREP1 End connection 1
PCAP.DAT SCH_RAT1 Schedule/rating of end connection 1
SIZE_1 Nominal diameter (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
FACE Flange facing
REIHE Wall thickness option
P1_PAR Cap length
PAR_UNITS Units for columns with names ending
with _PAR
4-20 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Pipe Diameters used to indicate the table and column used to look up the outside diameter of
pipe
DIAMETER_TABLES STNDRD Standard or manufacturer name
DIATABLE.DAT CODE Standard or manufacturer number
TBL_NAME Name of table with outside diameters
COL_NAME Name of columns with outside diameters
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-21
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
4-22 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Point-of-Use Bends
PIPE_POUB EPREP1 End connection 1
POUB.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
P1_PAR Depth
P2_PAR Bend diameter
P3_PAR Length of branch
PAR_UNITS Units for columns with names ending
with _PAR
Point-of-Use Straights
PIPE_POUS EPREP1 End connection 1
POUS.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
P1_PAR Depth
P2_PAR Bend diameter
P3_PAR Length of branch
PAR_UNITS Units for columns with names ending
with _PAR
Pressure Taps
PIPE_PTAP EPREP1 End connection
PTAP.DAT SIZE_1 Tapped component size
SIZE_2 Tap diameter
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
FACE Flange facing
P1_PAR Length of tap
P2_PAR Tap outer diameter
PAR_UNITS Units for columns with names ending
with _PAR
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-23
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Reducers (Concentric)
PIPE_PRED EPREP1 End connection 1
PRED.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
REIHE Wall thickness option
FACE Flange facing
P1_PAR Reducer length
PAR_UNITS Units for columns with names ending
with _PAR
Reducers (Eccentric)
PIPE_PERD EPREP1 End connection 1
PERD.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
REIHE Wall thickness option
FACE Flange facing
P1_PAR Reducer length
PAR_UNITS Units for columns with names ending
with _PAR
Return Bends
PIPE_RBND EPREP1 End connection 1
RBND.DAT SCH_RAT1 Schedule/rating of end connection 1
SIZE_1 Nominal diameter (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
RADIUS Elbow Radius
REIHE Wall thickness option
P1_PAR Depth
P2_PAR Bend diameter
PAR_UNITS Units for columns with names ending
with _PAR
4-24 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-25
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Spools
PIPE_PSPL STNDRD Standard or manufacturer name
PSPL.DAT CODE Standard or manufacturer number
SPLTYPE Spool type
EPREP1 End connection 1
EPREP2 End connection 2
NOM_LNTH Nominal length as #.#_UNITS
Strainers
PIPE_PSTR STR_TYPE Strainer type
PSTR.DAT EPREP1 End connection 1
SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
REIHE Wall thickness option
FACE Flange facing
STYLE Strainer type
P1_PAR Center to end
P2_PAR Center to outer end
P3_PAR Center to bottom basket
P4_PAR Basket body diameter
P5_PAR Outlet flange diameter
PAR_UNITS Units for columns with names ending
with _PAR
Swages (Concentric)
PIPE_PSWG SWGTYPE Abbreviation for two end preparations,
PSWG.DAT for example:
BBE = beveled both ends
BLE/PSE = beveled large end/plain
small end
EPREP1 End connection 1
EPREP2 End connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
P1_PAR Swage length
PAR_UNITS Units for columns with names ending
with _PAR
4-26 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Swages (Eccentric)
PIPE_PSWE SWGTYPE Abbreviation for two end preparations,
PSWE.DAT for example:
BBE = beveled both ends
BLE/PSE = beveled large end/plain
small end
EPREP1 End connection 1
EPREP2 End connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
P1_PAR Swage length
PAR_UNITS Units for columns with names ending
with _PAR
Symbology by System for Pipe
PIPE_SYMB SYS_NAME System name
SYMBOLGY.DAT LVL_NUM Level
COLOR Color
STYLE Line style
WEIGHT Line weight
Symbology by System for Conduit
CNDT_SYMB LVL_NUM Level
CNDT_SYMBOLGY.DAT COLOR Color
STYLE Line style
WEIGHT Line weight
Symbology by System for Tray
TRAY_SYMB LVL_NUM Level
TRAY_SYMBOLGY.DAT COLOR Color
STYLE Line style
WEIGHT Line weight
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-27
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Tangential Taps
PIPE_TTAP SIZE_1 Tap size 1 (in inches)
TANTAP.DAT STNDRD Tap specification
EPREP1 Tap end prep type
SCH_RAT1 Tap schedule rating
CODE Tap specification number
FL_FACE Tap facing
REIHE Tap row for wall thickness
P1_PAR Tap outer diameter
P2_PAR Tap length
PAR_UNITS Units for parameters
Assumptions:
1. Diameter of tap is taken from the
PIPE_DIAMETER table from size (8-
200 mm).
2. Radius of tapping pipe is calculated
after location of pipe.
3. For BW or # entry in database, there is
graphics in tap geometry.
4. For other endpreps, data is taken from
the PIPE_PEND table using EDS
standard.
Traps
PIPE_PTRP TRP_TYPE Trap type
PTRP.DAT EPREP1 End connection 1
SCH_RAT1 Schedule rating of end-prep1
EPREP2 End connection 2
SCH_RAT2 Schedule rating of end-prep1
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
P1_PAR (See Chapter 3 in this Guide)
P2_PAR (See Chapter 3 in this Guide)
P3_PAR (See Chapter 3 in this Guide)
P4_PAR (See Chapter 3 in this Guide)
P5_PAR (See Chapter 3 in this Guide)
PAR_UNITS Units for columns with names ending in
_PAR
4-28 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Unions
PIPE_PUNI EPREP1 End connection 1
PUNI.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
P1_PAR Union length
P2_PAR Octagon diameter
P3_PAR Small diameter
P4_PAR Socket to socket dimension
P5_PAR Socket or thread length
PAR_UNITS Units for columns with names ending
with _PAR
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-29
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Valve Operators
PIPE_PVOP EPREP1 End connection 1
PVOP.DAT SCH_RAT1 Schedule/rating of end connection 1
SIZE_1 Nominal diameter (in inches)
TYPE Valve type
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
OPERATOR Operator type
OP_ANG Operator angle
DATA_FMT Operator data format, used by the
pvophand rule file and indicates what the
value for P1 (operator length) of the
handwheel represents in the following
formats:
data_fmt = 1 indicates the true length
of the operator (work point of valve to
end of valve stem, parallel to angle of
operator)
data_fmt = 2 indicates vertical
operator clearance (work point of
valve to top edge of handwheel)
data_fmt = 3 indicates horizontal
operator clearance (work point of
valve to outside edge of handwheel)
RATING Pressure rating
MAT_NAME Operator
P1_PAR Center to top valve stem length
P2_PAR Handwheel diameter
P3_PAR Length of gear box
P4_PAR Width of gear box
P5_PAR Height of gear box
P6_PAR Distance from box center to outer end of
diagram
P7_PAR Offset
PAR_UNITS Units for columns with names ending
with _PAR
4-30 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
Valves
PIPE_PVLV EPREP1 End connection 1
PVLV.DAT SCH_RAT1 Schedule/rating of end connection 1
EPREP2 End connection 2
SCH_RAT2 Schedule/rating of end connection 2
SIZE_1 Nominal diameter 1 (in inches)
SIZE_2 Nominal diameter 2 (in inches)
STNDRD Standard or manufacturer name
CODE Standard or manufacturer number
REIHE Wall thickness option
VFL_TYPE Flange type for valve
PATTERN Valve pattern
TYPE Valve type
RATING Pressure rating
MAT_NAME Valve material
FACE Flange facing
P1_PAR Entire length or left-to-middle length
P2_PAR Face-to-center length for angle of valve
P3_PAR Body diameter (if not zero)
P4_PAR Length of the outlet for 3-way and 4-way
valves
P5_PAR Length of the second outlet for 4-way
valves
P6_PAR Not currently used.
PAR_UNITS Units for columns with names ending
with _PAR
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-31
4 Configuration Data for Your Project Database Tables
Layout of Pipe Database Tables
4-32 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Electrical Database Tables
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-33
4 Configuration Data for Your Project Database Tables
Layout of Electrical Database Tables
Conduit Code
CNDT_CODE DIAMETER Conduit nominal diameter
CON_CODE.DAT CODE Code value
Conduit Elbows and Bends
CNDT_CND_ELS CND_SIZE Conduit nominal diameter
LCND_ELS.DAT
RADIUS Bend radius type (L = long, S = short, and so
on)
CRNR_RAD_IN Bend radius value of elbow
CND_EXT_IN Length of straight extension on end of elbow
CND_EXT_MM Length of straight extension on end of elbow
Conduits
CNDT_CND_DIA CND_SIZE Conduit nominal diameter
LCND_DIA.DAT
CNDT_DIA_IN Conduit outside diameter
Condulet Couplings or Inline Condulets
CNDT_CNDLSP CND_SIZE Conduit nominal diameter
LCNDLSP.DAT
P1_PAR Overall length of coupling
P2_PAR Overall width of coupling
P3_PAR Overall height of coupling
P4_PAR Outside diameter of connectors
P5_PAR Length of coupling without connectors
P6_PAR Width of access plate
P7_PAR Length of access plate
Condulet Elbows
CNDT_CNDLLP CND_SIZE Conduit nominal diameter
LCNDLLP.DAT P1_PAR Overall length of elbow
P2_PAR Overall height of elbow
P3_PAR Overall width of elbow
P4_PAR Width of elbow without connectors
P5_PAR Length of elbow without connectors
P6_PAR Outside diameter of connectors
PAR_UNITS Units for parameters
4-34 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Configuration Data for Your Project Database Tables
Layout of Electrical Database Tables
Condulet Tees
CNDT_CNDLTP CND_SIZE Conduit nominal diameter
LCNDLTP.DAT P1_PAR Overall length of tee
P2_PAR Overall height of tee
P3_PAR Overall width of tee
P4_PAR Width of tee without connectors
P5_PAR Length of tee without connectors
P6_PAR Outside diameter of connectors
PAR_UNITS Units for parameters
Couplings
CNDT_CND_CPLG CND_SIZE Nominal diameter of conduit that coupling is
LCND_CPL.DAT attached to
CPLG_DIA_IN Coupling outside diameter
CPLG_LEN_IN Coupling overall length
CPLG_THD_IN Length of threads on couplings
CND_TYPE_IN Coupling type
Tray Code
TRAY_TCODE WIDTH Width of tray
TCODE.DAT
DEPTH Depth of tray
CODE Code value
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 4-35
4-36 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
5 Parametric Modeling Functions
Introduction
This chapter expands on the chapter Using the Expert System in Design Series in the
PlantSpace Design Series Administrator Guide and provides the standard built-in
functions for expert system rule files.
Explanation of Syntax
Each function listing contains a summary consisting of the syntax statement
followed by a table explaining its arguments. The syntax summary contains tokens,
which are representations of all return values, required arguments, and optional
arguments. Each token is explained in the table following the syntax statement. The
token explanation contains the token name, token type, data type, and meaning.
For clarity, multiple mode functions such as VECTOR, may have multiple
syntax entries and token explanations.
Types of Tokens
The four types of tokens are: keyword, variable or value, variable name, and return.
Keyword
Keyword is the simplest token type and is used for arguments that
control the behavior of a function. Keywords must appear exactly as
shown in the syntax summary, including single ( ' ) quotation marks.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-1
5 Parametric Modeling Functions
Introduction
5-2 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Explanation of Syntax
Array Types
For ease of documentation, Point, Vector, and Matrix are used as three array types in
this chapter. These are actually a simplification used to condense the description of
arguments that need to be passed to a function. Whenever a function requires a
chain of numeric arguments of the same type, these arguments can be passed as the
correct number of individual values or variables of that type, or as a variable
containing an array of values of that type. Although this is possible with any chain of
values, it is most commonly used as the following:
Point, Vector, and Matrix array type arguments can technically be of either
INTEGER (INT) or REAL data types. However, using an array of integers to hold
one of these data types may lead to inaccuracy because any floating point values
would be truncated during assignment.
You should therefore use all Point, Vector, and Matrix variables as arrays of
real numbers.
When the syntax summary of a function lists an argument with an array type of
Point, Vector, or Matrix, you can call that function using either the correct number
of individual values or the name of an array of that size. In some instances, it may be
most convenient to use both methods within the same function call. The condensed
form of points and matrixes is most useful when the value has been calculated by
another function or when a variable has been created specifically for that point,
vector, or matrix. The long forms of Points, Vectors, and Matrixes are more useful
when a variable does not exist with the correct values or when the values must be
calculated or modified.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-3
5 Parametric Modeling Functions
Introduction
W If you accidentally pass an array larger than the requested size, the
additional values will be read for arguments following the current one.
This is probably not what you intended.
Example:
The following table describes the style and syntax used to describe each function
statement:
Syntax Meaning
All capital letters Fixed text such as the function name
Example: EVALUATE
Angle brackets ( < >) Indicate an argument token, as previously explained
Underbar ( __ ) Indicates a default setting or selection
Curly brackets ( { } ) Indicate tokens that represent argument sets. Argument
sets are groups of arguments that commonly occur
together. To simplify documentation these are defined in
the next section of this chapter and are referenced in the
syntax summaries of the functions to follow.
Square brackets ( [ ] ) Indicate an optional argument or set of arguments.
Square brackets can be nested indicating that an optional
argument depends on another optional argument.
Where possible, commas (,) are included within the
square brackets for optional arguments. However, in
cases where all arguments are optional, you may need to
determine the placement of the commas to
appropriately delimit each set of arguments.
Example: <return_flag> = SOME_FUNCTION([ 'KEYWORD ',
<origin_point>,] <end_point>)
5-4 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Explanation of Syntax
Syntax Meaning
Vertical bar ( | ) Indicates an OR condition where one argument or
argument set can be present only if another is not. When
applicable, the default argument will be underlined. If
the option is between one set of arguments and another,
the entire set will be enclosed within an extra set of
square brackets.
Example of the use of the vertical bar (|) with the
rotational argument sets: 'ANGLE' or 'MATRIX'. Only one
of these can be applied to a function. That portion of
the syntax summary would look like the following:
[ 'ANGLE ', <alpha>, <beta>, <gamma>] | [ 'MATRIX
', <rot_matrix>]
Single quotation Used in three ways, two of which were mentioned in the
mark ( ' ) previous description of the keyword and variable name
token types. Single quotation marks can also be used to
specify text literal values. Single quoted text literals will
be converted to uppercase before being passed.
Double quotation mark Specify text literal values. The enclosed text is not
(") converted to uppercase.
Ellipsis (...) Used when a token or set of tokens can be repeated.
These tokens are numbered to indicate which tokens are
considered as a set. The token explanation will refer to
these repeatable sets as <token>*. One example is the
CELL_DETAILS function. This function can take multiple
pairs of keywords and variables to store data into. These
are listed as <detail_key*> and <detail_value*>.
Example: <flag> = CELL_DETAILS(<address> [, 'NO_CONVERT
'], '<detail_key0> ', <detail_value0>, '<detail_key1> ',
<detail_value1>, ...)
Argument Sets
Within the expert system language, there are sets of arguments that recur in the
same pattern across many functions. To simplify and shorten documentation, these
argument sets are described here one time as follows, and then referenced later
where appropriate:
{ROTATION}
Many functions operate in the local space of the rule file and require
a transformation to or from the global space. The
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-5
5 Parametric Modeling Functions
Introduction
Token Data
Token Type Meaning
Name Type
ANGLE keyword (none) Use the following three angles
as Euler angles to specify a
change in orientation.
alpha variable or REAL Euler angle rotation about the
value Z axis
beta variable or REAL Euler angle rotation about the
value X axis
gamma variable or REAL Euler angle rotation about the
value Z axis
MATRIX keyword (none) Use the following matrix to
specify a change in
orientation.
rot_matrix variable or Matrix Rotation matrix
value
5-6 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Explanation of Syntax
Token
Token Type Data Type Meaning
Name
OFFSET keyword (none) Use the following three
numbers as offset
increments to shift the
origin along the axes as
specified.
deltaX variable or INT or Offset along X axis.
value REAL
deltaY variable or INT or Offset along X axis.
value REAL
deltaZ variable or INT or Offset along X axis.
value REAL
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-7
5 Parametric Modeling Functions
Introduction
5-8 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Explanation of Syntax
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-9
5 Parametric Modeling Functions
Introduction
5-10 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Explanation of Syntax
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-11
5 Parametric Modeling Functions
Introduction
5-12 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Introduction to Geometric Principles
The primitive can first be rotated and then translated (that is, by using a rotation
keyword before the offset keyword), or translated and then rotated. All actions
occur about the local origin.
The order of the vectors is important (for example, X by Y does not equal Y by
X).
Rotation
Rotation by Euler angles requires three angles commonly called alpha, beta, and
gamma. These angles represent rotations about the axes in the following order: Z,
X, followed by Z again.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-13
5 Parametric Modeling Functions
Introduction to Geometric Principles
Euler Angles
For details on the operation of Euler angles, see Examples later in this section.
Matrixes
Rotation by matrix requires either an array variable with nine values or nine
individual values.
To rotate the primitive about the local Z axis, define the matrix as:
cos -sin 0
sin cos 0
0 0 1
where is the angle of rotation.
To rotate the primitive about the local X axis, define the matrix as:
1 0 0
0 cos -sin
0 sin cos
where is the angle of rotation.
To rotate the primitive about the local Y axis, define the matrix as:
cos 0 sin
0 1 0
-sin 0 cos
where is the angle of rotation.
5-14 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Rotation
See the following examples for details on the usage of matrixes and the MATRIX
function for matrix features available in the Design Series. The MATRIX function
also includes an example of transformation matrixes, which allow for the scaling of
graphics.
Example 1
The following example rotates the graphic 90 degrees about the Z axis.
Euler Angles: (90,0,0)
Matrix:
0 -1 0
1 0 0
0 0 1.
Example 2
The following example rotates the graphic 90 degrees about the X axis and relocates
the local coordinate system.
Euler Angles: (0,90,0)
Matrix:
1 0 0
0 0 -1
0 1 0
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-15
5 Parametric Modeling Functions
Introduction to Geometric Principles
Example 3
The following example rotates a primitive 90 degrees about the Z axis, 90 degrees
about the X axis, and then 90 degrees about the Z axis again, resulting in a new local
coordinate system.
Euler Angles: (90,90,90)
Matrix:
0 0 1
0 -1 0
1 0 0
The following diagram shows the global coordinate system of the primitive. The
local and the global coordinate systems are the same because no rotations have
taken place.
5-16 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Rotation
The first rotation of 90 degrees will be executed about the Z axis. After the first
rotation in the following diagram, the local X axis is in the place of the global Y axis
(same as orientation in the first diagram). This orientation is the new local system
for the primitive.
The second rotation will be executed about the local X axis. In the following
diagram, the new Y and Z axes reflect the system's rotation about the X axis.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-17
5 Parametric Modeling Functions
Introduction to Geometric Principles
The final rotation will be performed about the new local Z axis (global X axis). The
following diagram shows the final orientation of the primitive and its local
coordinate system after three successive rotations.
Example 4
In the following example, the two different definitions produce the same result,
because both specify rotations about the Z axis. Gamma is useful only if the local
axes have been re-oriented by previous rotation(s) leaving the local Z axis in a new
position.
Euler Angles (90,0,0) or (0,0,90)
Matrix
0 -1 0
1 0 0
0 0 1
Direction Cosines
5-18 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Rotation
0 0 1
The local X axis is aligned with the global Z axis and the direction
cosines are (0,0,1).
The local Y axis is aligned with the negative global Y axis and the
direction cosines are (0,-1,0).
The local Z axis is aligned with the global X axis and its direction
cosines are (1,0,0)
(The global coordinate system is shown in the diagram Primitive before Rotation on
page 5-16.)
Therefore, the orientation of any cell is determined by its matrix. For example, given
the following matrix of direction cosines:
0 0 1
0 1 0
1 0 0
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-19
5 Parametric Modeling Functions
Introduction to Geometric Principles
Alternatively, the rotation matrix for a primitive can be established if its desired final
orientation is known. If a primitive is to assume the following orientation:
Orientation Example
Therefore:
Offset
The keyword and arguments:
'OFFSET ', <delta x, delta y, delta z>
specify the location of a local origin relative to the global origin in the design space.
These axial offsets are along the global axes.
5-20 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Sample Rule File
The following diagram shows a rectangular prism with dimensions X=1, Y=2 and
Z=3 that has been:
The primitive origin is now offset from the design space origin, as shown:
PRIM( 'CUBE ', 'OFFSET ', 1,3,1, 1,2,3)
Offset Example
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-21
5 Parametric Modeling Functions
Sample Rule File
At the top of the file, the variable names for flags, steps, label, and physical data are
defined by the type and name along with optional descriptions.
!Procedural variables
INT step[2]; ! used to order execution
INT -flag[2]; ! used to order non-step function calls
! note use of 'always confirm ' option, '- ',
to aid
! in debugging. remove this option when
done.
!Local variables
TEXT tLabel ! store the built label here for the cell
!Computed variables
REAL rRodLen, rRodMinrRodMatLen, rRodMat[9];
5-22 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Sample Rule File
This is the first rule fired, the starting point. The expert system begins by checking
to see if step[0] has been assigned a value. It has not, so the inference engine finds a
rule that assigns a value to step[0] in the conclusion. When a rule is found (Rule B),
the inference engine checks if the premise can be satisfied before it runs the rule.
Since our Rule B has no premise, it is automatically TRUE and executes, setting a
value for step[0]. This value is the sum of the return values from the MESSAGE
function that wrote "CREATING ROD PART 5000" in the status field of the
MicroStation message screen and of the INHERIT function that passed data in
from the rule that called this one.
! Get inherited parameters
Rule (RULE) THEN step[0] = MESSAGE( 'ST ', 'creating rod part 5000 ')
B
+ INHERIT( 'rRodPt1, rRodPt2, rRodDia ')
Although the next rule defined in the file is for flag[0], it is not run immediately.
When the expert system has set step[0], it tries to set a value for step[1]. The
first rule to assign a value for step[1] is Rule D. Rule D uses flag[0] in it's
premise so the expert system looks for a rule to assign a value to flag[0], thus
finding and running Rule C.
This rule builds a label using the BUILD_LABEL function with a BUD_TYPE of
'HGRPT_BP5000'. The prompt_off keyword indicates that the user will not be
requested to input data into the label. The data is forced into the label by using pairs
of attribute names and their corresponding values, as a result of using the
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-23
5 Parametric Modeling Functions
Sample Rule File
force_att keyword. For example, cat_num is set to the value BP5000 and
part_id is set to a character representation of the number contained in
rRodDia.
! Create label for part cell
Rule
(RULE) THEN flag[0] = BUILD_LABEL( 'hgrpt_bp5000 ', 'tLabel ',
C
'prompt_off ', 'force_att ', 'cat_num ', 'bp5000 ',
'part_id ',
This rule is an error check to confirm that the label was built. If the Rule C call to
BUILD_LABEL succeeded, flag[0] will have a value of 1 or more. If the label
building failed, this rule would detect this condition and write two messages:
The CONTROL function then aborts processing and writes the message: 'LABEL
FAILED ' in the error message field.
! Build part if label is good
Rule (RULE) IF flag[0] < 1 THEN step[1] =
D
MESSAGE( 'ms ', 'error creating rod part 5000 ',
'PR ', 'check the hgrpt database ')
If Rule D's premise was not met, the inference engine will look at the next rule to set
step[1]. This search is conducted in the order that the rules are defined. If the
expert system is examining Rule E, the premise of Rule D must have failed, so we
know that flag[0] is not less than 1 and it is not necessary to repeat this
condition. However, explicitly stating all conditions for a rule premise is a good self-
documenting practice for your rules and can serve as a check on your logic. Rule E
uses both the flag[0] condition and checks for logic errors using a new
condition involving rRodMinLen.
(RULE) IF flag[0] = 1 and rRodLen < rRodMinLen
Rule THEN step[1] = MESSAGE( 'ms ', 'error creating rod part
E
5000 ')
5-24 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Sample Rule File
Finally, if the premises of the first two rules (D & E) for setting step[1] have not
been met, the inference engine will attempt Rule F. This rule has no explicit premise,
but implicitly requires that flag[0] is not less than 1 and that rRodLen >=
rRodMinLen. This rule demonstrates the principle explained in the Rule E
description.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-25
5 Parametric Modeling Functions
Quick Lookup by Function Name
5-26 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Quick Lookup by Function Name
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-27
5 Parametric Modeling Functions
Quick Lookup by Function Name
5-28 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
Former Function Names
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-29
5 Parametric Modeling Functions
Functions
Functions
ABS
This function returns the absolute value of its argument, which is a numeric
expression of data type INT or REAL. The absolute value is the sign independent
value of the argument.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<abs_num> = ABS(<number>)
Token
Token Type Data Type Meaning
Name
number variable or REAL Number to absolute value
value
abs_num return INT or Absolute value of
REAL <number>
ABS_POINT
This function expresses the coordinates of a point in the present system of
coordinates in the next higher level of nesting, or transforms a point in the local
coordinate system to the coordinate system of the calling rule. This function is
useful in creating nested objects in which coordinates of points in the child object
are needed for use in the parent object.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-30 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
ACOS
Syntax
<trans_point> = ABS_POINT([ 'MATRIX ', <rot_matrix>,] <point>)
Data
Token Name Token Type Meaning
Type
rot_matrix variable or Matrix Rotation matrix to apply
value
point variable or Point Local point to convert
value
trans_point return Point Transformed point
Example
Whenever the coordinates of a point are returned to a higher level rule, the
ABS_POINT function should be used to transform the point to that coordinate
system. In the following example, a point PNT is defined and then returned to the
parent rule.
(RULE) THEN PNT = ABS_POINT(0,0,P2)
(RULE) THEN RETURN(PNT)
ACOS
This function returns the inverse function for the cosine of an angle. It takes one
argument, a numeric expression.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<angle> = ACOS(<angle_cos>)
Token Data
Token Type Meaning
Name Type
angle_cos variable or REAL Cosine of an angle
value
angle return REAL Angle in degrees whose cosine
is <angle_cos>
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-31
5 Parametric Modeling Functions
Functions
ADOPT
This function assumes that an assignment has not already been made to the variable
on the current level. This function loads each variable listed in its argument string,
which has not yet otherwise been assigned a value, with the value returned from a
lower set of rules using the RETURN function. The argument list for this function
need not completely duplicate the argument list of the corresponding RETURN
function. The list must not be longer than the number of returned values. The list
can be terminated at any place but no values can be skipped between the starting
and terminating values. Therefore variables that need the values returned from lower
functions to proceed must be specified at the beginning of the list. Variables that can
be evaluated locally if not returned from the lower functions should be placed later
in the list for flexibility.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Syntax
<flag> = ADOPT( '<variables> ')
Example
In the following example, the ADOPT function retrieves values from a lower-level
rule for the variables DIAM and SIZE. The lower rule must have used the
RETURN function to return values to these variables.
ADOPT( 'DIAM, SIZE ')
ASIN
This function returns the inverse function for the sine of an angle. It takes one
argument, a numeric expression.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-32 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
ATAN
Syntax
<angle> = ASIN(<angle_sin>)
Data
Token Name Token Type Meaning
Type
angle_sin variable or REAL Sine of an angle
value
angle return REAL angle, in degrees, whose sine
is <angle_sin>
ATAN
This function returns the inverse function for the tangent of an angle. It takes one
argument, a numeric expression.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<angle> = ATAN(<angle_tan>)
Data
Token Name Token Type Meaning
Type
angle_tan variable or REAL Tangent of an angle
value
angle return REAL Angle in degrees whose
tangent is <angle_tan>
ATTRIBUTE_INFO
This function reads the ATTRDEFN table of the project database to retrieve
information about the attributes of a Design Series component type. The
information available is not a value specific to a component, but to all components
of that type. For example, this function can get the number of decimal places of the
SIZE_1 attribute of a fitting, but cannot get the value for SIZE_1. Use the
PARSE_LABEL function to read values for a specific component.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-33
5 Parametric Modeling Functions
Functions
Syntax
<attr_string> = ATTRIBUTE_INFO(<bud_type> | '<label> ',
<attr_name>, '<attr_key> ')
Data
Token Name Token Type Meaning
Type
bud_type variable or TEXT Name of BUD type to
value retrieve information for
label variable name TEXT Design Series label for the
component to retrieve
information from
attr_name variable or TEXT Attribute to retrieve
value information for
attr_key keyword (none) One of the keywords (in the
following table) to indicate
what information is
requested for the
<attr_name> attribute
attr_string return TEXT Value of the attribute
characteristic
5-34 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
ATTRIBUTE_INFO
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-35
5 Parametric Modeling Functions
Functions
Example 1
In the following rule, the ATTRIBUTE_INFO function is used to set TYPE_VAL
to the data type of the diameter attribute of the component identified by the Design
Series label stored in LABEL1.
(RULE) THEN TYPE_VAL = ATTRIBUTE_INFO( 'LABEL1 ', 'DIAMETER ',
'DATA_TYPE ')
Example 2
In the following rule, the ATTRIBUTE_INFO function returns the label position
of the SIZE_1 attribute of the PIPE_PBRN component type. This value is
returned as a string, despite its numeric value. Use CHAR_TO_REAL or
CHAR_TO_NUM to convert this string to a numeric value.
(RULE) THEN POSITION = ATTRIBUTE_INFO( 'HVAC_HVDC ', 'ANGLE ',
'LABEL_POS ')
BUD
This function creates a parametrically modeled Basic Unit of Design (BUD) by
using expert system rules. A BUD can be a BUD cell or a rule that calls another
BUD function to actually create the BUD. The BUD function can call other BUD
5-36 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
BUD
functions and can be used recursively, that is, a rule can call itself (as shown in
Example 3 at the end of this topic).
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Syntax
<flag> = BUD('<bud_type> | <rule_name> [, [<subcode1>],
[<subcode2>], [<product>], [<application>]]', [{ROTATION},]
[{POSITION},] ['LIST', <variable0> [, <variable1>] [,...]])
Data
Token Name Token Type Meaning
Type
bud_type value TEXT Name of the class to identify
the rule (explained in the
following section)
rule_name value TEXT Name of the specific rule to
run (explained in the
following section)
subcode1 value TEXT Matches to
EXPERT_RULES
(explained in the following
section)
subcode2 value TEXT Matches to
EXPERT_RULES
(explained in the following
section)
product value TEXT Design Series product class:
PIPE, CONC, and so on
(explained in the following
section)
application value TEXTDefaults to PSDS unless
otherwise specified here
{ROTATION} (See the argument set for {ROTATION} on page 5-5.)
{POSITION} (See the argument set for {POSITION}on page 5-6.)
LIST keyword (none) Precedes the list of variables
to be passed to the BUD rule
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-37
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
variable* variable or (varies) Variables to be passed to the
value BUD rule for inheritance.
The list of variables must
agree in order and data type
(including array dimensions)
with the list to be inherited,
although the names can be
different. The number of
variables in either list can be
shorter or longer than the
corresponding list, but no
arguments can be skipped.
Therefore, those variables
that must be passed and
inherited must be specified
first in the lists.
flag return INT 1 for success or 0 for failure
First, the bud_type argument is used to search the BUD_TYPE column of the
CLASSES table. If a match is found, the product name is set to the value of the
LEVEL_1 column of the CLASSES table unless a product name was supplied with
the bud_name argument. The application name is set to 'PSDS' by the expert
system unless an application name was supplied with the bud_type argument.
The LEVEL_* columns of the CLASSES table are used to select the applicable
label attributes from the ATTRDEFN table. These attributes are loaded into the
expert system and used within the rules just like any other expert system variable
declared in the rule file (of course, the rules themselves must not declare variables of
the same names). If the BUD_RULE in the CLASSES table is not NULL,
RULE_NAME is set to this value. Otherwise, RULE_NAME is set to the
bud_type.
On the other hand, if the bud_type is not found in the BUD_TYPE column of
the CLASSES table, then RULE_NAME is directly set to the bud_type. The
5-38 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
BUD
subcodes, product name, and application name are set as specified with the
bud_type argument. For those arguments that are not supplied, only the
application name is automatically set by the expert system.
bud_rule
level_1 level_2 level_3 level_4 level_5 bud_type bud_table database comptype
s
PIPE PGKT PIPE_PGKT PIPE_BUD GASKET PIPE PGKT
Example 2
In the following example, the BUD function call creates a gasket. Because the
'PIPE_PGKT' name does indeed match a BUD_TYPE in the CLASSES table, this
is a BUD_TYPE and not a RULE_NAME. If the configuration variable PS_RULES
is not defined, then the expert system extracts the rules from the EXPERT_RULES
table where RULE_NAME = 'GASKET' (from the BUD_RULES column of
CLASSES), SUBCODE1 and SUBCODE2 are NULL, PRODUCT = 'PIPE' (from
the $PRODUCT directive), and APPLICATION = 'PSDS' (from the expert system
default). If PS_RULES is defined, then the rules are read from the text file,
PS_RULES:GASKET.R. In either case, the BUD will be transformed using the
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-39
5 Parametric Modeling Functions
Functions
matb matrix and offset by a,b,c + h relative to the orientation of the BUD
function in its creation space. The variables gasketlbl and pl_code are
supplied to the BUD rules for use as appropriate.
$PRODUCT = 'PIPE'
BUD('PIPE_GASKET', 'MATRIX',matb, 'OFFSET',a,b,c + h,
'LIST', gasketlbl,pl_code)
Example 3
The following example shows how recursive function calls can be used to create
cable tray with a maximum fixed length.
INT step[5];
INT remaining_length; ! remaining length of tray
routing
INT section_length; ! max length of a tray section
INT current_length; ! current tray length
char label;
! Inherit the label, the remaining routing length, and the
maximum
! length of a tray section
(RULE) THEN step[0] = inherit( label, remaining_length,
section_length )
5-40 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
BUILD_LABEL
BUILD_LABEL
This function is used to build the Design Series label for a component. All the
standard features of Design Series are incorporated including specification lookups
and matching. This function also silently builds the label (that is, without user
interaction), to force required values into specific attributes, and to present default
values to the user that are different from the default value normally returned from
the Design Series-serving database.
If a forced, default or matching attribute value cannot be used (for example, because
it cannot be validated or because it is too long for the current label field, and so on),
an error is displayed. In the case of a default attribute, you can continue label
creation. An error loading a forced attribute causes a fatal error. If the value
provided for a default or forcing attribute is actually a blank string, the attribute
name and its value argument are ignored. This feature allows the rules for
components called as subroutines to include forced and default attribute-value pairs
in the BUILD_LABEL function call where the values are normally inherited from
the calling routine. However, if the calling routine did not actually supply some or all
of these values, the BUILD_LABEL function acts as if these attributes were not
even listed in the function call.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-41
5 Parametric Modeling Functions
Functions
Syntax
<flag> = BUILD_LABEL(<bud_type>, '<new>' [,'MATCH', <base>]
[,'PROMPT_OFF' |'PROMPT_ON' [,'STATUS_FLD', <message>]]
[,'ERROR_ABORT'|'ERROR_CONTINUE'] [,'DEFAULT_ATT',
<attr_name_value0>|[<attr_name0>, <attr_value0>],
<attr_name_value1>|[<attr_name1>, <attr_value1>], [...]]
[,'FORCE_ATT', <attr_name_value2>|[<attr_name2>,
<attr_value2>], <attr_name_value3>| [<attr_name3>,
<attr_value3>], [...]])
Data
Token Name Token Type Meaning
Type
bud_type variable or TEXT BUD type of label to
value create
new variable name TEXT New label
MATCH keyword (none) Use the following label as
a basis for the new label.
This keyword is ignored if
the following text string is
empty.
base variable or TEXT Label to use as basis
value
PROMPT_OFF keyword (none) Turn off user prompting.
PROMPT_ON keyword (none) Turn on user prompting.
STATUS_FLD keyword (none) Display the following
prompt to the user if
prompting is enabled.
message variable or TEXT Prompt to display
value
ERROR_ABORT keyword (none) Force the expert system
to abort on error
detection.
ERROR_CONTINUE keyword (none) Ignore errors. The
function returns the value
1 for success.
5-42 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
BUILD_LABEL
Data
Token Name Token Type Meaning
Type
DEFAULT_ATT keyword (none) Use the following name-
value paired data to set
default values for named
attributes. One or more
pairs are possible.
Interpretation of pairs
ends at 'FORCE_ATT' or
function end.
attr_name_value* variable or TEXT Name and comma-
value separated or space-
separated value. Use
'%NULL%' to force a
blank value
attr_name* variable or TEXT Name of attribute to
value which to assign the
following value
attr_value* variable or (varies) Value to assign to the
value preceding named
attribute. Use '%NULL%'
to force a blank value.
FORCE_ATT keyword (none) Use the following name-
value paired data to force
values for named
attributes. One or more
pairs are possible.
Interpretation of pairs
ends at function end.
flag return INT 1 for success or 0 for
failure
Example
The following example creates a label having the BUD type 'pipe_brn' and a label
name 'label'. The created label attributes will initially MATCH those in the label
"matching_label". The 'FORCE_ATT' keyword causes size_1 to be set to 6.0,
and conn_1 to be set to BW. The 'DEFAULT_ATT' keyword also sets the default
values for the attributes lineno, system and spec.
(RULE) THEN flag = BUILD_LABEL('pipe_pbrn','label',
'MATCH', matching_label,
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-43
5 Parametric Modeling Functions
Functions
'DEFAULT_ATT',
'lineno', '010',
'system %NULL%',
'spec', '%NULL%',
'FORCE_ATTv,
'size_1', '6.0',
'conn_1, BW')
CELL
The function creates a MicroStation cell using a standard frame for cells. A standard
frame for cells consists of any or all of the following: cell header, a text element
containing a Design Series label, and connect point(s). The contents of the cell
depend on the set of arguments passed to this function.
The CELL function must always be called in pairs. The first CELL function call
marks the start of the cell and the second call marks the end of the cell. The CELL
function can be called as many times as needed within a single level of rules. Cells
can be nested up to six levels deep.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Token Data
Token Type Meaning
Name Type
START keyword (none) Indicate that this CELL call is
the start of a cell.
cell_name variable or TEXT Name of the cell
value
5-44 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CELL
Token Data
Token Type Meaning
Name Type
NAME keyword (none) Use the following string as a
marker to allow the later
insertion of a label using
INSERT_LABEL.
marker value TEXT Marker to use for later
insertion of the label using
INSERT_LABEL
LABEL keyword (none) Insert the following label into
this cell. You can build a label
by using the BUILD_LABEL
function.
label variable or TEXT Label to insert into cell
value
NOLABEL keyword (none) Do not place a label in this
cell.
SNAP keyword (none) Indicate that the following
data should be used to place
connect points in this cell.
num_snaps variable or INT Number of connect points to
value follow
snap* variable or Point Connect point coordinates.
value You can have multiple points
defined, but by convention,
the first point should be the
cell origin at local coordinates
(0,0,0).
flag return INT 1 for success or 0 for failure
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-45
5 Parametric Modeling Functions
Functions
Token
Token Type Data Type Meaning
Name
END keyword (none) Indicate that this CELL call is
the end of a cell. This call must
end cell construction before a
call to RETURN.
NORM keyword (none) Use the following three scale
factors to scale the rotation
matrix of the cell so that the
cell will simulate a cell that has
been taken from a cell library.
scaleX variable or INT or X axis scale
value REAL
scaleY variable or INT or Y axis scale
value REAL
scaleZ variable or INT or Z axis scale
value REAL
flag return INT 1 for success or 0 for failure
Example 1
The following example creates the cell TANK1 with no label or connect points.
(RULE) THEN step[0] CELL('START', 'TANK1', 'NOLABEL')
...
(RULE) THEN step[1] CELL('END')
Example 2
The following example creates the cell TANK1 with a default label and two connect
points, the first at the point of origin and the second at the point (100,0,0) of the
local (cell) system of coordinates.
INT snap2[3] = {100,0,0};
(RULE) THEN step[0] CELL('START','TANK1','SNAP',2, 0,0,0, snap2)
...
(RULE) THEN step[1] = CELL('END')
5-46 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CELL_DETAILS
Example 3
The following example creates the cell 'BEAM' with two connect points, the first at
the origin and the second at the point (100,0,0) of the local (cell) system of
coordinates. Because it is desirable that this cell be the same as that taken from the
cell library where the initial sizes are 1 sub-unit by 1 sub-unit by 1 sub-unit, it is
normalized or scaled to the proper size. (See the section on "Working Units" in the
MicroStation User's Guide.)
(RULE) THEN step[0] CELL('START','BEAM','SNAP',2,0,0,0,100,0,0)
...
(RULE) THEN step[1] CELL('END','NORM',1,1,1)
Example 4
The following example creates the cell 'CLEVIS' with one connect point at the
origin. The cell is given the label contained in the 'label' text variable.
text label[1,80] text
...
(RULE) THEN step[0] CELL('START', 'CLEVIS', 'LABEL', label,
'SNAP', 1, 0,0,0)
...
(RULE) THEN step[1] CELL('END')
CELL_DETAILS
This function is used to retrieve details of a selected cell for later use within the
expert system rules.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-47
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
address variable or INT[3] Block, byte, and file number
value of cell to examine. Use
SELECT_CELL to get this
address data.
NO_CONVERT keyword (none) Prevent the expert system
from performing coordinate
conversions.
Note: Data, depending on
its type, is either:
Returned as it is read from
the design file (for
example, text weight,
global range)
Adjusted to reflect the way
that the Design Series
modeling system maintains
certain data (that is,
adjusting the origin,
connect points, local
range, and so on to reflect
the UOR conversion value
and, if appropriate, the
local Design Series system
coordinates).
This adjustment can be
prevented by including the
'NO_CONVERT' keyword
following the address data.
detail_key* keyword (none) One of the keywords (in the
Keyword Table that follows)
to indicate what data should
be stored in the next variable.
Multiple details can be
requested.
5-48 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CELL_DETAILS
Data
Token Name Token Type Meaning
Type
detail_value* variable name varies Store detail specified by the
preceding keyword. Data
type is based on the
Keyword Table that follows.
flag return INT 1 for success or 0 for failure
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-49
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
address variable or INT[3] Block, byte, and file number
value of cell to examine. Use
SELECT_CELL to get this
address data.
NO_CONVERT keyword (none) Prevent the expert system
from performing coordinate
conversions.
Note: Data, depending on
its type, is either:
Returned as it is read from
the design file (for
example, text weight,
global range)
Adjusted to reflect the way
that the Design Series
modeling system maintains
certain data (that is,
adjusting the origin,
connect points, local
range, and so on to reflect
the UOR conversion value
and, if appropriate, the
local Design Series system
coordinates).
This adjustment can be
prevented by including the
'NO_CONVERT' keyword
following the address data.
detail_key keyword (none) One of the keywords (in the
Keyword Table that follows)
to indicate what data should
be returned by the function
detail_value return (varies) Detail specified by
<detail_key>. Data type is
based on the Keyword Table
that follows.
5-50 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CELL_DETAILS
Example 1
The following example uses the cell address array addr obtained by using the
SELECT_CELL function and places the values corresponding to the keywords into
the variable that follows each keyword. A value is returned to the flag variable
indicating failure or success.
INT addr[3];
(RULE) THEN flag =
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-51
5 Parametric Modeling Functions
Functions
CELL_DETAILS(addr,
'TMATRIX', 'tmatrix',
'NTMATRIX', 'ntmatrix',
'SCALE_FACTORS', 'scale_factors',
'ORIGIN', 'origin',
'SNAP_POINTS', 'snap_points',
'SNAP_POINTS(1)','snap_point1',
'SNAP_POINTS(2)','snap_point2',
'GLOBAL_RANGE', 'global_range',
'LOCAL_RANGE', 'local_range',
'CELL_NAME', 'cell_name',
'GRAPHIC_GROUP', 'graphic_group',
'TEXT_COLOR', 'text_color',
'TEXT_LEVEL', 'text_level',
'TEXT_WEIGHT', 'text_weight',
'SNAP_COLOR', 'snap_color',
'SNAP_LEVEL', 'snap_level',
'SNAP_WEIGHT', 'snap_weight',
Example 2
In the following example, this rule obtains the TMATRIX from the cell identified by
its address addr.
(RULE) THEN tmatrix = CELL_DETAILS(addr, 'TMATRIX')
Example 3
In the following example, this rule returns the coordinates of the first connect point
of the cell without UOR (units of resolution in MicroStation) conversion to the
variable actual_snap_point1.
(RULE) THEN actual_snap_point1 =
CELL_DETAILS(addr[0],addr[1],addr[2],
'NO_CONVERT', 'SNAP_POINTS(1)')
5-52 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CHANGE
Example 4
In the following example, this rule obtains the total number of connect points
contained in the cell, identified by the address array addr, and returns it to the
variable num_snaps.
(RULE) THEN num_snaps = CELL_DETAILS(addr,
'NUM_SNAP_PTS')
CHANGE
Customarily, a monotonic expert system does not allow the value of a variable to be
changed after its original assignment. This function assigns a new value to a
previously assigned variable, thereby overriding the previous value. This feature can
be useful in looping constructs within the rules (for example, as a loop counter).
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Data
Token Name Token Type Meaning
Type
INCR keyword (none) Increment <variable>
by <change>
DECR keyword (none) Decrement <variable>
by <change>
TO keyword (none) Set <variable> to
<change>
variable variable name (varies) Unquoted name of variable
to modify
change variable or (varies) Value to use in modification
value
flag return INT 1 for success or 0 for failure
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-53
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
TO_ARRAY keyword (none) Starting at <array>[0], set
the next
<num_to_change>
elements to the values in
<change0>,
<change1>, ...
array variable name (varies) Name of array to modify
num_to_change variable or INT Number of elements to be
value changed, beginning with the
first element, <array>[0],
and proceeding sequentially
through the array elements.
The maximum value is 60.
change* variable or (varies) Variable or list of variables
value whose values will replace
elements of the array. The
list can contain singular
variables, array elements,
arrays, and expressions. Only
the number of elements
specified by the third
argument will be changed. If
the list contains more values
than this number, they are
ignored.
flag return INT 1 for success or 0 for failure
Example 1
In the following example, the contents of text_string are replaced with a new
text string.
CHANGE('TO', text_string, 'This is the new value')
5-54 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CHAR_TO_INT (formerly CHAR$INT)
Example 2
In the following example, the current value contained in the variable
loop_counter is incremented by 2.
CHANGE('INCR', loop_counter, 2)
Example 3
The following example shows a segment of a program where the coordinates of
three consecutive vertices of a line string, stored into a large array, are written into
three separate points, each point a coordinate array. It is easier to work with the
points c1_sp, c2_sp and c3_sp than with the ls_sp array.
! Obtain vertices for lines
(RULE) IF i < n - 1 THEN step[13] ! Not last point to
process
= change('TO_ARRAY','c1_sp',3, ls_sp[(i)*3],
ls_sp[(i)*3+1], ls_sp[(i)*3+2]+off_z)
+ change('TO_ARRAY','c2_sp',3, ls_sp[(i+1)*3],
ls_sp[(i+1)*3+1], ls_sp[(i+1)*3+2]+off_z)
+ change('TO_ARRAY','c3_sp', 3, ls_sp[(i+2)*3],
ls_sp[(i+2)*3+1], ls_sp[(i+2)*3+2]+off_z)
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-55
5 Parametric Modeling Functions
Functions
Syntax
<number> = CHAR_TO_INT(<int_string>)
Data
Token Name Token Type Meaning
Type
int_string variable or TEXT String containing leading
value numeric characters
number return INT Integer represented in string
Example
The following examples return the integer 123.
TEXT tFloatString = "123.45"
CHAR_TO_INT('123')
CHAR_TO_INT(tFloatString)
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-56 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CLEAR
Syntax
<number> = CHAR_TO_REAL(<real_string>)
Data
Token Name Token Type Meaning
Type
real_string variable or TEXT String containing leading
value numeric characters or a
decimal point
number return REAL Real number represented in
string
Example
The following example returns real numbers.
TEXT tFloatString = "123.45";
CHAR_TO_REAL('123')
CHAR_TO_REAL(tFloatString)
CLEAR
Normally, during the execution of a set of rules in a backward chaining expert
system, variables retain their values until the goal is returned and the entire system
of variables is cleared. This function clears the value of a variable during the
evaluation of a set of variables, before the conclusion of the reasoning. This function
can be used to simulate a GOTO command.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-57
5 Parametric Modeling Functions
Functions
Syntax
<flag> = CLEAR('<variables>')
Data
Token Name Token Type Meaning
Type
variables variable name (varies) List of names of variables to
clear
flag return INT 1 for success or 0 for failure
Example
In the following example, the CLEAR function clears the step[n] variables
(where n equals the step number) causing the expert system to repeatedly process
those steps until the loop has been traversed n times.
! Looping Example using CLEAR and CHANGE functions
INT i=0; ! Incremented variable
INT n=3; ! Maximum times through loop
! Loop through step[1] and step[2] n times
! If counter (i) equals our goal (n), exit loop
(RULE) IF i = n THEN step[0] = 1 and step[1] = 1 and step[2]
= 1
! Else loop through
(RULE) THEN step[0] = 1
! Increment i by 1
(RULE) THEN step[1] = CHANGE('incr',i,1)
! Loop back to step[0]
(RULE) THEN step[2] = CLEAR('step[0],step[1],step[2]')
COLLECT
Normally, the expert system evaluates variables in an order determined by backward
chaining principles. The COLLECT function circumvents this evaluation order,
allowing variables to be evaluated before the usual reasoning begins. Therefore the
COLLECT function should be called before the start of the usual reasoning. The
COLLECT function processes both scalar and array variables. Individual array
5-58 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CONTROL
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<flag> = COLLECT('<variables>')
Data
Token Name Token Type Meaning
Type
variables variable name (varies) List of names of variables to
evaluate
flag return INT 1 for success or 0 for failure
Example
The following example causes the expert system to evaluate the variables X, Y, all
elements of rot_matrix, the single element S[5], and Z.
REAL X, Y, Z, rot_matrix[9];
INT S[10]
(RULE) THEN COLLECT('X,Y, rot_matrix,S[5],Z')
CONTROL
This function changes special characteristics and controls internal processes.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-59
5 Parametric Modeling Functions
Functions
Syntax
<flag> = CONTROL([, 'DYNAMIC_ON'] [,'HOLE'|'NOHOLE'] [,'RUL_LIN']
[,'SNAP'|'NOSNAP'] [,<control_key0>, <control_value0>]
[,<control_key1>, <control_value1>] [, ...])
Token Data
Token Name Meaning
Type Type
DYNAMIC_ON keyword (none) Set flag to dynamically place
components into the design
file. The default is OFF. This
has the same effect as the
$DYNAMIC_ON directive.
5-60 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
CONTROL
Token Data
Token Name Meaning
Type Type
control_value* variable varies Store feature setting specified
name by the preceding keyword.
Data type is based on the
Keyword Table that follows.
flag return INT If a storage location is
supplied, 1 for success or 0
for failure
If no storage location is
supplied, the single piece of
data requested
Control Data
Description
Keyword Type
COLOR INT Use specified color for all elements that follow.
CLASS INT Use specified class for all elements that follow.
DEBUG INT Use binary mask to set the level of rules from
which debugging statements, using the MESSAGE
function, will be displayed. The binary bit
positions represent the debug levels. For example
the integer 7, represented in binary as 111, has
debug levels 0, 1, and 2 turned on. Debug message
statements can be left in the rule code and turned
on or off as is required by the programmers
debug strategy or use of the rule in production.
ERR TEXT Set the error_status to -935, which causes the
expert system to exit the current set of rules and
display the error message provided.
LABEL_LEV INT Use specified level for the cell label.
EL
LEVEL INT Use specified level for all elements that follow.
STYLE INT Use specified line style for all elements that follow.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-61
5 Parametric Modeling Functions
Functions
Control Data
Description
Keyword Type
TUTORIAL TEXT Activate the named tutorial cell from the named
cell library. If no library is named, the tutorial cell
is activated from the currently attached cell library.
The single text string argument should be
formatted as "cell_name, cell_library".
UORS INT Use this value as the Design Series UOR setting. If
this control parameter is not used, and a UOR
value is not included in the applicable database, a
default value of 8000 is used.
WEIGHT INT Use specified weight for all elements that follow.
SHIP_CELL TEXT Use the following keyword string to when cells are
shipped to MicroStation. This operation has the
same effect as the $SHIP_CELL directive. The
keyword string may be one of the following:
'DEFAULT' - Creates the cell when the
CELL('END') command is executed.
'CONTINUOUS' - Displays the cells as they are
created.
'ONE_TIME' - Shows the creation of the cells
within the rule all at once when the rule ends.
Example 1
In the following example, this function causes all the elements that follow, to be on
level 11 and to display messages to the user (that is, through the MESSAGE function
on page 5-82) where the debug level is set to 1 or 2.
CONTROL('LEVEL', 11, 'DEBUG', 6)
Example 2
In the following example, using SHIP_CELL may require changes to lower-level
rules that return coordinate data using the ABS_POINT function. To make lower-
level rules run correctly, you must call the RETURN function before calling the
CELL function with the 'end' option. Alternatively, force the expert system to make
the ABS_POINT function call occur before the CELL function. This is necessary
because when the cell is shipped, its coordinate system is destroyed and therefore
there is no data to properly compute the ABS_POINT based on that coordinate
system.
(RULE) THEN step[0] = CONTROL('DYNAMIC_ON')
(RULE) THEN step[0] = MESSAGE('CF',"Rectangular Line String")
5-62 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
COS
+ CONTROL('SHIP_CELL', 'continuous')
COS
This function returns the cosine of an angle argument. The argument may be a
numeric variable, expression, or constant and is measured in degrees.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<angle_cos> = COS(<angle>)
Token
Token Type Data Type Meaning
Name
angle variable or INT or Angle in degrees to take the
value REAL cosine of
angle_cos return REAL Cosine of <angle>
DELETE_COMP
This function deletes a component at a given address in a MicroStation DGN.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<flag> = DELETE_COMP(<address>)
Token Data
Token Type Meaning
Name Type
address variable or INT[3] Cell address as provided by
value SELECT_CELL
flag return INT 1 for success or 0 for failure
Example
The following example deletes the cell identified by the cell address addr.
DELETE_COMP(addr)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-63
5 Parametric Modeling Functions
Functions
ENDSURF
This function terminates a SURFACE function. It is required for each use of the
SURFACE function, to encompass all elements that create the surface. It updates
the SURFACE record and performs other actions required before a new surface can
be created.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Syntax
<flag> = ENDSURF('SURFACE'|'SOLID')
Token Data
Token Type Meaning
Name Type
SURFACE keyword (none) End surface construction
begun by last call to SURFACE
with keyword 'SURFACE'.
SOLID keyword (none) End solid construction begun
by last call to SURFACE with
keyword 'SOLID'.
flag return INT 1 for success or 0 for failure
Example
The following example shows the beginning and ending pair of instructions required
to generate a surface from a cube primitive. For a detailed example of surface
generation, see SURFACE on page 5-116.
(RULE) then step[3] = SURFACE('solid','proj')
+PRIM('CUBE', LX, LY, LZ)
...
+ENDSURF('solid')
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-64 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
EXTRACT_VALUE (formerly LABEL$VALU)
Syntax
<value> = EVALUATE(<filename>,<parameter>)
Data
Token Name Token Type Meaning
Type
filename variable or TEXT Name of configuration file in
value which to find the specified
parameter
parameter variable or TEXT Name of the parameter to
value evaluate
value return TEXT Value of the specified
configuration parameter
Example
The following example returns the value for the reference elevation from the project
definition file.
EVALUATE('projdef.rul','ref_elev')
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-65
5 Parametric Modeling Functions
Functions
Syntax
<attr_value> = EXTRACT_VALUE(<attr_name>)
Data
Token Name Token Type Meaning
Type
attr_name variable or TEXT Name of the label attribute,
value as defined in the label
definition table of the project
database, whose value is to
be returned
attr_value return (varies) Value of the requested
attribute. The data type
depends on the type of the
attribute requested. Leading
and trailing spaces are
trimmed.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-66 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
INHERIT
Syntax
<attr_value> = EXTRACT_VALUE2(<attr_name>)
Data
Token Name Token Type Meaning
Type
attr_name variable or TEXT Name of the label attribute,
value as defined in the label
definition table of the project
database, whose value is to
be returned
attr_value return (varies) Value of the requested
attribute. The data type
depends on the type of the
attribute requested. Leading
and trailing spaces are
trimmed.
INHERIT
This function can pass arguments from a calling set of rules to a set of sub-rules.
The mechanism of argument passing is similar to that in programming languages,
with one exception: if the calling set of rules does not pass down an equal number of
values, the unknown values will be obtained by the expert system from all other
available sources (local rules, local default values, or prompts to the user). The list of
values sent can be terminated at any place but no values can be skipped between the
starting and terminating value. Therefore, variables that must have their values
inherited from the calling list should be specified at the beginning of the list. The
INHERIT function should be placed at the very beginning of the active part of the
rules to ensure that the values are inherited and that the expert system is not forced
to evaluate the attributes locally.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-67
5 Parametric Modeling Functions
Functions
Syntax
<flag> = INHERIT('<variables>')
Token Data
Token Type Meaning
Name Type
variables variable name (varies) List of variable names to
retrieve values into. This list
must correspond in data type
(including array dimensions)
and order with the variables
specified in the LIST option
of the calling BUD function or
SUB function.
Example
In the following example, the values listed in an upper rule are placed into the
variables size, diam, and width for the currently active rule.
INHERIT('size, diam, width')
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-68 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
INSERT_LABEL (formerly TEXT_LAB)
Syntax
<flag> = INSERT_LABEL(<label> [, 'TOP'|'BOT'|'BEFORE'|'AFTER'] [,
<marker>])
Token Data
Token Type Meaning
Name Type
label variable or TEXT Variable containing the label to
value be inserted
TOP keyword (none) Place the label at the top of the
cell information sequence.
BOT keyword (none) Place the label at the bottom of
the cell information sequence.
BEFORE keyword (none) Place the label at the position just
before the following marker
name.
AFTER keyword (none) Place the label at the position just
after the following marker name.
marker variable or TEXT Marker name declared by CELL
value function
flag return Point 1 for success or 0 for failure
Example
In the following example, step[1] creates one cell of a composite of several cells
without giving it a label, but marks the position in the composite with
LABEL_MKR. Afterward information is collected and placed into the label
CELL_LABEL. step[5] then locates the marked cell and places the label
information into it.
For the cell to be a valid Design Series cell, the label must be placed at the top
or beginning of the cells information sequence.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-69
5 Parametric Modeling Functions
Functions
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<num_chars> = LEAD_CHARS(<string>)
Data
Token Name Token Type Meaning
Type
string variable or TEXT Text string
value
num_chars return INT Number of letters leading a
string. If the string does not
begin with any letters,
num_chars will be zero (0).
Example
The following example returns a count of 4 for leading letters.
LEAD_CHARS ('PSvr123')
LOAD_VALUE
This function changes the value of a Design Series label attribute after the label has
been created, or creates a new label based on information in the current active label.
This function is useful for loading the value of external attributes into the label. It is
also useful for creating the label for a secondary component from a primary
component. If a value cannot be loaded into a label for any reason (for example,
truncation or an error at spec lookup), a fatal error is generated.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-70 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
LOAD_VALUE
Syntax
<newlabel> = LOAD_VALUE('<label>' [, 'CREATE_NEW_LABEL'] [,
'NO_VALIDATE_LABEL'], <attr_name0>, <attr_value0>
[,<attr_name1>, <attr_value1>] [,...])
Data
Token Name Token Type Meaning
Type
label variable TEXT Unquoted name of label
variable in which to modify
values
CREATE_NEW_ keyword (none) Create a new label with the
LABEL current data. If this keyword
is not used, LOAD_VALUE
modifies an exact image of
the source label.
NO_VALIDATE_ keyword (none) Bypass the input method
LABEL checking to increase
performance. This keyword
can be used to create many
components from a database
where data has already been
verified.
attr_name* variable or TEXT Name of the attribute to
value modify with <attr_value*>
attr_value* variable or (varies) Value to change
value <attr_value*> to
newlabel return TEXT New or modified label
Example 1
The following example loads a 'Y' into the 'Override' attribute in the label.
LOAD_VALUE(label, 'Override', 'Y')
Example 2
The following example creates a new label from the source label, performs no input
method data checking, and loads the value of mem_grade into the 'grade'
attribute of the label.
LOAD_VALUE(newlabel,'CREATE_NEW_LABEL','NO_VALIDATE_LAB
EL',
'grade',memb_grade)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-71
5 Parametric Modeling Functions
Functions
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<local> = LOCAL_POINT([{ROTATION}][,{POSITION}], <current>)
Data
Token Name Token Type Meaning
Type
{ROTATION} (See the argument set for {ROTATION} on page 5-5.)
{POSITION} (See the argument set for {POSITION}on page 5-6.)
current variable or Point Point to transform from
value current coordinate system
local return Point Transformed point in local
coordinate system
Example
Whenever passing the coordinates of a point to a lower level rule, the
LOCAL_POINT function should be used to transform the point to that coordinate
system. In the following example, a point PNT is defined in preparation for a such a
call.
PNT = LOCAL_PT('MATRIX', plc_mat, 'OFFSET', snap0, 0, 0,
diam/2)
LOG
This function returns the natural (base e) log of a numeric expression.
5-72 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
LOG_FILE
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<natural_log> = LOG(<number>)
LOG_FILE
This function manages text log files for progress tracking or error messaging.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-73
5 Parametric Modeling Functions
Functions
Syntax
<flag> = LOG_FILE(<filename>, <message> [, <substitute0>] [,
<substitute1>] [,...])
Token Data
Token Type Meaning
Name Type
filename variable or TEXT Log file name. You can place
value this file in a particular directory
by using a Design Series path
variable as in
PS_TEMP:logfile.log. If no path is
specified, logfile.log will be
placed in the working directory
in which MicroStation is
running.
message variable or TEXT Message to write to the file. As
value part of the second argument,
you can include a $keyword.
The $keyword serves to open,
close, or delete the log file, as
explained in the $Keyword
Table that follows. If you do
not specify a $keyword, the
system appends the message at
the bottom of the named file
(created if it does not already
exist). The message can include
%a arguments in the manner of
the C-language printf text
formatting function to easily
insert values into the message.
The %a format argument
inserts values of any data type
and does not support additional
printf modifiers such as length
or precision. The message can
also include new lines ("\n")
and tabs ("\t").
5-74 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
LOG_FILE
Token Data
Token Type Meaning
Name Type
substitute* variable or (varies) Substitution values to insert
value into the message string. The
number of variables must
match the number of
substitution markers.
flag return INT 1 for success or 0 for failure
Example
The following example uses several of these functions and keywords.
INT step[<n>], flag[<m>]; !<n> AND <m> = number of steps AND
flags
!this file will be placed in the PS_TEMP directory
TEXT tLogfile = 'PS_TEMP:logfile.txt';
!this file will be placed in the current working directory
TEXT tErrfile = 'logfile.bad';
INT counter
(RULE) THEN step[0] = LOG_FILE(tLogfile,
"$OPEN:Create log file %a", tLogfile)
AND LOG_FILE(tErrfile, "$OPEN:Create err file
%a", tErrfile)
(RULE) IF flag[0] = 1 THEN flag[1] = LOG_FILE(tLogfile,
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-75
5 Parametric Modeling Functions
Functions
MATRIX
This function calculates and creates a rotation or transformation matrix specified by
the argument list. A matrix can be created from a set of angles, two or three points,
or the multiplication of two given matrixes. In addition, the optional 'SCALE'
argument can be used to obtain a t-matrix instead of a pure rotation matrix.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-76 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
MATRIX
Data
Token Name Token Type Meaning
Type
MULT keyword (none) Multiply the following
matrixes.
matrixA variable or Matrix First matrix to multiply
value
matrixB variable or Matrix Second matrix to multiply
value
matrixC return Matrix Product of the matrix
multiplication
Example 1
In the following example, the X dimension scaling factor is reflected in the first row,
the Y dimension factor is seen in the second row, and the Z dimension scaling factor
is in the third row.
REAL mat[9];
INT A1=90, A2=90, A3=90;
INT F1=1, F2=2, F3=3;
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-77
5 Parametric Modeling Functions
Functions
The following diagrams display a cube before and after this matrix is applied.
Observe the stretching along the local B and C axes. The A axis dimension has not
changed because its scaling factor was 1.
Example 2
REAL PNT1[3]; ! X1, Y1, Z1
REAL PNT2[3]; ! X2, Y2, Z2
REAL mat[9]
...
(RULE) THEN mat = MATRIX('2_POINTS', PNT1, PNT2)
5-78 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
MATRIX
The following diagram shows the result from the preceding rule. The local system of
coordinates is represented by the A, B, and C axes. The global design system of
coordinates is represented by the X, Y, and Z axes. The local A axis has been rotated
by mat to conform to the vector defined by PNT1 to PNT2.
Example 2
In general, the '2_POINTS' keyword indicates that the local A axis is to be oriented
in the direction of PNT1 to PNT2. The matrix returned by
MATRIX('2_POINTS',...) performs this action. The function computes the
new coordinate system in the following manner:
If the A axis defined by PNT1 and PNT2 is not aligned with the
global Z axis (that is, it lies in the X-Y plane), B is the cross product
of the global Z and the A axes (B = Z x A). C is then the cross
product of A and B, as required by a right-hand coordinate system
(C = A x B).
If the A axis defined by PNT1 and PNT2 is aligned with the global
Z axis (that is, it is vertical), C is the cross product of the A and the
global Y axes (C = A x Y). B is then the cross product of C and A, as
required by a right-hand coordinate system (B = C x A).
For an explanation of the right-hand coordinate system and cross products, see the
section Introduction to Geometric Principles on page 5-13.
Example 3
REAL PNT1[3]; ! X1, Y1, Z1
REAL PNT2[3]; ! X2, Y2, Z2
REAL PNT3[3]; ! X3, Y3, Z3
REAL mat[9];
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-79
5 Parametric Modeling Functions
Functions
...
(RULE) THEN mat = MATRIX('3_POINTS', PNT2, PNT1, PNT3)
The following diagram shows a cube rotated by the matrix defined in the preceding
rule. The local system of coordinates is represented by the A, B, and C axes. The
global design system of coordinates is represented by the X, Y, and Z axes. The
vector from PNT1 to PNT2 defines the direction of the A axis. PNT1, PNT2, and
PNT3 are used to describe the A-B plane.
Example 3
In general, '3_POINTS' will define a matrix where the direction of the A axis is
equal to the vector from PNT1 to PNT2. The C axis is the cross product of the A
axis and the vector from PNT1 to PNT3. The C axis is normal to the plane of the
three points. The B axis is then the cross product of the C and A axes.
The resulting matrix will only rotate the A axis to be in the same direction as
the vector from PNT1 to PNT2. The origin will not automatically be at PNT1,
unless PNT1 happens to be (0,0,0). An offset can be applied to the primitive or
cell to match its origin to PNT1.
Example 4
...
REAL PNT1[3];
REAL PNT2[3];
REAL PNT3[3];
REAL mat1[9];
REAL mat2[9];
5-80 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
MATRIX
...
(RULE) THEN mat1 = MATRIX('3_POINTS' PNT2, PNT1, PNT3)
(RULE) THEN mat2 = MATRIX('MULT', mat1,
(MATRIX('DEG_EULER', 90, 90, 0)) )
When a component is placed using the matrix mat1, the A axis is defined by the
vector from PNT1 to PNT2, and its A-B plane is defined by PNT1, PNT2, and
PNT3 as shown in the following diagram.
Example 4
Frequently it is desirable to have PNT1 and PNT2 define an axis other than the A
axis. Assume the C axis of the component is to be defined by PNT1 and PNT2 and
its A-C plane defined by PNT1, PNT2 and PNT3. This can be accomplished by
multiplying the mat1 matrix by a rotation matrix using the
MATRIX('MULT',...) function, and using the resultant matrix mat2 to place
the component. The result is shown in the following diagram.
Example 5
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-81
5 Parametric Modeling Functions
Functions
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<max_value> = MAX(<number0>, <number1> [, ...])
Data
Token Name Token Type Meaning
Type
number* variable or (varies) Numbers to compare
value
max_value return (varies) Maximum value in argument
series:
If any arguments are
REAL,
<max_value> is a real number.
If any arguments are not
REAL,
<max_value> is an integer.
MESSAGE
This function displays messages on the MicroStation screen. This function is useful
for keeping the user informed about the progress of component creation and as a
debugging aid while developing rules. The maximum message length is 40
characters. Longer messages are truncated to this length. For key-in messages, this
limit includes the prompt characters. Double-quoted messages are displayed exactly
as they appear. Single-quoted message are displayed in all uppercase letters. When
possible, messages should be grouped into one MESSAGE call.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
5-82 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
MESSAGE
Message Field
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-83
5 Parametric Modeling Functions
Functions
Syntax
<flag> = MESSAGE(['PAUSE',] <location0>, <message0>[,
<debug0>]
[, <location1>, <message1> [, <debug1>]] [, ...])
Data
Token Name Token Type Meaning
Type
PAUSE keyword (none) Prompt the user to press a
key before resuming rule file
execution. This prompt will
appear in the command field.
location* keyword (none) One of the keywords (in the
Keyword Table that follows)
indicating where the message
should appear. Multiple
location-message pairs can
be used within a single
MESSAGE call.
message* variable or TEXT Message to appear in the
value location specified previously
debug* variable or INT Debugging level of the
value message. The message is
displayed if the debugging
level binary mask (set
through the CONTROL
function with the DEBUG
keyword) allows this level
message. If a level is not
specified, the message is
always displayed.
flag return INT 1 for success or 0 for failure
5-84 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
MESSAGE
Location
Location Description
Keyword
CF Command Text sent to the command field will temporarily
field replace the command prompt left of the greater
than symbol (>). The command field is initially set
by the PSMENU.RUL file. To reset the command
field after a CF message, send another message
with a single-quoted space (' ')as the message text.
ER Error field Text sent to the error field will be displayed in the
bottom right-hand corner of the screen. If another
message has been sent to the message field, the
error message will be displayed in the prompt field,
to the right of any messages sent to the prompt
field.
MS Message Text sent to the message field will be displayed in
field the bottom right-hand corner of the screen.
PR Prompt Text sent to the prompt field will be displayed to
field the right of the command field and the greater
than symbol (>) in the bottom left-hand corner of
the screen.
PT Keyin field Text send to the key-in field will show up in the
key-in dialog box.
ST Status field Text sent to the message field will be displayed in
the bottom right-hand corner of the screen.
Example 1
The following code:
MESSAGE('MS', 'This message is on level 4',4)
Results in:
THIS MESSAGE IS ON LEVEL 4
Example 2
The following code:
MESSAGE('MS', "This message is always shown")
Results in:
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-85
5 Parametric Modeling Functions
Functions
Example 3
The following is are sample lines from PSMENU.RUL.
TRAYICON_HorzElbow = PS PARAMETRIC -
TRAY_TRHB -
'PSTRAY Place Bend Horizontal'
This portion will cause the message PSDSTRAY Place Bend Horizontal
to be displayed in the command field. The message will continue to be displayed in
the command field until it is overwritten by another message command:
(RULE) THEN step[1] = message('cf', "This message overwrites
the cf")
! The following rule will set it back to the default
(RULE) THEN step[2] = message('cf', ' ')
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-86 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
MOVE_COORD (formerly ASSEMBL)
Syntax
<min_value> = MIN(<number0>, <number1> [, ...])
Token Data
Token Type Meaning
Name Type
number* variable or (varies) Numbers to compare
value
min_value return (varies) Minimum value in argument
series:
If any arguments are REAL,
<min_value> is a real
number
If any arguments are not
REAL, <min_value> is
an integer.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Syntax
<flag> = MOVE_COORD([{ROTATION}][,{POSITION}])
Data
Token Name Token Type Meaning
Type
{ROTATION} (See the argument set for {ROTATION} on page 5-5.)
{POSITION} (See the argument set for {POSITION}on page 5-6.)
flag return INT 1 for success or 0 for failure
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-87
5 Parametric Modeling Functions
Functions
Example
In each of these examples, the MOVE_COORD function relocates the coordinate
system of any primitives that follow. The first example applies an angle to achieve a
rotation. The second example applies a matrix. The third example offsets the
coordinate system origin. The fourth example applies both a rotation and an offset.
MOVE_COORD('ANGLE', 90,-90,0)
MOVE_COORD('MATRIX', 1.0,0,0,0,1.0,0,0,0,1.0,)
MOVE_COORD('OFFSET', 100,-10 20)
MOVE_COORD('ANGLE', angle,0,0, 'OFFSET', 100,-100,0)
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<num_string> = NUM_TO_CHAR(<number>
[,[<format_string>|<format_key> [,<units>]]])
Data
Token Name Token Type Description
Type
number variable or INT or Numeric expression to
value REAL convert
format_string variable or TEXT Standard FORTRAN
value format string (ex: I6,
F6.2). The default is "I11"
for integers and "F15.3" for
real numbers.
format_key keyword (none) Use predefined formats,
from the Keyword Table
that follows.
5-88 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
PARSE_LABEL
Data
Token Name Token Type Description
Type
units keyword (none) Define units format of
<number>. The <units> can be
either 'MASTER-UNITS' or 'SUB-
UNITS'. 'SUB-UNITS' is the
default.
num_string return TEXT String form of the numeric
expression
PARSE_LABEL
This function reads the current value of an attribute from an existing Design Series
label. The label may have been created within the expert system rules (for example,
using the BUILD_LABEL function), or the label may have been read from a cell
selected from the design file (using the SELECT_CELL function). The extracted
value can then be used to make further qualifications or judgments for the current
component.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<flag> | <return_val> = PARSE_LABEL(<label>, <attribute> [,
'VALUE', '<val>'] [, 'POSITION', '<pos>'] [, 'FORMAT', '<form>'] [,
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-89
5 Parametric Modeling Functions
Functions
'UNITS', '<unit>']
[, 'CONVERT_UNITS']
Data
Token Name Token Type Meaning
Type
label variable name TEXT Unquoted name of variable
containing a Design Series
label
attribute variable or TEXT Name of attribute value to
value retrieve
VALUE keyword (none) Store the retrieved value into
the following variable.
val variable name (varies) Variable to store attribute
value in. Variable type must
match the value returned for
the attribute. If this keyword is
not present, the attribute value
will be returned by the
function.
POSITION keyword (none) Store the attribute label
position into following
variable.
pos variable name INT Attribute label position
FORMAT keyword (none) Store the attribute format
string into following variable.
form variable name TEXT Attribute format string
UNITS keyword (none) Store the attribute units name
into following variable.
unit variable name TEXT Attribute units name
CONVERT_UNITS keyword (none) Convert the attribute value
into database units.
flag return INT 1 for success or 0 for failure
return_val return TEXT Attribute value when the
'VALUE' keyword is not used.
If an error occurs, the
attribute value returned will be
an empty text string.
5-90 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
PICK_POINT
Example
In the following example, the rule extracts four pieces of information for the
attribute size_1 from the label identified by the name label. The VALUE
keyword causes size_1 to be written to the variable, size_1_value, while the
rest of the keywords extract information about the attribute into their respective
keywords.
(RULE) THEN flag = PARSE_LABEL(label,'size_1',
'VALUE', 'size_1_value',
'POSITION', 'label_pos',
'FORMAT', 'label_format'
'UNITS', 'unit_text_variable')
PICK_POINT
To retrieve the coordinates of a point on screen selected by a user, or to set the
origin of a cell by using the selected or stored coordinate.
The PICK_POINT function can be used to retrieve a point selected by the user
and/or to set the origin for a cell under construction. The user selected point may
be assigned to a point variable or used to set the cell origin directly (see the first
syntax summary). The cell origin may be set explicitly using either absolute or UOR
coordinates, as shown in the second syntax summary.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Data
Token Name Token Type Meaning
Type
prompt variable or TEXT User prompt to select a point
value
point variable name Point Variable to store the selected
point into
@ORIGIN keyword (none) Use the selected point as the
origin of a cell being created.
flag return INT 1 for success or 0 for failure
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-91
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
prompt variable or TEXT Unused text string
value
@SET_UOR_ORIGIN keyword (none) Use the following point
value as the origin (in
UORs) of the cell being
created.
@SET_ABS_ORIGIN keyword (none) Use the following point
value as the origin of the
cell being created.
origin variable or Point Coordinates of origin as
value specified by the previous
keyword
flag return INT 1 for success or 0 for
failure
PRIM
At the core of Design Series modeling system is a set of building functions that
create graphics primitives. The PRIM function provides the interface to each of
these routines used to place graphics primitives into the model.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
5-92 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
PRIM
Syntax
<flag> = PRIM('<primitive>', ['SOLID'|'SURFACE',]
['TOP'|'BOT'|'BEFORE'|'AFTER',][{ROTATION},] [{POSITION},]
<arg0>, <arg1>, ...)
Data
Token Name Token Type Meaning
Type
primitive variable or TEXT Name of primitive to generate
value (See the chapter Parametric
Modeling Primitives on page 6-1 on
primitive names.)
SOLID keyword (none)
For 3D shapes, specify that the
elements should be created as
solids.
SURFACE keyword (none) For 3D shapes, specify that the
elements should be created as
surfaces.
TOP keyword (none) Place the label at the top of the
cell information sequence.
BOT keyword (none) Place the label at the bottom of
the cell information sequence.
BEFORE keyword (none) Place the label at the position
just before the following marker
name. The marker name comes
from the concurrent CELL
function call.
AFTER keyword (none) Place the label at the position
just after the following marker
name. The marker name comes
from the concurrent CELL
function call.
{ROTATION} (See the argument set for {ROTATION} on page 5-5.)
{POSITION} (See the argument set for {POSITION}on page 5-6.)
arg* variable or (varies) Specify the variables in the
value definition of the primitive. (See
the chapter Parametric Modeling
Primitives on page 6-1.)
flag return INT 1 for success or 0 for failure
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-93
5 Parametric Modeling Functions
Functions
Example
Primitives are used to create points, lines, and other basic shapes such as cubes,
circles, cylinders, and hemispheres. Detailed instructions on the use of each of the
supported primitives are in the chapter Parametric Modeling Primitives on page 6-1.
The following example shows how a tank can be created by using different
primitives at strategic offsets and orientations:
REAL DIAM; ! diameter of the tank body
REAL LEN; ! length of tank
REAL DIST; ! distance from body axis to floor or base
REAL HEM; ! height of the endcap hemispheres
INT step[2]; ! only one step is required
(RULE) THEN step[0] = PRIM
PRIM('CYLL', 'SOLID',
'ANGLE', 90, 90, 0,
Tank
5-94 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
QUERY
QUERY
This function retrieves data from the Design Series database by accepting and
processing any valid SQL query statement in the argument. The queries can be
dynamically generated by composing the SQL statement using substitution
variables. The values of these variables are determined by inferencing.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
If the item matches the database column name, the data from that
column is stored in that variable.
If the item does not match the database column name, use the
form: <column_name>(<variable_name>) to store the
data from the <column_name> database column into the
<variable_name> expert system variable. See Example 2 for a
demonstration of this syntax.
The FROM keyword is followed by the table name. This is the name of the database
table to retrieve the data from.
The WHERE keyword is followed by a matching criteria expression. Any valid SQL
expression can be used for the criteria.
For details on SQL query statements in general, refer to any SQL language
reference manual.
If the current Master unit is the same as the dimension suffix, the
data values returned will equal those from the table.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-95
5 Parametric Modeling Functions
Functions
If the current Master unit is not the same as the dimension suffix,
the returned table values are automatically converted to their
equivalent number of Master Units.
For example, assume the value 25.4 is selected from a table for the attribute
LENGTH_MM, but the current Master Unit is FEET. The value returned to X in the
following line from the SELECT statement would be .083.
SELECT LENGTH(X) FROM ..........
Syntax
<flag> = QUERY(<sql_string> [, <substitute0>] [,
<substitute1>] [,...])
Data
Token Name Token Type Meaning
Type
sql_string variable or TEXT Double-quoted string
value containing a valid SQL query.
The string can contain "%a"
substitution markers to enable
dynamic query building. These
"%a" markers are filled in, in
order from the variables
following the query string. The
substitution mechanism is
similar to that found in the
TO_CHAR function, although
only the generic "%a" is
supported in this instance. To
substitute a string value in the
query, the substitution marker
must be single quoted.
substitute* variable or (varies) Substitution values to insert
value into the query string. The
number of variables must
match the number of
substitution markers.
flag return INT 1 for success or 0 for failure
Example 1
In the following example, the rule variable named prop_val is the same as the
name of the column in the database table. Therefore, the form SELECT
5-96 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
RELOCATE
Example 2
In the following example, the rule variable has a name that is different from the
name of the database variable. The database variable named pipe_dia is retrieved
into the rule variable named D, and the database variable named pipewallstd is
retrieved into the rule variable named W.
(RULE) THEN flag = QUERY("SELECT pipe_dia(D), pipewallstd(W)
FROM pipe_diameter
WHERE size_1 = %a", nps1)
RELOCATE
This function repositions or reorients (or both) a component within its current set
of rules. Most often, the final location and orientation of a component will not be
known until after the user has entered some locational data (for example, using
PICK_POINT). After gathering this data, the rules can call this function to reposition
the component.
W This function must be called before any function that generates design
file element records is called. An attempt to change the coordinate
system after calling a design file function (for example, CELL) will result
in a fatal error.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-97
5 Parametric Modeling Functions
Functions
Syntax
<flag> = RELOCATE([{ROTATION}] [{POSITION}])
Data
Token Name Token Type Meaning
Type
{ROTATION} (See the argument set for {ROTATION} on page 5-5.)
{POSITION} (See the argument set for {POSITION}on page 5-6.)
flag return INT 1 for success or 0 for failure
Example
The following example shows the use of the RELOCATE function to reposition and
re-orient a cell (just created by using the CELL and PRIM functions) from an
established position in space. The OFFSET is 10, 20, and 30 units in the X, Y, Z
global space. The rotation is through Euler angles of 30, 0, and 0 degrees.
(RULE) THEN step[1] = RELOCATE('OFFSET', 10,20,30, 'ABS_ANGLE',
30,0,0)
+ CELL('start','cellname', 'label', label, 'snap', 2,
0,0,0,
length,0,0)
+ PRIM('cyll', 'solid', 'ang', 90,90,0, diameter/2,
length)
+ CELL('END')
(END)
REPLACE_LABEL
This function replaces the text label in an existing cell of a master design file with
the label supplied as an argument.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-98 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
RETURN
Syntax
<flag> = CELL_DETAILS(<address>, <new_label>)
Data
Token Name Token Type Meaning
Type
address variable or INT[3] Block, byte, and file number
value of cell to examine. Use
SELECT_CELL to get this
address data.
new_label variable or TEXT Label to insert into the cell
value to replace the old label
flag return INT 1 for success or 0 for failure
Example
In the following example, the address of a cell in the design file has been determined
to have the address cell_address. The label information contained in
parent_label replaces the exiting label information in this cell.
(RULE) THEN flag = REPLACE_LABEL(cell_address,
parent_label)
RETURN
This function makes values used in this level of rules available to the calling rule file.
The values can be retrieved by using the ADOPT function. More values can be listed
in the RETURN call than are retrieved in the ADOPT call.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-99
5 Parametric Modeling Functions
Functions
Syntax
<flag> = RETURN(<variable0> [, <variable1>] [,...])
Data
Token Name Token Type Meaning
Type
variable* variable or (varies) Variable to be returned.
value Multiple values can be
returned.
flag return INT 1 for success or 0 for failure
Example
The following example shows the last line of code in a rule. Previous code in the
rule has established the connect points for the cell and executed the code to create
the cell. This line of code returns the connect points to the calling rule and
terminates cell creation.
(RULE) THEN step[2] = RETURN(snap1, snap2, snap3) +
CELL('END')
SDNF_DATA
This function retrieves data from an SDNF data file created by Intergraphs
Frameworks program. The function operates in three modes:
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-100 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
SDNF_DATA
Token Data
Token Type Meaning
Name Type
PROPERTY keyword (none) Open the specified file and
store the design code or
standard in <standard>.
error variable or TEXT Error message
value
standard variable name TEXT Variable to store standard in
filename variable or TEXT File to open to extract data
value from
flag return INT 1 for success or 0 for failure
Data
Token Name Token Type Meaning
Type
NEXT_PLATE keyword (none) Get the information
(data) for one plate from
the stored data.
NEXT_SECTION keyword (none) Get the information
(data) for one section
from the stored data.
error variable or TEXT Error message
value
id variable TEXT Member name to store
name in the Design Series
label.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-101
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
cardinal_point variable INT Cardinal point to place
name component by.
component_type variable TEXT Component type.
name Examples of how the
member is used are:
beam, column, or brace.
piece_name variable TEXT Piece mark
name
orientation_vector variable vector Orientation vector used
name to determine the
member's orientation
within the design file
rotation variable REAL Rotation about the
name member axis
mirrorX variable INT Variable indicating
name whether the member is
mirrored about the X
axis
mirrorY variable INT Variable indicating
name whether the member is
mirrored about the Y
axis
length_unit variable TEXT End point units
name
flag return INT -1 for error, 0 for end of
file, or 1 for success
Data
Token Name Token Type Meaning
Type
CLEANUP keyword (none) Free memory allocated for
SDNF extraction and close
the data file.
flag return INT 1 for success or 0 for failure
5-102 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
SELECT_CELL
Example
In the following example, the first rule opens the named SDNF file by section name
for processing. The second rule should be activated within a loop in the rule file to
retrieve all the members, one member at a time. On each successful retrieval, the
data for the member is placed into the variables named by the user.
(RULE) THEN flag[0] = SDNF_DATA('PROPERTY', 'err_msg',
'design_code', filename)
!start of loop
(RULE) THEN flag[1] = sdnf_data ('NEXT_SECTION', 'err_msg',
'id'
'cardinal point'
'member_type'
'component_type'
'section',
'grade',
'piece_name',
'orientation_vector',
'rotation',
'mirrorX',
'mirrorY',
'end_pts1',
'end_pts2',
'length_unit')
!end of loop
SELECT_CELL
This function prompts the user to select a Design Series cell from the design file.
The label of the selected cell is returned to the expert system rules for use.
Optionally, the cell's address and dimensional details can be saved for later retrieval
by the CELL_DETAILS function. This information can be used within the rules
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-103
5 Parametric Modeling Functions
Functions
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<flag> = SELECT_CELL('<label>' [, 'ADDRESS', '<cell_addr>'
|<cell_to_select>] [, 'CELL_DETAILS'] [, 'LINE_STRING_ONLY']
[, 'ALLOWED', <type_list>] [, 'NESTED_CELL'][, 'MESSAGE',
<pr_message>
[, <er_message>]])
Data
Token Name Token Type Meaning
Type
label variable name TEXT Variable to store label of
selected cell
ADDRESS keyword (none) If the following
argument is a variable
name token, the address
of the selected cell will
be written to it.
If the following
argument is a variable
or value token, the
address of the cell to
select will be read from
it.
This second usage of the
'ADDRESS' keyword makes
this function silent.
cell_addr variable name INT[3] Stores addresses of the
selected cell
cell_to_select variable or value INT[3] Address of cell to select
CELL_DETAILS keyword (none) Make cell details available
through the CELL_DETAILS
function. This behavior is
off by default.
LINE_STRING_ONLY keyword (none) Allow MicroStation Type
4 (line string) selection
only.
5-104 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
SELECT_CELL
Data
Token Name Token Type Meaning
Type
ALLOWED keyword (none) Use the following list to
filter selectable
components.
type_list variable or value TEXT Single-quoted, space-
delimited list of valid
component or commodity
types for selection. List
length is 40 characters.
NESTED_CELL keyword (none) Allow a nested cell to be
selected from within a
parent cell.
MESSAGE keyword (none) Use the first following
argument as a prompt for
the MicroStation prompt
field. The optional second
following argument is
used as a prompt to the
error field.
pr_message variable or value TEXT Message to the prompt
field
er_message variable or value TEXT message to the error field
flag return INT 1 for success or 0 for
failure
Example 1
In the following example, the rule enables the user to identify a cell by using the
mouse cursor. It always returns a label. In this case it is stored in 'beam_label'.
The 'ADDRESS' keyword returns the address of the selected cell to
'cell_address' and the 'CELL_DETAILS' keyword stores several items of
data about the cell for later use. The 'NESTED_CELL' keyword allows the selection
of one of several cells that make up a composite cell. The 'DATAPOINT' keyword
stores the coordinates of the selected point of the selected cell in 'p13'. The
messages are displayed in the prompt and error fields of the MicroStation command
window.
(RULE) THEN flag = SELECT_CELL('beam_label',
'ADDRESS', 'cell_address',
'CELL_DETAILS',
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-105
5 Parametric Modeling Functions
Functions
'NESTED_CELL',
'DATAPOINT', 'p13',
'MESSAGE',
Example 2
The following example enables the user to select only a line string cell. It returns
both a label and a cell address.
(RULE) THEN flag = SELECT_CELL('selected_label',
'ADDRESS', 'cell_address',
'LINE_STRING_ONLY')
SIN
This function returns the sine of an angle argument. The argument is measured in
degrees and can be a numeric variable, expression, or constant.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<angle_sin> = SIN(<angle>)
Token
Token Type Data Type Meaning
Name
angle variable or INT or Angle in degrees to take sine
value REAL of
angle_sin return REAL Sine of <angle>
SQRT
This function returns the square root of a non-negative numeric expression.
5-106 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
STR_EDIT (formerly STREDT)
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<root> = SQRT(<number>)
Token
Token Type Data Type Meaning
Name
number variable or INT or Number to take square root
value REAL of
root return float Square root of <number>
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
Syntax
<edit_string> = STR_EDIT(<edit_key>, <string>)
Data
Token Name Token Type Meaning
Type
edit_key keyword (none) Single-quoted, comma-
separated string containing
one or more of the editing
keywords (in the Keyword
Table that follows). If more
than one editing key is listed,
they are executed in the
order shown.
string variable or TEXT String to operate on
value
edit_string return TEXT Edited string
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-107
5 Parametric Modeling Functions
Functions
Example
(RULE) IF STR_EDIT('COMPRESS, UPCASE', answer) = "Y"
THEN step[0] = 1
(RULE) IF STR_EDIT('TRIM LOWCASE', answer) = "y"
THEN step[0] = 1
(RULE) IF STR_FIND('LENGTH', STR_EDIT('COLLAPSE', answer)) = 0
THEN step[0] = message('PAUSE', 'ER', "Answer cannot be
blank")
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Data
Token Name Token Type Meaning
Type
LOCATE keyword (none) Find the <target> within
the <source>.
source variable or TEXT String to search
value
5-108 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
STR_FIND (formerly STRNUM)
Data
Token Name Token Type Meaning
Type
target variable or TEXT String to find
value
start return INT Position at which the first
occurrence of the
<target> begins in the
<source>. If the
<target> is not found
within the <source>, the
length of the <source> is
returned.
Data
Token Name Token Type Meaning
Type
LENGTH keyword (none) Measure the <source>.
source variable or TEXT String to measure
value
size return INT Length of the <source>.
Data
Token Name Token Type Meaning
Type
NUMERIC keyword (none) Determine if the
<source> can be
interpreted as a number.
source variable or TEXT String to evaluate as a
value number. Scientific notations
('15e-6') are considered
valid numbers.
true_or_false return INT 1 if a number, 0 if not a
number
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-109
5 Parametric Modeling Functions
Functions
Example
The following example shows various returns depending on the keyword used.
(RULE) IF STR_FIND('NUMERIC', rot_angle) = 1
THEN b_angle = char$real(rot_angle)
(RULE) IF STR_FIND('LENGTH', file_name) <= 12
AND STR_FIND('LOCATE', file_name, '.') = 1
THEN step[0] = 1
(RULE) IF STR_FIND('LOCATE', file_name, '.') <> 1
AND STR_FIND('LENGTH', file_name) > 8
THEN step[0] = message('ER', "Filename is too long")
+ clear('step[0], file_name')
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<length> = STR_LENGTH(<string>)
Data
Token Name Token Type Meaning
Type
string variable or TEXT String to measure
value
length return INT Length of string
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-110 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
STR_MID0 (formerly EXTRACT)
Syntax
<found> = STR_MATCH(<target>, <source>)
Data
Token Name Token Type Meaning
Type
target variable or TEXT String to find
value
source variable or TEXT String to search within
value
found return TEXT '.TRUE.' if found or
'.FALSE.' if not found
Example
In the following example, test is set to '.TRUE.' because 'GBD' can be found in
the source string.
test = STR_MATCH('GBD', 'GAD GBD GCD')
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-111
5 Parametric Modeling Functions
Functions
Syntax
<substring> = STR_MID0(<start>, <length>, <string>)
Data
Token Name Token Type Meaning
Type
start variable or INT Position at which to begin
value the extraction. Characters are
indexed from 0. If the
<start> is greater than
the <length>, an empty
string will be returned.
length variable or INT Number of characters to
value extract. If the <start> +
<length> is greater than
the length of the
<string>, the function
will return characters up to
the end of the string.
string variable or TEXT String to extract from
value
substring return TEXT Extracted sub-string
Example
In the following example, STR_MID0 is used within an expression to get the first
two characters from the text string sect_name for comparison with the text
string '2L'.
TEXT sect_name, mem_type;
(RULE) IF extract(0, 2, sect_name) = '2L'
THEN mem_type = 'double_angle'
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-112 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
STR_REPLACE (formerly STRING$REPLACE)
Syntax
<substr> = STR_MID1(<source>, <start>, <end>)
Data
Token Name Token Type Meaning
Type
source variable or TEXT String to extract from
value
start variable or INT Starting location
value
end variable or INT Starting location
value
substr return TEXT Extracted sub-string
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<new_string> = STRING_REPLACE(<source>, <target>,
<replacement>)
Data
Token Name Token Type Meaning
Type
source variable or TEXT String to search within
value
target variable or TEXT String to search for
value
replacement variable or TEXT String to substitute for
value <target>
new_string return TEXT String containing the
replacement
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-113
5 Parametric Modeling Functions
Functions
STRIP
This function normalizes a transformation matrix.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<normal_transform> = STRIP(<scaled_transform>)
Data
Token Name Token Type Meaning
Type
scaled_transform variable or Matrix Transformation matrix
value to normalize
normal_transform return Matrix Normalized
transformation matrix
SUB
This function runs a non-graphical set of rules as sub-rules of another rule file.
Consequently, no arguments to modify the location and orientation of cells are
supported. In all other respects, the SUB function behaves the same way as the BUD
function. For more details on how expert system rules are loaded and run, see
BUD on page 5-36. The SUB function can also be used recursively, that is, a rule
can call itself.
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
5-114 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
SUB
Syntax
<flag> = BUD('<bud_type>|<rule_name> [, [<subcode1>],
[<subcode2>], [<product>], [<application>]]', ['LIST',
<variable0> [, <variable1>] [,...]])
Token Data
Token Type Meaning
Name Type
bud_type value TEXT Name of class to identify rule.
See the explanation under the
function BUD on page 5-36.
rule_name value TEXT Name of specific rule to run.
See the explanation under the
function BUD on page 5-36.
subcode1 value TEXT Matches to EXPERT_RULES.
See the explanation under the
function BUD on page 5-36.
subcode2 value TEXT Matches to EXPERT_RULES.
See the explanation under the
function BUD on page 5-36.
product value TEXT Design Series product class such
as PIPE and CONC. See the
explanation under the function
BUD on page 5-36.
application value TEXT Defaults to PSDS unless
otherwise specified here
LIST keyword (none) Precedes list of variables to be
passed to the BUD rule
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-115
5 Parametric Modeling Functions
Functions
Token Data
Token Type Meaning
Name Type
variable* variable or (varies) Variables to be passed to the
value BUD rule for inheritance. The
list of variables must agree in
order and data type (including
array dimensions) with the list to
be inherited, although the names
can be different. The number of
variables in either list can be
shorter or longer than the
corresponding list, but no
arguments can be skipped.
Therefore, those variables that
must be passed and inherited
must be specified first in the
lists.
flag return INT 1 for success or 0 for failure
Example
In the following example, this SUB function call loads and executes the TOEANGLE
rule from product PIPE in the default application (not specified). The two
parameters, PIPE_CLASS and P0, are passed to this rule.
(RULE) THEN step[3] = SUB('TOEANGLE, , , PIPE', 'LIST',
PIPE_CLASS, P0)
SURFACE
The function indicates when graphics primitives should be used to create a surface.
This function places a surface record into the design file. To create a proper image,
the user must satisfy all MicroStation requirements in terms of record types and
order of placement after the SURFACE header. (See MicroStation documentation
for these requirements.)
This function must be called in a rule that sets the step[ ] variable. For details,
see Using the Step Array Variable to Control the Order of Processing and Running
Rules on page 9-18 in the PlantSpace Design Series Administrator Guide.
5-116 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
SURFACE
Syntax
<flag> = SURFACE('SURFACE'|'SOLID', 'PROJ'|'REVOL' [, {ROTATION}]
[, {POSITION}] [, 'ELEM', <boundary_elems>])
Data
Token Name Token Type Meaning
Type
SURFACE keyword (none)
Create a surface header.
SOLID keyword (none)
Create a solid header.
PROJ keyword (none)
Indicate that this is a surface
of projection.
REVOL keyword (none) Indicate that this is a surface
of revolution.
{ROTATION} (See the argument set for {ROTATION} on page 5-5.)
{POSITION} (See the argument set for {POSITION}on page 5-6.)
ELEM keyword (none) Use the following integer to
indicate the number of
boundary primitives used in
creating the surface. By
default, the boundary is
formed by one primitive, such
as a line string or shape, but
the latest versions of
MicroStation allow more than
one boundary. The number of
boundary primitives must be
specified so that it can be
inserted into the header
record of the surface element.
boundary_elems variable or INT Number of boundary
value elements
flag return INT 1 for success or 0 for failure
Example
The following example creates a solid cell using the surface function. The CELL
function names the cell, assigns it a label and connect points. The surface
function initiates the construction of the solid surface that is created by a cross-
sectional shape and lines of projection. The first two PRIM functions define the
coordinates of the cross sectional shape at the beginning and end of the cell. The
CONTROL function followed by the remaining PRIM functions identify the
corresponding lines to connect the cross_section points at each end of the cell. The
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-117
5 Parametric Modeling Functions
Functions
ENDSURF function identifies the end of the surface generation specifications and
the CELL('END') function identifies the end of the cell generation specs.
(RULE) THEN step[4] = relocate('off', place_point)
+ CELL('start','stds', 'label', label, 'snap', 2, 0,0,0,
len,0,0)
+ SURFACE('solid', 'proj')
+ PRIM('shape', 6, 0,a1, 0,a2, 0,a3, 0,a4, 0,a5, 0,a6)
+ PRIM('shape', 6, len,a1, len,a2, len,a3, len,a4,
len,a5, len,a6)
+ CONTROL('rul_lin')
+ PRIM('line' 0,a1, len,a1)
+ PRIM('line' 0,a2, len,a2)
+ PRIM('line' 0,a3, len,a3)
+ PRIM('line' 0,a4, len,a4)
+ PRIM('line' 0,a5, len,a5)
+ PRIM('line' 0,a6, len,a6)
+ ENDSURF('solid')
+ CELL('END')
+ RETURN
TAN
This function returns the tangent of an angle argument. The argument is measured
in degrees and can be a numeric variable, expression, or constant.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-118 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
TIME
Syntax
<angle_tan> = TAN(<angle>)
Token
Token Type Data Type Meaning
Name
angle variable or INT or Angle in degrees to take
value REAL tangent of
angle_tan return REAL Tangent of <angle>
TIME
This function returns a text string containing requested elements of the current date
and time. Time formats can be written in either 24 hour style or 12 hour a.m./p.m.
style.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<td_string> = TIME(<time_code>|'<time_keyword>')
Data
Token Name Token Type Meaning
Type
time_code variable or INT Time/date format code from the
value Code and Keyword Table that
follows
time_keyword keyword (none) Time/date format keyword,
where applicable, from the Code
and Keyword Table that follows
td_string return TEXT String containing the time or
date (or both) in the requested
format
Format Format
Format Hours
Code Keyword
1 TIME HH:MI:SS 24
2 ETIME HH:MI:SSa.m./p.m. 12
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-119
5 Parametric Modeling Functions
Functions
Format Format
Format Hours
Code Keyword
4 DATE MMDDYY
5 TIME+DATE HH:MI:SS DDMMYY 24
6 (none) HH:MI:SSa.m./p.m. MMDDYY 12
8 DATE1 MM:DD:YY
9 (none) HH:MI:SS MM:DD:YY 24
10 (none) HH:MI:SSa.m./p.m. MM:DD:YY 12
16 DATE2 DD <month> YYYY
17 (none) HH:MI:SS DD <month> YYYY 24
18 (none) HH:MI:SSa.m./p.m. DD <month>YYYY 12
37 DATE+TIME MMDDYY HH:MI:SS
38 (none) MMDDYY HH:MI:SSa.m./p.m. 24
41 (none) MM:DD:YY HH:MI:SS 12
42 (none) MM:DD:YY HH:MI:SSa.m./p.m.
49 (none) DD <month> YYYY HH:MI:SS 24
50 (none) DD <month> YYYY HH:MI:SSa.m./p.m. 12
Example
The following examples set various formats for displaying the date and time:
(RULE) THEN CURRENT_TIME = TIME('TIME')
(RULE) THEN CURRENT_TIME = TIME('DATE+TIME')
(RULE) THEN CURRENT_TIME = TIME(41)
TO_CHAR
This function composes a formatted text string of numbers or text (or both). It
enables you to construct text strings dynamically for prompts or messages to the
user. In its simplest form, a number is converted to a string. In its text formatting
form, the first argument (which must be text and is the format string) is combined
with any following arguments to produce a formatted text string.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-120 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
TO_CHAR
Token
Token Type Data Type Meaning
Name
number variable or INT or Number to convert to a string
value REAL
string return TEXT Output string of the converted
number
Data
Token Name Token Type Meaning
Type
format variable or TEXT Format string indicating
value where and how the following
variables should be
substituted. The format
string can use any standard C
language "printf"
formatting codes (for
example, %s, %d, and
%12.6lf). For details, refer
to a C language manual.
substitute* variable or (varies) Substitution values to insert
value into the query string. The
number of variables must
match the number of
substitution markers.
string return TEXT Formatted output string
Example
The following example shows the use of the TO_CHAR function by first converting
a real number into a text string and returning it to the variable TXT1. Likewise, an
integer value is returned to TXT2. The first TXT3 rule shows the conversion of text
data, real data, and integer data into a single text string and its return to TXT3. The
second TXT3 rule is identical to the first rule, except that the use of single quotation
marks around the format specification displays any alphabetic characters in upper
case.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-121
5 Parametric Modeling Functions
Functions
REAL a;
INT b;
TEXT txt1;
TEXT txt2;
TEXT txt3;
! The following rules set text1 to the string "12.000000 "
and
! txt2 to the string "5 "
(RULE) THEN a = 12.0
(RULE) THEN txt1 = TO_CHAR(a)
(RULE) THEN b = 5
(RULE) THEN txt2 = TO_CHAR(b)
! The following rules set txt3 to the string
! a is 12.000000 and b is 5
(RULE) THEN txt3 = TO_CHAR( "%s is %lf and %s is %d",
'a',a,'b',b)
UNITS
This function uses units keywords to operate in three modes: conversion,
identification, and UOR reporting. The conversion mode converts from one named
unit to another or to the current modeling units by default. The identification mode
returns the actual units associated with a named unit. The third mode, UOR
reporting, retrieves the number of MicroStation UORs associated with each
modeling unit.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
5-122 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
UNITS
Token
Token Type Data Type Meaning
Name
dimension variable or INT or REAL Number to convert
value
from_key keyword (none) Units to convert from one of
$MODEL, $MASTER,
$SUBUN, and $UORS
to_key keyword (none) Units to convert to.
'$MODEL' is the default.
converted return INT or REAL Converted dimension
Example
The following example shows the three modes of the UNITS function. In mode 1,
the number of UORS is returned in the numeric value given as 0.5. Mode 2 returns
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-123
5 Parametric Modeling Functions
Functions
a text string of the master units. Mode 3 returns a numeric value of the number of
UORs in a modeling unit.
REAL conv_valu, cur_uors;
TEXT cur_units;
INT step[1];
(RULE) THEN conv_valu = UNITS( 0.5, 'IN', '$UORS') ! Mode 1
(RULE) THEN cur_units = UNITS('$MASTER') ! Mode 2
(RULE) THEN cur_uors = UNITS('$UORS') ! Mode 3
(RULE) THEN step[0] = message('pause'),
'ms',to_char("Current units = %s",
cur_units),
'pr',to_char("Converted value = %lf",
con_valu),
'er',to_char("Current UORS = %lf",
cur_uors))
This function converts a point from global space to Design Series local space. This
function enables you to convert a point (defined in global space coordinates and
passed into the Design Series modeling system) from a special user command or
calculated within the rules into the coordinate system in effect at the current stage of
the rules.
5-124 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
USER_INPUT (formerly PROMPT_VAL)
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Syntax
<local_point> = UOR_LOCAL_POINT(<global_point>)
Data
Token Name Token Type Meaning
Type
global_point variable or Point Global point to convert
value
local_point return Point Point converted to local
space
Example
In the following example, the globally defined point pt1 is converted to a point in
the local coordinate system, namely pt2.
(RULE) THEN pt2 = UOR_LOCAL_POINT(pt1)
Keyed-in input is stored to the variables listed by name in the first argument. You
must always provide at least the name of a string variable. Any keyed-in input will be
stored in this variable unless a second variable name, of a numeric type, is provided.
When a numeric variable is also provided, valid numeric strings will be treated as
numeric values. Non-valid numeric strings and all other strings will be treated as
normal text and will be stored in the first variable. If a numeric variable is provided,
a units conversion keyword, such as $UORS or $MASTER can also be listed. For
more on unit conversion keywords, see UNITS on page 5-122.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-125
5 Parametric Modeling Functions
Functions
Syntax
<flag> = USER_INPUT('<string> [, <number> [, <units>]]',
'<datapoint>', <prompt0> [,<prompt1>])
Token Data
Token Type Meaning
Name Type
string variable name TEXT Variable in which to store text
keyed in by the user
number variable name INT or Variable in which to store the
REAL number keyed in by the user
units keyword (none) One of the units conversion
keywords, such as $UORS or
$MASTER, to be applied to
<number> when entered
datapoint variable name Point Variable in which to store the
point selected by the user
prompt0 variable or TEXT Prompt message to direct the
value users input
prompt1 variable or TEXT Optional prompt message to
value append to <prompt0>
flag return INT Indicate failure or the type of
input that was successfully
retrieved. Values are:
0 = Error
1 = User keyed-in text stored to
<string>
2 = User-entered a reset
3 = User-selected data point
stored to <datapoint>
Example 1
The following example shows the use of the USER_INPUT function to take
different actions based on the user response to a prompt. The response, either
through the keyboard or cursor, determines the value returned to the flag[6]
variable. The flag[6] variable can then be tested to take appropriate actions.
When the USER_INPUT function is activated it displays the prompt:
Keyin 'a' Axis Act. Angle(DEG)
DP = 0 Degrees, RST = 90 Degrees
5-126 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
USER_INPUT (formerly PROMPT_VAL)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-127
5 Parametric Modeling Functions
Functions
(RULE) IF flag[6] = 3
THEN a_angle = 0
! User clicked the reset button for an angle of 90 degrees
(RULE) IF flag[6] = 2
THEN a_angle = 90
Example 2
The following example shows the units syntax:
(RULE) THEN flag[8] = user_input('tadjx, adjx, $UORS', dummy,
"Enter X UOR offset value or",
to_char("DP for default (%lf)",
def_adjx))
VECTOR
This function performs geometric calculations with vectors. The eleven different
modes of operation are detailed in the syntax summary.
This function cannot be called in a rule that sets the step[ ] array variable to
control the order of rule processing.
Data
Token Name Token Type Meaning
Type
CROSS_PROD keyword (none) Calculate the cross product of
the following two vectors.
vector0 variable or Vector Direction cosines of the input
value vector
vector1 variable or Vector Direction cosines of the input
value vector
5-128 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
VECTOR
Data
Token Name Token Type Meaning
Type
magnitude variable name REAL Magnitude of the output
vector
vector2 return Vector Direction cosines of output
vector
Data
Token Name Token Type Meaning
Type
DOT_PROD keyword (none) Calculate the dot product of the
following two vectors.
vector0 variable or Vector Direction cosines of the input
value vector
vector1 variable or Vector Direction cosines of the input
value vector
DEG keyword (none) Measure angles in degrees.
RAD keyword (none) Measure angles in radians.
angle return REAL Angle between the input vectors
Syntax for Calculating the Cross Product of Two Lines with a Common Point
<vector> = VECTOR('CROSS_PROD_3PTS', <line0_end>, <start>,
<line1_end>, '<magnitude>')
Data
Token Name Token Type Meaning
Type
CROSS_PROD_3PTS keyword (none) Calculate the cross
product of line0 and
line1
line0_end variable or Point End point of line0
value
start variable or Point Start point of both input
value lines
line1_end variable or REAL End point of line1
value
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-129
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
magnitude variable name REAL Magnitude of the output
vector
vector return Vector Direction cosines of the
output vector
Syntax for Calculating the Dot Product of Two Lines with a Common Point
<angle> = VECTOR('DOT_PROD_3PTS', <line0_end>, <start>,
<line1_end>
[, 'DEG'|'RAD'])
Data
Token Name Token Type Meaning
Type
DOT_PROD_3PTS keyword (none) Calculate the dot product of
line0 and line1
line0_end variable or Point End point of line0
value
start variable or Point Start point of both input
value lines
line1_end variable or REAL end point of line1
value
DEG keyword (none) Measure angles in degrees.
RAD keyword (none) Measure angles in radians.
angle return REAL Angle between the input
vectors
Data
Token Name Token Type Meaning
Type
CROSS_PROD_4PTS keyword (none) Calculate the cross
product of line0 and
line1
line0_start variable or Point Start point of line0
value
5-130 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
VECTOR
Data
Token Name Token Type Meaning
Type
line0_end variable or Point End point of line0
value
line1_start variable or Point Start point of line1
value
line1_end variable or REAL End point of line1
value
magnitude variable name REAL Magnitude of the output
vector
vector return Vector Direction cosines of the
output vector
Data
Token Name Token Type Meaning
Type
DOT_PROD_4PTS keyword (none) Calculate the dot product of
line0 and line1
line0_start variable or Point Start point of line0
value
line0_end variable or Point End point of line0
value
line1_start variable or Point Start point of line1
value
line1_end variable or REAL end point of line1
value
DEG keyword (none) Measure angles in degrees.
RAD keyword (none) Measure angles in radians.
angle return REAL Angle between the input
vectors
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-131
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
DIR_COSINES keyword (none) Calculate the direction cosines
of the vector between the
following two points.
start variable or Point Start point of the line
value
end variable or Point End point of the line
value
magnitude variable name REAL Magnitude of the output vector
vector return Vector Direction cosines of the output
vector
Token Data
Token Type Meaning
Name Type
LENGTH keyword (none) Calculate the distance between
the two following points.
start variable or Point Start point
value
end variable or Point End point
value
vector variable name Vector Direction cosines of the
output vector
length return REAL Length of the output vector
5-132 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
VECTOR
Token Data
Token Type Meaning
Name Type
PROJECT keyword (none) Project <point0> onto the
line between <start> and
<end>.
start variable or Point Start point of line
value
end variable or Point End point of line
value
point0 variable or Point Point to project onto the line
value
flag variable name REAL Projection status:
0 = Projection within line
1 = Projection outside of start
2 = Projection outside of end
projection return Point Projected point
Data
Token Name Token Type Meaning
Type
PT_ALONG keyword (none) Calculate the point coordinates
at <distance> along the line
from <start> to <end>.
start variable or Point Start point of line
value
end variable or Point End point of line
value
distance variable or INT or Distance along the line from the
value REAL start point
pt_on_line return Point Point at a specified distance
along the line from the start
point
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-133
5 Parametric Modeling Functions
Functions
Data
Token Name Token Type Meaning
Type
PLANE_LINE keyword (none) Calculate the intersection
between the plane defined by the
following three points and the
line from <start> to <end>.
point0 variable or Point Point in plane
value
point1 variable or Point Point in plane
value
point2 variable or Point Point in plane
value
start variable or Point Start point of line
value
end variable or Point End point of line
value
intersect variable name Point Intersection between the line
and plane
flag return REAL Projection status:
0 = Error
1 = Success
2 = Points are colinear.
3 = Line and plane are parallel.
4 = Line has length zero.
5 = Intersection point(s) off plane
Example
In the following example, the rule shows all the keywords available to the function
and examples of the parameters. Each of the following keywords is described with
numeric input and output values, and the variable names correspond with the rule in
the previous section:
5-134 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
VECTOR
REAL pt1[3];
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-135
5 Parametric Modeling Functions
Functions
REAL pt2[3];
REAL pt3[3];
REAL pt4[3];
REAL pt5[3];
REAL intersec_pt[3];
REAL dir_cos1[3];
REAL dir_cos2[3];
REAL dir_cos3[3];
REAL dir_cos4[3];
REAL angle1;
REAL angle2;
REAL angle3;
REAL flag;
REAL length;
REAL xprod;
REAL distance;
(RULE) THEN dir_cos1 = VECTOR('CROSS_PROD', dir_cos1,
dir_cos2,
'xprod')
(RULE) THEN dir_cos2 = VECTOR('CROSS_PROD_3PTS', pt1, pt2,
pt3,'xprod')
(RULE) THEN dir_cos3 = VECTOR('CROSS_PROD_4PTS', pt1, pt2,
pt3, pt4,
'xprod')
(RULE) THEN angle1 = VECTOR('DOT_PROD', dir_cos1, dir_cos2,
'RAD')
(RULE) THEN angle2 = VECTOR('DOT_PROD_3PTS', pt1, pt2,
pt3,'DEG')
(RULE) THEN angle3 = VECTOR('DOT_PROD_4PTS', pt1, pt2, pt3,
pt4)
5-136 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Functions
VECTOR
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 5-137
5 Parametric Modeling Functions
Functions
5-138 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
6 Parametric Modeling Primitives
Introduction
This chapter expands on the chapter Using the Expert System in Design Series in the
PlantSpace Design Series Administrator Guide. This listing details the graphics primitives
available for creation through PRIM function calls. For a detailed explanation of the
PRIM function, see PRIM on page 5-92 of this Reference Guide for
Administrators.
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-1
6 Parametric Modeling Primitives
Introduction
6-2 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
Primitives
Primitives
ARC
Geometric Shape: Elliptical Arc
Syntax
PRIM('ARC', PRIMARY, SECOND, ALPHA, SWEEP)
Where Means
PRIMARY One-half the primary (major) axis
length
SECOND One-half the secondary (minor) axis
length
ALPHA Starting offset angle in the +X direction
SWEEP Sweep angle of arc
Example
PRIM('ARC', 3, 2, 10, 120)
Top View
CIRCLE
Geometric Shape: Circle
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-3
6 Parametric Modeling Primitives
Primitives
Syntax
PRIM('CIRCLE', RADIUS)
Where Means
RADIUS Radius of circle
Example
PRIM('CIRCLE', 2)
Top View
CIRCELB
Geometric shape: Partial Torus (Non-snappable)
Syntax
PRIM('CIRCELB', RAD, R_RAD, SWEEP)
Where Means
RAD Radius of the opening
R_RAD Radius of the elbow
SWEEP Sweep angle
6-4 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
CIRCLELL
Example
PRIM('CIRCELB', 1, 3, 60)
CIRCLELL
Geometric Shape: Partial Torus (Snappable)
Syntax
PRIM('CIRCLELL', RAD, R_RAD, SWEEP)
Where Means
RAD Radius of the opening
R_RAD Radius of the elbow
SWEEP Sweep angle
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-5
6 Parametric Modeling Primitives
Primitives
Example
PRIM('CIRCLELL', 1, 3, 60)
CONE
Geometric Shape: Cone
Syntax
PRIM('CONE', RAD, H)
Where Means
RAD Radius of base
H Height
Example
PRIM('CONE', 1, 2)
Isometric View
6-6 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
CUBE
CUBE
Geometric Shape: Rectangular Prism (Snappable)
Syntax
PRIM('CUBE', LX, LY, LZ)
Where Means
LX X Dimension
LY Y Dimension
LZ Z Dimension
Example
PRIM('CUBE', 3, 4, 2)
Isometric View
CYLL
Geometric Shape: Cylinder (Snappable)
Syntax
PRIM('CYLL', RAD, H)
Where Means
RAD Radius of base
H Height
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-7
6 Parametric Modeling Primitives
Primitives
Example
PRIM('CYLL', 1, 2)
Isometric View
DUCT_ECC_RED
Geometric Shape: Eccentric Reducing Duct (Non-snappable)
Syntax
PRIM('DUCT_ECC_RED', LX, LY, H, TX, TY, DX, DY)
Where Means
LX X Dimension of base
LY Y Dimension of base
H Height
TX X Dimension of top
TY Y Dimension of top
DX X-Offset of top
DY Y-Offset of top
6-8 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
DUCT_RED
Example
PRIM('DUCT_ECC_RED', 2,2, 2.5, 1,1, 1,1)
DUCT_RED
Geometric Shape: Concentric Reducing Duct (Non-snappable)
Syntax
PRIM('DUCT_RED', LX, LY, H, TX, TY)
Where Means
LX X Dimension of base
LY Y Dimension of base
H Height
TX X Dimension of top
TY Y Dimension of top
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-9
6 Parametric Modeling Primitives
Primitives
Example
PRIM('DUCT_RED', 2, 2, 2.5, 1, 1)
Isometric View
DUCT_SEG
Geometric Shape: Duct (Non-snappable)
Syntax
PRIM('DUCT_SEG', LX, LY, LZ)
Where Means
LX X Dimension
LY Y Dimension
LZ Z Dimension
6-10 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
ECONE
Example
PRIM('DUCT_SEG', 3, 4, 2)
Isometric View
ECONE
Geometric Shape: Eccentric Cone
Syntax
PRIM('ECONE', RAD, H, DX, DY)
Where Means
RAD Radius of base
H Height
DX X-Offset of apex of cone
DY Y-offset of apex of cone
Example
PRIM('ECONE', 1, 2, 0.5, 0.5)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-11
6 Parametric Modeling Primitives
Primitives
ECYLL
Geometric Shape: Eccentric Cylinder
Syntax
PRIM('ECYLL', RAD, H, DX, DY)
Where Means
RAD Radius of base
H Height
DX X-Offset of top cylinder
DY Y-offset of top cylinder
Example
PRIM('ECYLL', 1, 2, 0.5, 0.5)
ELBOW
Geometric Shape: Sectioned Elbow (Snappable)
6-12 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
ELBOW
Syntax
PRIM('ELBOW', MASK, S_RAD, E_RAD, C_RAD, N, PNT1, PNT2,
PNT3)
Where Means
MASK Valid values:
0 = No pipes connected to elbow
1 = Pipe from PNT1 to PNT2 (start to elbow)
2 = Pipe from PNT3 to PNT2 (end to elbow)
3 = Pipe from PNT1 to PNT2 and from PNT3
to PNT2 (start to end)
S_RAD Starting radius
E_RAD Ending radius
C_RAD Curvature radius
N Number of sections in elbow (reducing elbow
only)
PNT1 (X1, Y1, Z1) Coordinates of starting point
PNT2 (X2, Y2, Z2) Coordinates of center of elbow
PNT3 (X3, Y3, Z3) Coordinates of ending point
Examples
PRIM('ELBOW', 3, 0.5, 0.75, 0.65, 3, 1, 2.5,0, 3, 0, 0, 2, -
3,0)
Isometric View
Top View
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-13
6 Parametric Modeling Primitives
Primitives
Isometric View
Isometric View
6-14 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
ELLIPSE
ELLIPSE
Geometric Shape: Ellipse
Syntax
PRIM('ELLIPSE', PRIM, SECOND)
Where Means
PRIM One-half the primary (major) axis
length
SECOND One-half the secondary (minor) axis
length
Example
PRIM('ELLIPSE', 3, 2)
Top View
EPYRAM
Geometric Shape: Eccentric Truncated Pyramid (Snappable)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-15
6 Parametric Modeling Primitives
Primitives
Syntax
PRIM('EPYRAM', LX, LY, H, TX, TY, DX, DY)
Where Means
LX X Dimension of base
LY Y Dimension of base
H Height
TX X Dimension of top
TY Y Dimension of top
DX X-Offset of top
DY Y-Offset of top
Example
PRIM('EPYRAM', 2,2, 2.5, 1,1, 1,1)
ETRCONE
Geometric shape: Eccentric Truncated Cone (Snappable)
6-16 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
HEMISPH
Syntax
PRIM('ETRCONE', RAD, T_RAD, H, DX, DY)
Where Means
RAD Radius of base
T_RAD Radius of top
H Height
DX X-Offset of top
DY Y-Offset of top
Example
PRIM('ETRCONE', 1, 0.5, 2, 0.5, 0.5)
HEMISPH
Geometric shape: Hemisphere
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-17
6 Parametric Modeling Primitives
Primitives
Syntax
PRIM('HEMISPH', RAD, H)
Where Means
RAD Radius of base
H Height
Example
PRIM('HEMISPH', 2, 2)
Isometric View
LINE
Geometric shape: Line
Syntax
PRIM('LINE', X1, Y1, Z1, X2, Y2, Z2)
Where Means
X1, Y1, Z1 Coordinates of the starting point of the line
(PNT 1)
X2, Y2, Z2 Coordinates of the ending point of the line
(PNT 2)
6-18 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
LINESTRING
Example
PRIM('LINE', 3, 1, 0, 0, 3, 1)
Isometric View
LINESTRING
Geometric shape: Line String
Syntax
PRIM('LINESTRING', n, X1, Y1, Z1, X2, Y2, Z2,... Xn,
Yn, Zn)
Where Means
n Number of points (maximum of 101)
X1, Y1, Z1 Coordinates of first point of linestring (PNT
1)
X2, Y2, Z2 Coordinates of second point of linestring
(PNT 2)
Xn, Yn, Zn Coordinates of nth point of linestring (PNT n)
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-19
6 Parametric Modeling Primitives
Primitives
Example
PRIM('LINESTRING', 4, 1, -1, 0, 3, 1, 0, 2, 3, 1, 1, 3, 1)
Isometric View
PIPE_ECC_RED
Geometric shape: Eccentric Pipe Reducer (Non-snappable)
Syntax
PRIM('PIPE_ECC_RED', RAD, T_RAD, H, DX, DY)
Where Means
RAD Radius of base
T_RAD Radius of top
H Height
DX X-Offset of top
DY Y-Offset of top
6-20 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
PIPE_ELB
Example
PRIM('PIPE_ECC_RED', 1, 0.5, 2, 0.5, 0.5)
PIPE_ELB
Geometric shape: Pipe Elbow (Non-snappable)
Syntax
PRIM('PIPE_ELB', MASK, S_RAD, E_RAD, C_RAD, N, PNT1,
PNT2, PNT3)
Where Means
MASK Valid values:
0 = No pipes connected to elbow
1 = Pipe from PNT1 to PNT2 (start to elbow)
2 = Pipe from PNT3 to PNT2 (end to elbow)
3 = Pipe from PNT1 to PNT2 and from PNT3 to
PNT2 (start to end)
S_RAD Starting radius
E_RAD Ending radius
C_RAD Curvature radius
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-21
6 Parametric Modeling Primitives
Primitives
Where Means
N Number of sections in elbow (reducing elbow
only)
PNT1 (X1, Y1, Z1) Coordinates of starting point
PNT2 (X2, Y2, Z2) Coordinates of center of elbow
PNT3 (X3, Y3, Z3) Coordinates of ending point
Examples
PRIM('PIPE_ELB', 3, 0.5, 0.75, 0.65, 3, 1, 2.5, 0, 3, 0, 0, 2,
-3, 0)
6-22 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
PIPE_ELB
Examples (continued)
Isometric View
Isometric View
Isometric View
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-23
6 Parametric Modeling Primitives
Primitives
PIPE_HUB
Geometric shape: Closed-End Pipe (Non-snappable)
Syntax
PRIM('PIPE_HUB', RAD, H)
Where Means
RAD Radius of base
H Height
Example
PRIM('PIPE_HUB', 1, 2)
Isometric View
PIPE_RED
Geometric shape: Concentric Pipe Reducer (Non-snappable)
Syntax
PRIM('PIPE_RED', RAD, T_RAD, H)
Where Means
RAD Radius of base
6-24 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
PIPE_SEG
Where Means
T_RAD Radius of top
H Height
Example
PRIM('PIPE_RED', 1, 0.5, 2)
Isometric View
PIPE_SEG
Geometric shape: Open-End Pipe (Non-snappable)
Syntax
PRIM('PIPE_SEG', RAD, H)
Where Means
RAD Radius of base
H Height
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-25
6 Parametric Modeling Primitives
Primitives
Example
PRIM('PIPE_SEG', 1, 2)
Isometric View
POINT
Geometric shape: Point
Syntax
PRIM('POINT', X, Y, Z)
Where Means
X, Y, Z Coordinates of the point
Example
PRIM('POINT', 2, 1, 1)
Isometric View
POLYCP
Geometric shape: Polygonal Extrusion
6-26 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
POLYCP
Syntax
PRIM('POLYCP', n, H, X1, Y1, X2, Y2,... Xn, Yn)
Where Means
n Number of vertexes
H Height
X1, Y1 Coordinates of first vertex (PNT1)
X2, Y2 Coordinates of second vertex
(PNT2)
Xn, Yn Coordinates of nth vertex (PNTn)
Example
PRIM('POLYCP', 5, 2, 1,2, 3, 1, 3, -1, -1, -2, -2, 1)
Isometric View
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-27
6 Parametric Modeling Primitives
Primitives
PYRAM
Geometric shape: Pyramid (Snappable)
Where Means
LX X Dimension of base
LY Y Dimension of base
H Height
TX X Dimension of top
TY Y Dimension of top
Example
PRIM('PYRAM', 2, 2, 2.5, 1, 1)
Isometric View
RECTANGLE
Geometric shape: Rectangle
6-28 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
RECTELL
Syntax
PRIM('RECTANGLE', LX, LY)
Where Means
LX X Dimension
LY Y Dimension
Example
PRIM('RECTANGLE', 6, 4)
Top View
RECTELL
Geometric shape: Partial Annulus (Snappable)
Syntax
PRIM('RECTELL', W, H, R_RAD, SWEEP)
Where Means
W Width of the opening
H Height of the opening
R_RAD Radius of the elbow
SWEEP Sweep angle
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-29
6 Parametric Modeling Primitives
Primitives
Example
PRIM('RECTELL', 2, 1, 3, 45)
RIGHT_PRYSM
Geometric shape: Regular Polygonal Extrusion
Syntax
PRIM('RIGHT_PRYSM', N, RADIUS, HEIGHT)
Where Means
N Number of vertexes as follows:
If N > 2, the expert system creates the inscribed polygon.
If N < -2, the expert system creates the circumscribed
polygon.
Note: N greater than -3 or less than 3 is an error.
RADIUS Radius
HEIGHT Height (thickness) of the prysm
Example
PRIM('RIGHT_PRYSM', 5, 6, .5) to create an inscribed pentagon
PRIM('RIGHT_PRYSM', -5, 6, .5) to create a circumscribed
pentagon
6-30 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
SEMI_PRYSM
SEMI_PRYSM
Geometric shape: Partial Regular Polygonal Extrusion
Syntax
PRIM('SEMI_PRYSM', N, M, RADIUS, HEIGHT)
Where Means
N Number of right polygon vertexes as follows:
If N > 2, the semi-prysm created will be based on an inscribed
polygon with vertexes.
If N < -2, the semi-prysm created will be based on a
circumscribed polygon with vertexes.
Note: N greater than -3 or less than 3 is an error.
M The number of semi-prysm vertexes is (M <= abs(N)).
RADIUS Radius
HEIGH Height (thickness) of the prysm
T
Example
PRIM('SEMI_PRYSM', 5, 3, 6, .5) to create an inscribed semi
prysm
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-31
6 Parametric Modeling Primitives
Primitives
SHAPE
Geometric shape: Shape
Syntax
PRIM('SHAPE', n, X1, Y1, Z1, X2, Y2, Z2, Xn, Yn, Zn)
Where Means
n Number of vertexes
X1, Y1, Z1 Coordinates of first vertex
X2, Y2, Z2 Coordinates of second
vertex
Xn, Yn, Zn Coordinates of nth vertex
The shape primitive automatically creates the line segment between the first
and the last point to close the shape. The first and the last points in the
argument list should not be the same.
6-32 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
SQTORND
Example
PRIM('SHAPE', 5, 1, 1, 0, 1, -1, 1, 2, -1, 2, 3, -2, 0, 3, -
3, 3)
Isometric View
SQTORND
Geometric shape: Rectangular-to-Round Transition
Syntax
PRIM('SQTORND', LX, LY, H, PRIM, SECOND, DX, DY)
Where Means
LX X Dimension of base
LY Y Dimension of base
H Height
PRIM One-half the primary (major) axis length of top
SECOND One-half the secondary (minor) axis length of
top
DX X-Offset of top
DY Y-Offset of top
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-33
6 Parametric Modeling Primitives
Primitives
Example
PRIM('SQTORND', 6, 4, 2, 1, 0.5, 0.5, 0.5)
TRCONE
Geometric shape: Truncated Cone (Snappable)
Syntax
PRIM('TRCONE', RAD, T_RAD, H)
Where Means
RAD Radius of base
T_RAD Radius of top
H Height
6-34 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Parametric Modeling Primitives
TRCONE
Example
PRIM('TRCONE', 1, 0.5, 2)
Isometric View
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators 6-35
6-36 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
7 Flowcharting a Component Using
Parametric Rule Files
Before you can understand rule files, you need to understand what a rule file is, what
defines a Design Series component, and how a component is placed inside Design
Series.
If you need to refresh your memory on the meaning of terms used in this
chapter, see the Glossary at the end of the PlantSpace Design Series Administrator
Guide.
Is a MicroStation cell
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-1
7 Flowcharting a Component Using Parametric Rule Files
Understanding Rule Files
Design Series recognizes and groups all the pieces of a plant design
component (for example, a piping valve) by its association as a cell
in the design file.
Has a label
The type of component along with all of its attribute settings (for
example, valve number and piping system) are contained in a
MicroStation text element called the cell label. This information is
used in the modeling environment.
Has connect points
The component connect points are used in the modeling
environment to facilitate automatic alignment when placing
components. Some of the post-processing software uses the
connect points to analyze connectivity.
7-2 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
How Is a Design Series Component Placed?
The following graphics show how a cap is placed inside PlantSpace Design Series.
As you can see in the first graphic, the CLASSES table in the PlantSpace database
identifies the upper level rule file needed for that component.
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-3
7 Flowcharting a Component Using Parametric Rule Files
Understanding Rule Files
The Upper level rule is typically the first rule called and is listed in the CLASSES
table of the PlantSpace database. An upper level rule is any rule that uses the BUD
function to call another rule. An upper level rule can also be an MDL application.
The second level rule is always called by an upper level rule through the BUD
function. A second level rule can also be an upper level rule file as well if it uses the
BUD function to call another rule. Typically the second level rule is used to
determine what primitives are needed to graphically build the component.
7-4 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
What Does a Rule File Contain?
Sub Rule
The sub rule can be called by either the upper level or second level rule. A sub rule is
called using the SUB function. A sub rule is used to return data (for example, query
a database table). It does not determine what primitives are needed to graphically
build the component.
Variables
Variables are used in rules the same way that they are used in any other software
language. Variables can be defined as an integer, real, or character. A variable can be
defined two ways in a rule as explained in Style 1 and Style 2.
Style 1 Style 2
TEXT pl_type; (type) pl_type TEXT
REAL xlen; (type) xlen REAL
Either way of defining a variable in a rule is acceptable. Both ways can be used in the
same rule.
Flags
Flags are defined as an array in a rule. Flags are typically used to track the status of a
query to a database table for information and to display an error message if the
query fails. Flags are defined at the top of the rule and are defined as an integer. The
array length should be at least equal to the total number of flags used in the rule.
The above rule uses the QUERY function to select values for tbl_name and
col_name from the diameter_tables database table based on the values of stndrd and
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-5
7 Flowcharting a Component Using Parametric Rule Files
Understanding Rule Files
code. If the query is successful, FLAG[0] will be set to 1. If the query fails FLAG[0]
will be set to 0.
Steps
Steps are used to call STEP functions and are defined as an array in a rule. For a
complete list of user functions, refer to the Design Series Reference Guide for
Administrators delivered in release 7.1. Steps are defined at the top of the rule and
are defined as an integer. The array length should be at least equal to the total
number of steps used in the rule. The following is an example of a STEP function in
a rule used with a flag to display error message if a query fails:
(RULE) IF flag[0] = 0 THEN Step[1] =
CONTROL('ERR',TO_CHAR("Query error [DIAMETER_TABLES]
stndrd %s, code %s", Rstndrd, code_num ) )
The above rule looks at the value of flag[0]. If it is equal to 0, then step[1] uses the
CONTROL function to display an error message and step[1] will be set to 1.
7-6 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
How Do You Step Through a Rule?
Values for f1 and l1 are not assigned until con1= SK and the BUD function calls the
HEXAGON rule and passes values for variables f1 and l1 to that rule.
Rules are processed in a STEP sequence, STEP[0] followed by STEP[1]. When all
STEPs have been set to a positive integer, processing is complete. If any of the
STEPs evaluate to 0, the expert system stops processing. Therefore, before the
expert system moves to the next STEP in a rule, the previous STEP must evaluate
to a positive integer.
In the example that follows, STEP [0] uses two functions, INHERIT and SUB.
When called, both of these functions return the value 1. Therefore, after these
functions are called, STEP[0] will have the value 2. Because Step[0] evaluates to a
positive integer, the expert system moves to the next step, STEP[1].
STEP [1] uses two functions, ADOPT and SUB. When called, both of these
functions return the value 1. When the ADOPT and SUB functions are called,
STEP 1[1] will have the value 2. Because STEP [1] evaluates to a positive integer, the
expert system moves to the next step, STEP[2].
The expert system continues in this manner until one of the steps does not evaluate
to a positive integer or the END statement is found.
(RULE) THEN step[0] = INHERIT('label,nomDiam,con1')
+ SUB('getStand,,,PIPE', 'LIST', label )
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-7
7 Flowcharting a Component Using Parametric Rule Files
Understanding Rule Files
identified in the CLASSES table of the Design Series database. The label
information for our pipe cap is shown in the attributes dialog box.
Service is set to ACD, Line No. is set to 123, Insulation Thickness is set to 0, Spec is
set to CS150, Standard is set to ANSI, Size 1 is set to 6, End Preparation 1 is set to
Butt Weld, and Schedule is set to 40.
The rule files called by AMS will use the data supplied from the label to create our
pipe cap. To create a 6-inch butt welded pipe cap, the following rules are called:
7-8 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
Flowcharting the Upper Level Rule CAP
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-9
7 Flowcharting a Component Using Parametric Rule Files
Flowcharting the Upper Level Rule CAP
7-10 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
Flowcharting the Upper Level Rule CAP
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-11
7 Flowcharting a Component Using Parametric Rule Files
Flowcharting the Upper Level Rule CAP
7-12 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
Flowcharting the Sub Rule GET_OD
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-13
7 Flowcharting a Component Using Parametric Rule Files
Flowcharting the Sub Rule GET_OD
7-14 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
Flowcharting the Sub Rule GET_OD
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-15
7 Flowcharting a Component Using Parametric Rule Files
Flowcharting the Second Level Rule CAP_END
7-16 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
Flowcharting the Second Level Rule CAP_END
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-17
7 Flowcharting a Component Using Parametric Rule Files
Flowcharting the Second Level Rule CAP_END
7-18 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Flowcharting a Component Using Parametric Rule Files
Flowcharting the Second Level Rule CAP_END
April 23, 2004 PlantSpace Design Series Reference Guide for Administrators 7-19
7 Flowcharting a Component Using Parametric Rule Files
Summary
Summary
You should now have a basic understanding of the following key points.
Three types of parametric rules are used: upper level, second level, and sub.
Rules are processed in a STEP sequence, STEP[0] followed by STEP[1]. When all
STEPs have been set to a positive integer, processing is complete. If any of the
STEPs evaluate to 0, the expert system stops processing. Therefore, before the
expert system moves to the next STEP in a rule, the previous STEP must evaluate
to a positive integer.
7-20 PlantSpace Design Series Reference Guide for Administrators April 23, 2004
Index
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators IN-1
Index
IN-2 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Index
N
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators IN-3
Index
IN-4 PlantSpace Design Series Reference Guide for Administrators May 19, 2004
Index
U
FILES.SQL 1-4
INSTALL.SCR 1-3
PERSONAL.INI 1-3
REMOVE.SCR 1-3
Setting Up Design Series 1-11-4
SETUP.CFG 1-3
SETUP.INI 1-3
TEXT_LAB. See INSERT_LABEL.
THREADS.DAT 4-19
TIME Function 5-119
TO_CHAR Function 5-120
Tokens in functions 5-1
TRAY_SYMBOLGY.DAT 4-27
TRCONE Primitive 6-34
U
UNITS Function 5-122
UOR_LOCAL_POINT Function 5-124
UOR_LOCAL_PT. See UOR_LOCAL_POINT.
User Tables 2-12
USER_INPUT Function 5-125
USERS table 2-12
V
Valves 3-24
VECTOR Function 5-128
VLV_CODE.DAT 4-11
W
WALLTHK.DAT 4-33
WTRF_DIA.DAT 4-21
WTRH_DIA.DAT 4-21
WTRI_DIA.DAT 4-21
WTRP_DIA.DAT 4-21
May 19, 2004 PlantSpace Design Series Reference Guide for Administrators IN-5
IN-6 PlantSpace Design Series Reference Guide for Administrators May 19, 2004