Seeking Tokens
Seeking tokens are a type of token that determine AseptSoft to seek around a Block to find the information required to get the value the token is compatible with.
Seek Attribute
This is the scenario when a Block does not own directly the AutoCAD attributes needed to build the value, but it is known to have another Block nearby which contains this information.
This is a common scenario when:
the PIDs have been originally created in Plant3D and then downgraded to AutoCAD, and the Controls have been split apart from their Tags and Annotations.
The company symbology requires adding a separated Block that contains the Tag, next to each of the PID Shape Components.
This token follows one of the patterns:
$$property(<class name>-><AutoCAD Attribute>)$$
$$property(<class name>((<AutoCAD demanded Attribute>))-><AutoCAD Attribute>)$$
$$property(<class name>((<AutoCAD demanded Attribute>==<Value>))-><AutoCAD Attribute>)$$
The <class name> component defines which is the Class of the nearby Block Reference which is relevant for searching information within.
The <AutoCAD Attribute> component defines which is the Attribute in that Block Reference which must be extracted to build information from.
The <AutoCAD demanded Attribute> component specifies that AseptSoft must choose a source Block Reference which defines that Attribute. Block References matching the class name but which don’t define the demanded Attribute, will be ignored when searching for sources to replace this token
The <Value> component specifies that the demanded <AutoCAD demanded Attribute> property must also have the given value, otherwise it will be ignored when in the search phase for the token.
Example:
In this scenario multiple valves have their tags as Block References nearby them. Valves HA-165 and HA-164 are the same class, PIP GATE VALVE, while HA-166 is a PIP GATE VALVE(CLOSED). But all 3 have tags as Block References of class “Valve Label block”, as DIFFERENT blocks than the valves themselves:
However, the red Valve (CV 101) is of type PIP GLOBE VALVE, and has the tag more far away, also as a block Reference of type Field Mounted Discrete. te.
Following the rules defined above, we need to define the Tag-Build property for PIP GATE VALVE and PIP GATE VALVE(CLOSED) as:
$$property(Valve Label block->Tag)$$
which will produce HA-164, HA-165, HA-166
For PIP GLOBE VALVE the Tag-Build property will be defined as:
$$property(Field Mounted Discrete->Type)$$-$$property(Field Mounted Discrete->LoopNumber)$$
which will produce CV-1001
Furthermore, you can even define a Size-Build property for the PIP GATE VALVE and PIP GATE VALVE(CLOSED) classes as:
$$property(Valve Label block->Size)$$
which will produce 4” 4” 3” for each of the valves
The result will be
To generate this type of token using the Property Token Builder first select a block belonging to the source class in AutoCAD (or set that class as “Seeked Class” in the window, then set the following window configuration:
Seek Text
This is the scenario when the source for building information is of type Text or MText
This token follows the pattern:
$$text(<regex - regular expression>)$$
AseptSoft will look within the drawing for the closes Text which matches the regular expression, and use its whole value to build the information.
Example:
$$text(\d+”x\d+”)$$
which will identify any text of form 3”x4” or 1”x5” or 20”x49” or so on.
We use .Net regular expressions for identification.
For more specific expressions regarding specific types of text matches, refer to https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference or contact us to help you build your environment.
Note: If you use any https://learn.microsoft.com/en-us/dotnet/standard/base-types/grouping-constructs-in-regular-expressions, AseptSoft will take the agragation of all the groups within your expression as the final Value. If you do not mention any Capturing groups, then the entire value that matched will be used as the final value. When AseptSoft identifies that you are using https://learn.microsoft.com/en-us/dotnet/standard/base-types/grouping-constructs-in-regular-expressions, it will automatically update the Token Builder to show you “Existing matches group extractions”:
To generate this type of token using the Property Token Builder first set the following window configuration:
In the “Existing matches” list you will see all the available text values in the drawing which match the given regex expression. Then start editing the regex expression to match exactly the desired values:
Now our regex is completed:
Seek in Block Text
The only situation when his token is commonly used, is for COMOS-exported P&IDs. In such drawings, the Properties of blocks are visible in one of these cases:
A text that is within a nearby neighbour Block’s own Block Definition. This is treated using the currently described token type.
A Text within a Block’s own Block Definition: this is treated using a https://aseptsoft.atlassian.net/wiki/spaces/AFAAD/pages/edit-v2/179306566#Is-Self-Block-Text token.
A simple Text or MText nearby: this is treated using the https://aseptsoft.atlassian.net/wiki/spaces/AFAAD/pages/edit-v2/178978876#Seek-Text token.
This token follows the pattern:
$$seekinblock(<group name or regex pattern>-><in block text matching pattern>)$$
The <group name or regex pattern> component defines which are the Classes of the nearby Block which is relevant for searching information within. If the value of this component is the name of one of the Blocks, Classes, Groups, Environments - Terminology | Groups, then all the classes of that group are considered eligible to provide a value for our token. Otherwise, if the component describes a regex pattern, then any class whose name matches the regex pattern is considered eligible to provide a value for our token.
The <in block text matching pattern> component defines the regex pattern that filters out the wrong texts within the elected Block (of an eligible class).
Examples:
$$seekinblock(Tag Bodies Group->HA-)$$
This token can be replaced with the value of a Text or MText within the definition of any Block whose class is part of the Tag Bodies Group, and the Text or MText within it’s definition whose value can be used contains the text “HA-”
$$seekinblock(^v_\d+->HA-)$$
This token can be replaced with the value of a Text or MText within the definition of any Block whose class is part matches contains “v_” followed by some digits within it’s name, and the Text or MText within it’s definition whose value can be used contains the text “HA-”.