Grzegorz Krzemien Posted July 13, 2020 Share Posted July 13, 2020 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 Quote Link to comment
Vectorworks, Inc Employee Nikolay Zhelyazkov Posted July 13, 2020 Vectorworks, Inc Employee Share Posted July 13, 2020 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 Quote Link to comment
Pat Stanford Posted July 13, 2020 Share Posted July 13, 2020 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. Quote Link to comment
Grzegorz Krzemien Posted July 14, 2020 Author Share Posted July 14, 2020 @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# ? Quote Link to comment
Pat Stanford Posted July 14, 2020 Share Posted July 14, 2020 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. 3 Quote Link to comment
Grzegorz Krzemien Posted July 15, 2020 Author Share Posted July 15, 2020 @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. Quote Link to comment
Pat Stanford Posted July 15, 2020 Share Posted July 15, 2020 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? Quote Link to comment
Grzegorz Krzemien Posted July 16, 2020 Author Share Posted July 16, 2020 @Pat Stanford Values in OIP does show unit marks. Values without OIP does not. Quote Link to comment
Vectorworks, Inc Employee TDimov Posted July 17, 2020 Vectorworks, Inc Employee Share Posted July 17, 2020 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#. 1 Quote Link to comment
Grzegorz Krzemien Posted July 17, 2020 Author Share Posted July 17, 2020 Thanks, I need to check this, but anyway can't wait for VW2021 then 🙂 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.