Getting rid of the square brackets when using NAME_BASE
Not version-specific
Tekla Structures
Environment
Not environment-specific
Question:
I'm using NAME_BASE to show the drawing name in templates and reports. The output is exactly as it is in the drawing list, e.g. [G.6].
Is it possible to have the plain drawing name without the brackets as an outcome, e.g. G.6?
Answer:
If you want to get rid of the square brackets, you can use a template formula for this:
instead of using ValueField
GetValue("NAME_BASE")
use ValueField formula
mid(GetValue("NAME_BASE"),1,length(GetValue("NAME_BASE"))-2)
This formula will remove first and last character from the returned string, so the output will in this case be G.6 instead of [G.6].
Technical background:
The length(GetValue("NAME_BASE")) checks the length of the output of GetValue("NAME_BASE"). In this case length(GetValue("NAME_BASE"))=5.
[ = character 0
G = character 1
. = character 2
6 = character 3
] = character 4
With the above mid function we will show the output of 5-2=3 characters after character 0. In other words characters 1, 2 and 3 are displayed, and the outcome is G.6.
I'm using NAME_BASE to show the drawing name in templates and reports. The output is exactly as it is in the drawing list, e.g. [G.6].
Is it possible to have the plain drawing name without the brackets as an outcome, e.g. G.6?
Answer:
If you want to get rid of the square brackets, you can use a template formula for this:
instead of using ValueField
GetValue("NAME_BASE")
use ValueField formula
mid(GetValue("NAME_BASE"),1,length(GetValue("NAME_BASE"))-2)
This formula will remove first and last character from the returned string, so the output will in this case be G.6 instead of [G.6].
Technical background:
The length(GetValue("NAME_BASE")) checks the length of the output of GetValue("NAME_BASE"). In this case length(GetValue("NAME_BASE"))=5.
[ = character 0
G = character 1
. = character 2
6 = character 3
] = character 4
With the above mid function we will show the output of 5-2=3 characters after character 0. In other words characters 1, 2 and 3 are displayed, and the outcome is G.6.