Linking multiline text strings

Normally, CADMATIC eShare expects a text string that should be turned into a link to be a single line of text, because in PDF documents each line of text is handled as a separate string.

There are two exceptions to this:

  • When a text label has multiple lines but just one character per line, as in when label text is in Japanese, it can be handled as a single string.
  • When a text label consists of two lines that are close enough to each other and horizontally aligned to left, middle, or right. This must be set up in the document type definition by describing the format of the first line and the second line separately, and using \n to represent the line break in the middle.

For example, a diagram drawing might have labels in the following format, so that the first line always consists of a number followed by a letter, but depending on object type the second line might consist of numbers or letters:

To detect such labels, the Identifier Detection Rule should look for the pattern <number><letter><line break><five numbers or letters>, and the rule could be constructed as follows:

This example pattern creates two named capture groups, "LineOne" and "LineTwo", and uses two character classes: the decimal digit \d character class that only matches numbers, and the word character \w character class that matches both numbers and letters.

  • (?<LineOne>\d\w) creates the named capture group LineOne that represents any string that consists of one decimal digit and one word character. If the first line had one number and two letters, you could use \d\w\w.
  • \n stands for the line break.
  • (?<LineTwo>\w{5}) creates the named capture group LineTwo that represents any string that consists of five consecutive word characters.

The Target ID Format field specifies that the first part of the string must match the pattern that LineOne represents, and the second part must match the pattern that LineTwo represents.

When the user opens a document from CADMATIC eShare and a multiline label text matches a pattern, the system turns the text into a link that the user can click to open the related object in the 3D view.