Jump to content

Data tags and mathematical operations?


JMR

Recommended Posts

Ok thanks, now it's working!

 

image.thumb.png.983bd1c545fe4aceaf30523350f555ff.png

 

Is there a way to round the calculation down to the closest integer? That way I could calculate the loss percentage as well.

 

Eg. the second row from the bottom is as follows currently:

Divs in L #datataghelper#.#FullLength# / #ΔX##m_1_0#

 

The meter and .1 accuracy is to get rid of too many decimals.

 

 

data tag sample.vwx

Link to comment
  • 10 months later...

Hey folks - I'm not getting anywhere trying to find the 2022 docs for this so here's the question:

Can I use the Roundup function within a data tag?

 

=Roundup(#AREA##sq ft_1_0#/150*0.67,1)

 

is what I'm trying to do, and it just shows that text in the tag. The math works without the Roundup call.

thanks

Link to comment
  • Vectorworks, Inc Employee
On 12/10/2021 at 7:47 PM, techdef said:

Hey folks - I'm not getting anywhere trying to find the 2022 docs for this so here's the question:

Can I use the Roundup function within a data tag?

 

=Roundup(#AREA##sq ft_1_0#/150*0.67,1)

 

is what I'm trying to do, and it just shows that text in the tag. The math works without the Roundup call.

thanks

- Hello @techdef,

 

You can use the worksheet functions in the data tag as of VW 2022 but you cannot mix them that much to get what you are wanting here. What is possible atm is to have "#WS_ROUNDUP(AREA, 1)#" which will return rounded up area in document units, but you cannot add the unit overriding here.

 

Anyway, if you want to get the area in some different units than the document units and you want customized precision, just select Object Function Area, then select the desired units and precision and this should get the job done for you without the need to use roundup:

 

image.png

 

Best Regards,

Nikolay Zhelyazkov

Link to comment
  • 1 month later...

Hi,

 

greetings and very interesting thread.

 

Is this data tag possible (i struggle with it).

 

IF((#OSTYLE#='Raum Neu'), SUM#Space#.#Area#, 0)

 

If Objectstyle on active Layer = 'Raum Neu' sum 'Space'.'Area' otherwise show '0'

Objectstyle 'Raum Neu' = only space objects

 

Is it possible to sum in data tags or sum if?

 

/ / / 

 

I got the summed Space Area in a worksheet field.

Can i set a link in data tag to this specific worksheet field? 

how is the data tag formula for linking to workheets?

 

 

Greetings from Germany

Tobi

Edited by Tobias Kern
Link to comment
  • Vectorworks, Inc Employee

Hello @Tobias Kern,

 

The data tag worksheet formula works like this - anything between #WS_ and # is being evaluated in the same way as if it is written in a database worksheet row for the tagged object. So, if some formula works fine in a database worksheet cell you can copy it and paste it in the data tag's formula between #WS_ # and you will get the same result. If the formula is not working in a worksheet database cell, then it will not work in the data tag as well.

 

On 1/15/2022 at 12:02 PM, Tobias Kern said:

IF((#OSTYLE#='Raum Neu'), SUM#Space#.#Area#, 0)

 

If Objectstyle on active Layer = 'Raum Neu' sum 'Space'.'Area' otherwise show '0'

Objectstyle 'Raum Neu' = only space objects

 

Is it possible to sum in data tags or sum if?

- Based on the information from above, this is not possible. The data tag operates on one object only. It cannot sum the values from different objects. You can do such operations with a worksheet. If you want to have this information in the drawing you can put that worksheet on the drawing.

 

On 1/15/2022 at 12:05 PM, Tobias Kern said:

does exist a overview for all possible data tag formulas?

 

for worksheets we got one, but not for data tags!

https://developer.vectorworks.net/index.php/Worksheet_Functions/de

- You can check the help site for information about data tags - https://app-help.vectorworks.net/2022/eng/VW2022_Guide/Annotation2/Using_data_tags.htm#h1

As for the data tag worksheet functions, they are the same as the worksheet functions which can be used in a database context, as explained above.

 

Best Regards,

Nikolay Zhelyazkov

  • Like 1
Link to comment

Hi Nikolay,

 

greetings and thnx for your reply.

 

It's good to know: #WS_ ....#

I will try it out.

 

WISHES:

 

1.

Data tag should also have access to worksheets (fields) and vice versa.

This would be very helpful!

 

2.

If Data tags can use worksheet formulas, then it should also be

possible to do such calculations as i descriped:  

 

If Objectstyle (on active layer) = 'Raum Neu' sum 'Space'.'Area' otherwise show '0'

 

If more then one object could be queried, and if we could sum, we can create data tags

like summing all spaces one apartment, or other interesting stuff.

 

… that would much increase the use for data tags.

 

 

On the Public Roadmap, under Active Research there is "Set flats".

https://www.vectorworks.net/en-US/public-roadmap 

 

One part of that could be to sum the area of a flat, and this

could be done with an enhanced data tag.  

 

Greetings from Germany

Tobi

Link to comment
  • Vectorworks, Inc Employee

Hi @Tobias Kern,

 

There is one major thing about the difference between Worksheets and Data Tag.

 

The Data Tag is associated and reports data of one object. It does allow access to Worksheet functions but only the ones that are related to a single object. This means that you cannot query or work other objects in the drawing. So, when we talk about using Worksheet functions in the Data Tag, this only means the ones that extract information from one object only, e.i. non-criteria based functions.

 

Worksheets can work in two modes:

1. A regular cell, which you use Worksheet functions with criteria. This is a mode where the functions will extract information from the entire drawing.

2. A Database cell, which uses non-criteria functions, because the objects are determined by the DB criteria.

 

Now, worksheets cannot mix #1 and #2 in one cell. This means that you cannot use criteria-functions in a DB row context. But you can have a cell combining different cells by logic.

 

The Data Tag does not support #1 at all.

 

However, I understand the need, and it would make it a great improvement in the future.

 

For now, you have to use a Worksheet to achieve such reporting.

 

Regards,

Vlado

 

  • Like 2
Link to comment
  • 2 weeks later...

Hi!

 

I use lots of Data Tags when documenting and found this post very useful.

In this file I try to make Data Tags show Structural Member Major Breadth and Depth in centimeters. File units are meters and precision set to 5 decimals; here seems that values are automatically showed in mm and 6 decimals?

 

In a Worksheet where I resume all Structural Members for concrete quantity calculations I used succesfully this formula: =VALUE('StructuralMember'.'D')/10 to convert and show them as I want (cm.) but here with Data Tags I can`t make it work. What shows in Data Tags as "400.000000" or "300.000000" should be "40" and "30".

 

Also add other dynamic field to input Structural Member ID in the same Data Tag, this works fine too adding it to each element.

 

Other thing I found difficult to work with is the delay that occurs when editing Data tags. In this file are near 150 for each Style and there´s a delay when updating each Style; I use to work in files with thousands of the same style (asset inventory) and when editing its very slow, occasionally crashing VW (2022 SP2.1)

I think it would be convenient work with these Data Tag Styles on other file with less elments on wich apply them but also think it´s not so practical.

 

Hardware is MacBook Pro (16-inch, 2019 2,3 GHz 8-Core Intel Core i9

16 GB 2667 MHz DDR4

AMD Radeon Pro 5500M 4 GB

Intel UHD Graphics 630 1536 MB)

 

Can you help me?

Thanks!

 

1722772562_ScreenShot2022-01-27at08_00_41.png.4374a9ab1285739a27d0f1f35eba5780.png897073687_ScreenShot2022-01-27at08_01_25.thumb.png.71664fd3fcdea69e5a92454a97e53c1f.png1079628210_ScreenShot2022-01-27at08_07_05.thumb.png.31c04baaa508f2faf6c96cc5d37220a3.png1973110817_ScreenShot2022-01-27at08_24_48.thumb.png.32e65b693c112d3f37d38f54d01ad3c6.png

  • Like 1
Link to comment

Hi @gfilippini

Im not sure hove to solve your problem but I love Datatags and interested to se creative ways of their use. 

For some parameters it is possible to select the units but i see in your screenshot it is grayed. 

I think you can after the formula add /1000 or whatever you want to divide with. This will work until you change the units in the document 

  • Like 2
Link to comment
  • Vectorworks, Inc Employee
1 hour ago, gfilippini said:

In this file I try to make Data Tags show Structural Member Major Breadth and Depth in centimeters.

 

Other thing I found difficult to work with is the delay that occurs when editing Data tags. In this file are near 150 for each Style and there´s a delay when updating each Style;

 

If the field you're extracting data from is defined as being a length, area, volume, or angle you will be able to override the displayed units using the 3 controls bellow the field selection.
As for the style: when you change a part of the style (like a parameter or the layout) that is set to be "By style" that change has to be applied to all objects using that style. That is standard Vectorworks behaviour.

  • Like 1
Link to comment
2 hours ago, Hans-Olav said:

Hi @gfilippini

Im not sure hove to solve your problem but I love Datatags and interested to se creative ways of their use. 

For some parameters it is possible to select the units but i see in your screenshot it is grayed. 

I think you can after the formula add /1000 or whatever you want to divide with. This will work until you change the units in the document 

Hi Hans,

Thank you!

I´ve tried different formulas in the dynamic field without results. Hope with some additional help make this work. The units definition cannot be overrided through the dialog box selection. I don´t know in which units are expressed "B" and "D" values for structural members. The same problem appears when using those in worksheet but there with te formula I can solve. That´s why I assume in Data Tag is possible too.

 

Screen Shot 2022-01-27 at 12.12.12.png

Screen Shot 2022-01-27 at 12.11.36.png

Screen Shot 2022-01-27 at 12.24.31.png

Link to comment
  • Vectorworks, Inc Employee

Hello @gfilippini,

 

It seems like the fields you would like to show are text fields and that is why the data tag cannot do any mathematical operations with them. You can try using the same WS formula in the data tag though, like this:

 

#WS_VALUE('StructuralMember'.'B')/10#

 

Best Regards,

Nikolay Zhelyazkov

  • Like 3
Link to comment
2 hours ago, TDimov said:

 

If the field you're extracting data from is defined as being a length, area, volume, or angle you will be able to override the displayed units using the 3 controls bellow the field selection.
As for the style: when you change a part of the style (like a parameter or the layout) that is set to be "By style" that change has to be applied to all objects using that style. That is standard Vectorworks behaviour.

 

TDimov,

I suppose "B" and "D" values are in mm. because of its dimensions in the model are ok (model units is meters) and so I wanted to express them in cm. wich is the unit we are used to for this.

Data Tags are very easy to manage and useful on Saved Sheets for printing or saved wiews for showing or not while drawing and checking the model.

Any comments welcome!

 

1575370763_ScreenShot2022-01-17at15_39_42.thumb.png.570fc396394bffc16651c3db58f000f1.png326744166_ScreenShot2022-01-27at12_39_06.thumb.png.e6206b6a557e61e0884b9e2391b31907.png

Screen Shot 2022-01-27 at 12.40.27.png

Link to comment
6 minutes ago, Nikolay Zhelyazkov said:

Hello @gfilippini,

 

It seems like the fields you would like to show are text fields and that is why the data tag cannot do any mathematical operations with them. You can try using the same WS formula in the data tag though, like this:

 

#WS_VALUE('StructuralMember'.'B')/10#

 

Best Regards,

Nikolay Zhelyazkov

Hi Nolay,

I was just writing the previous post

I´ll try and comment.

Thank you!

Link to comment
  • Vectorworks, Inc Employee
1 minute ago, gfilippini said:

I suppose "B" and "D" values are in mm. because of its dimensions in the model are ok (model units is meters) and so I wanted to express them in cm. wich is the unit we are used to for this.

They may be a valid length but the Data Tag relies on the parameter's/field's defined type to determine whether their units can be changed. And as Nikolay said they appear to be plain text. Maybe try the WS function as he suggested.

  • Like 1
Link to comment
  • 10 months later...

Hello - 

I am trying to use the data tags to show relative elevation + 481' (sea elevation). I am using the data fields as follows:

#ZTBBG##fi_2_1#+481.00'

The result on the tag is 9.62000000000000e02'.  I need this to return in feet (XXX.XX'). The math is correct as right now I'm summing 481' + 481' = 962'. #ZTBBG##fi_2_1# returns 481.00' in the proper format.  

I'm attaching screenshots of the data field and the resulting tag. 

 

Screen Shot 2022-12-23 at 8.55.20 AM.png

Screen Shot 2022-12-23 at 8.55.59 AM.png

Link to comment
23 hours ago, mlizarraga said:

I am trying to use the data tags to show relative elevation + 481' (sea elevation)

 

I wonder, is there a way to store a this height above sea level as a project variable....

At the beginning of a project, you type in the value and then your tags are magically correct by using math tied to a variable rather than a discrete value.

 

If this isn't possible, it should be as it would be a very powerful workflow across many applications.

 

@Pat Stanford thoughts?

  • Like 2
Link to comment

@jeff prince This is completely new to me so I don't know if this does what you need or not, but I think this will work.

 

Create a worksheet with a name of 'DefElev'. (Or whatever you want to name it. Just make sure you use that name in your tags.)

In cell A1 put the elevation offset you need.

 

Where you need to include that default elevation in your data tags set them up as follows:

 

image.png.50f9b9a71540d32b13fe121a810f23f9.png

 

The #WS_Value returns the value of a text cell in a worksheet.  

The Concat converts the numeric value in the cell into text so the Value can convert it back.

 

Or your could probably drop the Concat and put a single quote in front of the number in cell A1 to force it to be text.

 

In a file set to Feet and Inches you have to enter the value as inches.

 

Or you could use the math functions in the worksheet to do the conversion and then reference the calculated cell instead.

 

And you need to reset the data tags after the worksheet value is changed. Which is a 1 line script. And could be included as a Worksheet script so it will automatically run every time you change the value in the worksheet.

 

If this is something you think would be helpful let me know and I can see about refining it a little.

 

HTH

 

 

  • Like 3
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...