David Poiron Posted October 31, 2022 Share Posted October 31, 2022 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. Quote Link to comment
Pat Stanford Posted November 2, 2022 Share Posted November 2, 2022 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. 2 Quote Link to comment
Thomas W Posted November 4, 2022 Share Posted November 4, 2022 (edited) 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 November 4, 2022 by Thomas W Quote Link to comment
Pat Stanford Posted November 4, 2022 Share Posted November 4, 2022 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. 1 Quote Link to comment
David Poiron Posted November 4, 2022 Author Share Posted November 4, 2022 This worked great, Pat. Thanks for your sage advice, as usual. Quote Link to comment
Thomas W Posted November 7, 2022 Share Posted November 7, 2022 Thanks for that clarification Pat. Quote Link to comment
Recommended Posts
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.