CJA Posted March 26 Share Posted March 26 Hi Everyone, Former ArchiCAD user new to the Vectorworks Environment. Trying to create a data tag that when the obscured glazing is ticked in the OIP instead of returning a 'true' or 'false' in the tag it returns either 'OBS' or ' '. Is this a simple add on string to the Tag Field Definition or is this a case of a something simple needing a very complicated workaround. Quote Link to comment
Pat Stanford Posted March 26 Share Posted March 26 This is a perfect case for the Data Tag version of If/Then, also referred to the trinary operator. Put the result if true before an @ sign and the result if false after a colon (:) and put the test value in the middle. So something like: 'OBS'@#WinDoor 6.0#.#Opaque Glass#:'' Since 'Opaque Glass' as a field is already defined as a Boolean (true/false) you don't need to do any type of comparison, you can just use the value. The part after the colon is two single quotes next to each other. Note that you can't put any spaces between the @ and the Colon and whatever comes before and after them. 2 Quote Link to comment
Tom W. Posted March 26 Share Posted March 26 @Pat Stanford so is this using the if((logical_test), value_if_true, value_if_false) function or something else...? I don't really understand what you have done but I like it! I don't see any documentation for it. I don't see @ as an operator. Thank you! 1 Quote Link to comment
Tom W. Posted March 26 Share Posted March 26 Thanks @M5d. is how I would have done it. I didn't realise you could also do it the other way e.g. . There is no reference to the alternative syntax in the WS Function Reference. So is it only applicable in Data Tags...?? Quote Link to comment
CJA Posted March 26 Author Share Posted March 26 2 hours ago, Pat Stanford said: This is a perfect case for the Data Tag version of If/Then Thanks Guys, I'll be honest coming from ArchiCAD were everything is spoon fed to you this is some complex language to get around. But I can definitely see massive potential in this level of flexibility. Quote Link to comment
CJA Posted March 26 Author Share Posted March 26 Slight Issue... Tag appears to work... However... It has appeared to Turn off the WinDoor tools capability to toggle the 'opaque' option. It thinks for a second and then switches the option off again straight away. Is this because it thinks the code is telling it to be opaque instead of just reading the value? Quote Link to comment
Tom W. Posted March 26 Share Posted March 26 27 minutes ago, CJA said: Slight Issue... Tag appears to work... However... It has appeared to Turn off the WinDoor tools capability to toggle the 'opaque' option. It thinks for a second and then switches the option off again straight away. Is this because it thinks the code is telling it to be opaque instead of just reading the value? The only way I can replicate this is if I have 'Link to calculated/user-entered field' enabled in the 'Define Tag Field' dialog. Does this apply in your case? If so, uncheck it. You don't want that to be checked. Otherwise it works fine at this end... Quote Link to comment
CJA Posted March 26 Author Share Posted March 26 Yes! Thank you that's worked. Thanks for the Tip Tom W. I will now read up on what that field does. Thanks again. 1 Quote Link to comment
Tom W. Posted March 26 Share Posted March 26 1 minute ago, CJA said: Yes! Thank you that's worked. Thanks for the Tip Tom W. I will now read up on what that field does. Thanks again. Cool. What 'Link to calculated/user-entered field' does is transfer all of the text in the Current Tag Field Definition (or User-entered field) to a chosen data destination. So for example your Current Tag Field Definition might have multiple data sources which return the make, model number + manufacturer of an object + all of these could be combined into a single text value transferred to the ‘Description’ field of that object. 2 Quote Link to comment
Pat Stanford Posted March 26 Share Posted March 26 The @Colon syntax is for data tags (and probably other objects using the # Dynamic text) only. I probably would have used the @WS_IF versions also for myself, but for this specific application not having to do WS calculations seemed like the better way. 2 Quote Link to comment
Pat Stanford Posted March 26 Share Posted March 26 Another way to think about the Ternary (@ Colon) operators is: Display the stuff before the @ If the stuff in the middle evaluates to false then display the stuff after the colon. 2 Quote Link to comment
CJA Posted March 27 Author Share Posted March 27 9 hours ago, Pat Stanford said: I probably would have used the @WS_IF So Pat, If I learn the worksheet functions I'll be able to use them in the data tag tool ( as long as I use the right prefix & suffix) and I'm taking it other tools as well where there is input for dynamic text. Quote Link to comment
Pat Stanford Posted March 27 Share Posted March 27 I know that worksheet functions work in Data Tags when surrounded like: #WS_SomeWorksheetFunction(XXXXX)# It can be more complicated than a single function so you can get two values and multiply them and return the value as a string or something similar. Or use nested IF functions if necessary. But between the #WS_ and the ending # all of the "terminology" must be worksheet terminalogy only. You can't mix Data Tag functions into the middle of a worksheet function. So you would have to use 'Record'.'Field' and not #'Record'#.#'Field'# I believe that WS functions can be used in other dynamic text locations as well, but they may be much less useful. The 1:1 relationship between a Data Tag and an object in the drawing basically acts the same as the 1:1 relationship in a Worksheet Database Subrow. This means that you can access the data associated with that specific object. Other object types that use Dynamic Text probably don't have the 1:1 relationship with an object so many of the WS functions will not operate properly. But that last paragraph is almost entirely a guess on my part. Or at least I can't remember the results of any tests I have run to prove it right or wrong. Quote Link to comment
Tom W. Posted March 27 Share Posted March 27 You can use WS functions in Graphic Legends in the same way as Data Tags. 1 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.