Jump to content

Wall, Roof or Slab component listing in data tag and graphic legend


Recommended Posts

We are currently using the following code for data tags to list out the components of wall, roof or slab styles in a data tag:


 

#WS_COMPONENTNAME(1)#
... [insert intermediate values here!]
#WS_COMPONENTNAME(16)#

 

The problem with this method is that it has a bunch of blank spaces at the end, depending on the actual number of components. We are trying to use the new graphic legends, and this makes all the cells in the new graphic legends for this purpose the same height because of the fixed number of possible components.

 

What we would like is a function to list the component names of all actual components, which would create a variable height list (depending on how many components). This would alleviate the extra space and the graphic legend height issue. Maybe there is a way to do this now in 2023 that I am unaware of.

Link to comment

Here is a Dynamic Text formula that seems to work for the first 8 components. Copy it from the code block below and paste into a dynamic text box in the Legend editor.

 

Just stick an additional #WS_IF(COMPONENTNAME(2)='', '', CONCAT(CHAR(13), COMPONENTNAME(2)))# using the correct Component number on the end.

 

Note that the entire "formula" needs to be on a single logical line. If you use the return key to make it easier to read, that return will be considered part of the output and you will end up with extra lines.

 

The basic logic is if the component name is blank then return an empty character. Else return the combinations (concat) of a carriage return (Char(13)) and the name of the component.

 

#WS_COMPONENTNAME(1)##WS_IF(COMPONENTNAME(2)='', '', CONCAT(CHAR(13), COMPONENTNAME(2)))##WS_IF(COMPONENTNAME(3)='', '', CONCAT(CHAR(13), COMPONENTNAME(3)))##WS_IF(COMPONENTNAME(4)='', '', CONCAT(CHAR(13), COMPONENTNAME(4)))##WS_IF(COMPONENTNAME(5)='', '', CONCAT(CHAR(13), COMPONENTNAME(5)))##WS_IF(COMPONENTNAME(6)='', '', CONCAT(CHAR(13), COMPONENTNAME(6)))##WS_IF(COMPONENTNAME(7)='', '', CONCAT(CHAR(13), COMPONENTNAME(7)))##WS_IF(COMPONENTNAME(8)='', '', CONCAT(CHAR(13), COMPONENTNAME(8)))#

 

Ask again if you need more help.

  • Like 2
Link to comment

Merci !

 

Au cas où si certains cherchent ça fonctionne chez moi sous windows mais avec des ; à la place des ,

 

#WS_COMPONENTNAME(1)##WS_IF(COMPONENTNAME(2)=''; ''; CONCAT(CHAR(13); COMPONENTNAME(2)))##WS_IF(COMPONENTNAME(3)=''; ''; CONCAT( CAR(13); NOM DU COMPOSANT(3)))#

Edited by Thomas W
Link to comment

Pardonnez le mauvais Google Traduction.

Le point-virgule (;) au lieu de la virgule (,) n'est pas Windows v Macintosh. C'est l'utilisation de la virgule comme point décimal dans les nombres. Si votre système utilise une virgule comme séparateur décimal, vous devez utiliser des points-virgules comme séparateurs de paramètres dans les fonctions de feuille de calcul.

 

Pardon the bad Google Translate.

The semicolon (;) instead of comma (,) is not Windows v Macintosh. It is the use of the comma as the decimal point in numbers. If you have your system to use a comma as the decimal separator then you have to use semicolons as the parameter separators in worksheet functions.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...