AndrewBeres Posted May 8 Share Posted May 8 Hello, I am wondering if there is a data tag syntax guide floating around out there that I have not been able to find. I understand from other forum posts that worksheet functions are possibly accessible from data tags now? If this is true, I am not able to get them to function. Any help is greatly appreciated. Here is my specific issue: We have a data tag used for life safety plan calculations, pretty simple. We input the area factor and the use for each space and use the spaces area to calculate the number of occupants and display that in the tag. This works well, however we want to round the occupants up to the next integer value when there is a fraction. I have been able to round the number down, but per standard practice when calculating occupants you always take the number up to the next whole number(since you cannot have a fraction of an occupant in the building). Inorder to complete the math for the number of occupants, we do (space.area) / (load factor). I have seen people add .49 to this so that the number will always round up, but after I do the addition of .49 I cannot seem to get the number to round. I have tried a few different ways to complete the =round() but none have work for me in a data tag. Here is my tag field definition: #Space#.#AREA#/#Space#.#11_Proposed Area# +0.49 Here is the tag for reference (in this case i want the 8.743 to display as 9): Again, if there is a syntax guide out there I would love to have it for reference, otherwise any help with this specific problem is greatly appreciated. Quote Link to comment
bcd Posted May 8 Share Posted May 8 Try this: #Space#.#11_Proposed Area##doc area_0_1# Quote Link to comment
AndrewBeres Posted May 8 Author Share Posted May 8 23 minutes ago, bcd said: Try this: #Space#.#11_Proposed Area##doc area_0_1# That works to get me the proposed area in a whole number, but i need to do the division (area / proposed area), and then round that number up to the next whole number. Quote Link to comment
Tom W. Posted May 8 Share Posted May 8 1 hour ago, AndrewBeres said: I understand from other forum posts that worksheet functions are possibly accessible from data tags now? If this is true, I am not able to get them to function. Anything placed between #WS_ and # will work in the tag as if written in a database worksheet row for the tagged object. Quote Link to comment
bcd Posted May 8 Share Posted May 8 (edited) It looks like the Proposed Area #Space#.#11_Proposed Area# is being recorded as a real number rather than an area - so the division (& rounding) isn't working correctly. Edited May 8 by bcd 1 Quote Link to comment
AndrewBeres Posted May 8 Author Share Posted May 8 That solved it. Thank you! Here is the working field definition for record: #Space#.#AREA##doc area_0_1#/#Space#.#11_Proposed Area##doc area_0_1# +0.49 3 Quote Link to comment
Vectorworks, Inc Employee Scott C. Parker Posted May 10 Vectorworks, Inc Employee Share Posted May 10 Great data tag. Thanks for sharing the string. This reminds me of a venue that needed a label added near exit doors on a drawing to show the fire marshal how many inches of exit door opening were allotted to the total planned occupancy (number of chairs) of an event. 1 Quote Link to comment
kevin.hayward Posted Thursday at 03:06 PM Share Posted Thursday at 03:06 PM On 5/8/2023 at 2:46 PM, AndrewBeres said: In order to complete the math for the number of occupants, we do (space.area) / (load factor). I have seen people add .49 to this so that the number will always round up, but after I do the addition of .49 I cannot seem to get the number to round. I have tried a few different ways to complete the =round() but none have work for me in a data tag. I use the +0.49 if I want to round to the nearest whole number. OK, this is pseudo code: int((a/b)+0.49) is going to round the result to the nearest integer, up or down. I think you'd need to add 0.99 to your result to ensure you always round up. 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.