Jump to content

Data Tag Field Syntax - Math


Recommended Posts

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): 

511415673_ScreenShot2023-05-08at9_36_10AM.thumb.png.f0e101f9bcee7cf67aba284d0e868821.png

 

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. 

 

 

  • Like 1
Link to comment
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.

Link to comment
  • Vectorworks, Inc Employee

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.

  • Like 1
Link to comment
  • 3 weeks later...
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.

 

 

Link to comment
  • 3 months later...

okay, i have another one for ya. Now we are creating a tag to calculate the number of occupants at a bar. (1 occupant per 24"). I am looking to draw a line and access the area then divide that by 24" and of course always round up. 

 

Here is my current definition which does everything except the addition of the 0.49. Wondering if this is a real number/document distance issue again.. any help is appreciated. 

 

#PERIM##in_2_0#/24+0.49

 

 

 

Link to comment
On 5/8/2023 at 11:32 AM, bcd said:

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.

 

okay, i have another one for ya. Now we are creating a tag to calculate the number of occupants at a bar. (1 occupant per 24" linear). I am looking to draw a line and access the perimeter then divide that by 24" and of course always round up. 

 

Here is my current definition which does everything except the addition of the 0.49. Wondering if this is a real number/document distance issue again.. any help is appreciated. 

 

#PERIM##in_2_0#/24+0.49

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...