Free text and group text rules - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

The [TextRules] and [ConcatentenationRules] sections in the SPFHotspotter.ini file control the selection of text strings from the drawing. [TextRules] contains the selection rules, and [Concatenations] gives the option of prefixing and suffixing the selected strings.

[TextRules]

Format of each line of [TextRules]:

RuleBaseName|Topic|Variation|Operator|Argument

All columns must contain data.

RuleBaseName

Identifies a set of rules. The value may be any string.

Currently, the SmartConverter uses all rules in the SPFHotspotter.ini file regardless of the RuleBaseName.

Example:

ProjectA|TAG|Normal|=|##*

ProjectA|DOCUMENT|Normal|=|??-????-??

Topic

Identifies what kind of plant item class the drawing text expresses.

Example:

ProjectA|TAG|Normal|=|##*

ProjectA|DOCUMENT|Normal|=|??-????-??

Drawing text 20VA1001 will be hotspotted as of topic "TAG".

Drawing text AA-1010-BC will be hotspotted as of topic "DOCUMENT".

Drawing text AB5000 will not be hotspotted since it does not match any rule.

Variation

The drawing text for a certain Topic may be formatted with several variations across drawings of the same plant, various subcontractors may format text differently, or a main equipment tag may be formatted differently from a line tag (but still same Topic "TAG").

The Variation is a way to express an OR clause for a given Topic. The Variation may contain any string value.

Example:

ProjectA|TAG|Normal|<|9

ProjectA|TAG|Normal|=|##*####

ProjectA|TAG|Line|=|##.##-*

Drawing text 20VA1001 will be hotspotted as of topic "TAG".

Drawing text 01.00-CG-48L6940—AD200-406 will be hotspotted as of topic "TAG".

The latter text fails the first Topic/Variation pair comparison, but matches the second Topic/Variation pair.

  • The same Topic/Variation pair must follow on subsequent lines in the file.

  • The file is processed top down.

  • For best performance, place the Topic/Variation pairs that are assumed to give most matches as early in the file as possible.

Operator

Defines the text compare operation. Values allowed include the following: "=", "!", "<" or ">".

= specifies "like" Argument

! specifies "not like" Argument

> specifies that length of text must longer than number Argument

< specifies that length of text must shorter than number Argument

Lines for a given Topic/Variation pair may have multiple lines of same operator type. It does not make sense for "<" and ">", but gives flexibility for "=" and "!".

Argument

Any whole positive number if the Operator is "<" or ">".

A text pattern if Operator is "=" or "!".

Characters in pattern

Matches in string

?

Any single character.

*

Zero or more characters.

#

Any single digit (0–9).

[charlist]

Any single character in charlist.

[!charlist]

Any single character not in charlist.

 

A group of one or more characters (charlist) enclosed in brackets ([ ]) can be used to match any single character in string and can include almost any character code, including digits.

Example:

ProjectA|DOCUMENT|KE|>|6

ProjectA|DOCUMENT|KE|<|20

ProjectA|DOCUMENT|KE|=|?-*-*

ProjectA|DOCUMENT|KE|!|?-*.*-*

ProjectA|DOCUMENT|KPS|>|6

ProjectA|DOCUMENT|KPS|<|20

ProjectA|DOCUMENT|KPS|=|??-*-*

Means: Hotspot drawing text as Topic "DOCUMENT" if: (Length of text greater than 6 characters AND Length of text less than 20 characters AND value of text like "?-*-*" AND value of text not like "?-*.*-*") OR (Length of text greater than 6 characters AND Length of text less than 20 characters AND value of text like "??-*-*")

[Concatenations]

A string satisfying a pass through [TextRules] processing or the Scattered Text Rules processing may be prefixed and/or suffixed. For example, offsheet connectors are usually not written as the complete document number. This concatenation process may resolve this issue.

Each line is a rule formatted as:

Rulebase|Topic|Variation|Prefix|Suffix

SQL type wildcards may be specified for Prefix and Suffix

Examples:

ProjectA|DOCUMENT|KEPID|C056-KV-|-01

ProjectA|DOCUMENT|KPSPID|C056-%-P-|

A string identified by [TextRules] to be of topic DOCUMENT, variation KEPID, is returned as C056-KV-string-01. The latter will be returned as C056-%-P-string.

In this example:

ProjectA|DOCUMENT|*|C056-KV-|-01

The * means of any Variation. So all strings identified by the [TextRules] to be of topic DOCUMENT will be prefixed with "C056-KV-" and suffixed with "-01", regardless of the variation.