Jump to content
GRZEGORZ

Data tags and units

Recommended Posts

Hi all,

I have a problem with Data Tags.

 

My custom data tag should return window's width. But despite the document units, data tag always shows number in millimetres. Option "document units" is unavailable in edit data tag mode. In my file there is a second tag that works correctly.

 

Second question is, if it is possible to do simple math operations inside data tag definition.

E.g. I want to show in my tag "windows width" - 10.

I tried to use following formula "#CWDObj#.#OpeningWidth# - 10" but it is recognised as text and displays as 1000 - 10 on my tag.

Any hints?

DataTags.vwx

Share this post


Link to post

Hello @GRZEGORZ,

 

You will be able to do calculations and change the units of the parameter being displayed if its type is number or dimension. Seems like the opening width of object VWDObj is a text parameter and that is why you have these results.

 

Best Regards,

Nikolay Zhelyazkov

Share this post


Link to post

I don't know about the CW Windows, but the stock US windows have multiple fields for some items with one being a dimension and the other being a text representation. You might want to check and see if there is an alternate field you can use.

Share this post


Link to post

@Pat Stanford, thanks for a hint.

Yes, there is a second formula #CWDObj#.#OIPOpeningWidth# that is working fine, but math operations still do not work.

My formula looks like this:

#CWDObj#.#OIPOpeningWidth# - 10

Maybe I am missing something like:

#CWDObj#.#OIPOpeningWidth# - #10#

?

Share this post


Link to post

First check what the field type of the PIO are. In the thread below, I posted a script that will create a worksheet listing all (even the hidden ones) and also shows the type of data stored.  In a new file, place an instance of a window directly on the layer (not in a wall), leave it selected and run the script. 

 

From the resulting worksheet you should be able to see what the data type of each field is. If there is a numeric version of the data you are interested in, then we can chase the issue of doing the math in the tag.

 

 

  • Like 3

Share this post


Link to post

@Pat Stanford, I used your script and got results (attached file).

'CWDObj'.'OpeningWidth' and 'CWDObj'.'OpeningHeight' are "REAL", so they should be numbers, but they do not change according to current document units.

'CWDObj'.'OIPOpeningWidth' and 'CWDObj'.'OIPOpeningHeight' are "Real - Coordinate Displacement". I have no idea what this kind of data type is, but it is working. Information is correct in terms of document units.

Do you know the difference between these two data types? I can not use math operations on both results, so it looks like they are not numbers.

DataTagFieldsVals.png

Share this post


Link to post

As far as I know, Real and Real-Coordinate Displacement are both actual numbers that you should be able to do math on.

 

I think Real are generic values while Coordinate Displacement are distance from an origin point.

 

When you look at these values in the OIP, do they show unit marks?

Share this post


Link to post

Real parameters are unitless numbers so there's no way to choose a unit for them. If the type is a number representing a distance, area, volume or angle you will be able to change the units. In VW2020 you can't do operations with incompatible number types i.e. distance minus a unitless number. In VW2021 the formula calculation was extended to support such incompatible operations. In the meantime, create a record with a dimension field and attach it to the tagged object or the Data Tag. In the formula subtract that field from #CWDObj#.#OIPOpeningWidth#.

  • Like 1

Share this post


Link to post

Thanks, I need to check this, but anyway can't wait for VW2021 then 🙂

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...