Getting rid of the square brackets and return drawing Type and Mark
Not version-specific
Tekla Structures
Environment
Not environment-specific
Question:
I am using an attribute DRAWING.NAME to show the type and mark of the drawing in templates and reports. The output is as in the drawing list when drawing Type and Mark are combined, for example, G [1].
Is it possible to have the plain drawing name without the brackets as an outcome, for example, G1?
Answer:
Usually for W (single part), A (assembly) or C (cast unit) the drawing Mark contains a prefix for the element and therefore it is not necessary to use the Type of the drawing when returning the value.
However, for the G (general arrangement) drawings the situation is a bit different, because the Mark does not contain any letters or prefixes. Therefore, users usually want to use the Type field of the drawing to indicate that this is a general arrangement drawing, but these attributes contain square brackets. This example will show how to return those values without square brackets.
But, if this formula will be used, for example, for assembly drawings, then the result will be AB.1
mid(GetValue("TYPE"),0,1)+mid(GetValue("NAME_BASE"),1,length(GetValue("NAME_BASE"))-2)
else
mid(GetValue("NAME_BASE"),1,length(GetValue("NAME_BASE"))-2)
endif
For single part drawings with Type [W] and Mark [b.1]: b.1
For assembly drawings with Type [A] and Mark [B.1]: B.1
For cast unit drawings with Type [C] and Mark [C.1]: C.1
See also:
Getting rid of the square brackets when using NAME_BASE
I am using an attribute DRAWING.NAME to show the type and mark of the drawing in templates and reports. The output is as in the drawing list when drawing Type and Mark are combined, for example, G [1].
Is it possible to have the plain drawing name without the brackets as an outcome, for example, G1?
Answer:
Usually for W (single part), A (assembly) or C (cast unit) the drawing Mark contains a prefix for the element and therefore it is not necessary to use the Type of the drawing when returning the value.
However, for the G (general arrangement) drawings the situation is a bit different, because the Mark does not contain any letters or prefixes. Therefore, users usually want to use the Type field of the drawing to indicate that this is a general arrangement drawing, but these attributes contain square brackets. This example will show how to return those values without square brackets.
- To return a value of drawing Type use:
- To return a value of a drawing Mark use:
- To get a result like G1 for the general arrangement drawing, use this formula:
But, if this formula will be used, for example, for assembly drawings, then the result will be AB.1
- To use that formula only for general arrangement drawings and use another formula for single part, assembly or cast unit drawings where only Mark of drawing without the square brackets is returned, a condition must be added to the equation. The whole formula has to be like this:
mid(GetValue("TYPE"),0,1)+mid(GetValue("NAME_BASE"),1,length(GetValue("NAME_BASE"))-2)
else
mid(GetValue("NAME_BASE"),1,length(GetValue("NAME_BASE"))-2)
endif
- The end result is like this:
For single part drawings with Type [W] and Mark [b.1]: b.1
For assembly drawings with Type [A] and Mark [B.1]: B.1
For cast unit drawings with Type [C] and Mark [C.1]: C.1
See also:
Getting rid of the square brackets when using NAME_BASE