JMR Posted October 23, 2020 Share Posted October 23, 2020 Is it possible to do math with data tags? Example: A Data tag reads the door rough opening width 1100. The number 1100 is divided by 100, leaving 11. Letter M is added, thus final text on the tag would be "11M“. This is just one example, I can think of many others uses as well. Quote Link to comment
Vectorworks, Inc Employee TDimov Posted October 26, 2020 Vectorworks, Inc Employee Share Posted October 26, 2020 Yes, it is possible. The formula for the example you've given would be "#Door#.#ROWidth# / 100 M". However, you can also change the units in which the result is shown, as I suspect that is what you want. The pop-ups are below the "Parameter Name" pop-up and the formula would be "#Door#.#ROWidth##m_0_1#". 1 Quote Link to comment
JMR Posted October 26, 2020 Author Share Posted October 26, 2020 Excellent, thank you! This is very good news indeed. In this case it's about the local door size denotation standards, the so called "modules" =M =100mm. Quote Link to comment
MSLD Posted October 30, 2020 Share Posted October 30, 2020 I'm not having success. I tried to calculate cost of sheet goods, where is would show #Area# *.5 (for 50 cents a square foot), the data tag shows '150 sq ft * .5' without doing the math Quote Link to comment
Pat Stanford Posted October 30, 2020 Share Posted October 30, 2020 If you just use #Area# do you get the unit marks? If so, then it is probably returning a string instead of a number and math only works on numbers. For many of the PIOs, there are fields that are the numeric version and fields that are the string version including the units. I don't know if there is a numeric version of the Area function. Quote Link to comment
Vectorworks, Inc Employee TDimov Posted October 30, 2020 Vectorworks, Inc Employee Share Posted October 30, 2020 Write the formula as "#AREA# * 0.5" or "#AREA# / 2". Quote Link to comment
MSLD Posted October 30, 2020 Share Posted October 30, 2020 Adding the zero to 0.5 makes it work, but it still keeps the units as square feet. Using VALUE(#AREA#) returns VALUE(150 sq ft). It works in the report, but not in the tag Quote Link to comment
Vectorworks, Inc Employee TDimov Posted October 30, 2020 Vectorworks, Inc Employee Share Posted October 30, 2020 Data Tags use a different system for formulas from worksheets. Try using "#AREA# / 1sq ft * 0.5". You should use the unit in which you'd display the area (the document unit as it is written here or the unit you've selected from the unit popup) and keep the 1 and the unit mark without a space between them. 1 Quote Link to comment
JMR Posted November 23, 2020 Author Share Posted November 23, 2020 Now I have a nice data tag displaying the door size automatically, thank you all! The only thing missing is: How to read the handedness of the door automatically? Anyone know if this is possible? With worksheets I've looked into a combination of IsFlipped and rotation and IF formulas, but so far no solution for all situations. If we could solve this last bit, then there would be no need for manual size and handedness input any longer, eliminating the possibility of errors. Quote Link to comment
Vectorworks, Inc Employee TDimov Posted November 24, 2020 Vectorworks, Inc Employee Share Posted November 24, 2020 Since VW26 the Data Tag also has a conditional expression. If that is all you use in the worksheet it should be possible to do it in the Data Tag. What exactly is your worksheet formula? Quote Link to comment
JMR Posted November 24, 2020 Author Share Posted November 24, 2020 Currenty I'm using =IF((C2=1); '-L'; '-R') This refers to IsFlipped column. For simple door, IsFlipped returns 0 if the door is not flipped (right-handed) and 1 if it's flipped (left-handed). BTW I just realized why "IsFlipped" works on a swing simple but not always on a swing bi-part door. When drawing a double leaf door, if the door is flipped in plan and the larger, active leaf is "leaf 2", then the "IsFlipped" value will be misleading. If the active, larger leaf is "leaf1", then it works properly. Below is an example: The door is not flipped, even though it is "left" handed. Leaf 1 is the smaller leaf, thus creating confusion. The correct way to draw this would be to flip the door (IsFlipped=1=left) and give the active leaf the larger width. Am I missing something...or can one use the "IsFlipped" to indicate handedness automatically, if one is careful with double doors...? Quote Link to comment
Vectorworks, Inc Employee TDimov Posted November 24, 2020 Vectorworks, Inc Employee Share Posted November 24, 2020 Sorry, I thought IsFlipped is a parameter of the door. I don't think you recreate the formula 1 to 1 in the Data Tag. However, the syntax for conditions is "<ExprIfTrue>@"<Condition> : <ExprIfFalse>". Hope this can help somehow. As for the doors: I'm not really familiar with them and can't help there. Quote Link to comment
MSLD Posted November 24, 2020 Share Posted November 24, 2020 Not quite sure how to use <ExprIfTrue>@"<Condition> : <ExprIfFalse>". in a data tag. I'm trying to make a tag that will look at the area of a rectangle, and if the area is over 100, will say "too large". I tried =IF((#AREA#>100), 'Too Large', 'Too small'), which will work in a worksheet, but not in a tag. What am I missing? Quote Link to comment
Vectorworks, Inc Employee Vlado Posted November 24, 2020 Vectorworks, Inc Employee Share Posted November 24, 2020 @MSLD the formula you should use for this is: "Too Large"@#AREA#>100sq m:"Too small" As @TDimov said, the data tag condition expression is: <Value_If_True>@<The_Condition>:<Value_If_False> Note, you have to be careful with the spaces around the condition, it does not expect any spaces. It is known problem that the Data Tag uses its own syntax for the formulas. It's at the top of our list to make it use Worksheet formulas in the future. 4 Quote Link to comment
MSLD Posted November 24, 2020 Share Posted November 24, 2020 Brilliant. Thank you. Is there any documentation for that? Or should I not bother making data tags if the syntax is going to change. Quote Link to comment
Vectorworks, Inc Employee Vlado Posted November 24, 2020 Vectorworks, Inc Employee Share Posted November 24, 2020 @MSLD Well, we always see to convert over when we change things. So please, don't hesitate to use it at its full capabilities. You can get really nice results. As for help, click F1 on the Define Tag Field dialog, it leads here: https://app-help.vectorworks.net/2021/eng/index.htm#t=VW2021_Guide%2FAnnotation%2FCreating_data_tag_styles.htm%23CSH_41 The collapsed parameters on #8 is talking about the field definition syntax. 1 Quote Link to comment
JMR Posted November 25, 2020 Author Share Posted November 25, 2020 15 hours ago, Vlado said: It is known problem that the Data Tag uses its own syntax for the formulas. It's at the top of our list to make it use Worksheet formulas in the future This was going to be my next question. If I interpret this correctly, in the future it will be possible, in principle, to use any worksheet function with data tag? Including the "IsFlipped" function. Quote Link to comment
Vectorworks, Inc Employee TDimov Posted November 25, 2020 Vectorworks, Inc Employee Share Posted November 25, 2020 1 minute ago, JMR said: This was going to be my next question. If I interpret this correctly, in the future it will be possible, in principle, to use any worksheet function with data tag? Including the "IsFlipped" function. That's the goal. 1 Quote Link to comment
JMR Posted January 22, 2021 Author Share Posted January 22, 2021 I'm currently trying to do something like this: "#ΔX# / 3000" -this way the division calculation works fine "3000 / #ΔX#" -doesn't work, the characters "3000 /" are just printed and not included in the calculation. How do I divide some number with eg. delta X? Is there a specific syntax that I should use? BTW vesion 2020 SP6 so far. Quote Link to comment
JMR Posted January 22, 2021 Author Share Posted January 22, 2021 Strange. if I write 3000*#ΔX# - works 3000/#ΔX# -doesn't work Quote Link to comment
Vectorworks, Inc Employee TDimov Posted January 22, 2021 Vectorworks, Inc Employee Share Posted January 22, 2021 @JMR In 2021 the calculation logic was completely changed and is more lenient. In 2020 there were strict restrictions on the operands. "#ΔX# / 3000" divides a length by a scalar which is in itself a length. "3000*#ΔX#" is similar in that it multiples instead of dividing. "3000 / #ΔX#" would divide a scalar by a length which would result in a unit of 1/m. It's not a standard VW unit so I chose to prohibit such calculations. Should be doable in 2021 but if you provide more details of what you want to achieve I may offer a workaround for 2020. Quote Link to comment
JMR Posted January 22, 2021 Author Share Posted January 22, 2021 Ok thanks. I do have VSS so I guess it's time to update very soon. I'm designing a facade with fibre-concrete sheets that come in size 1200x3000mm. Ideally, the most economic divisions are therefore eg. 300,400,600 and 300,500, 600,1000 etc. I'm trying to use the data tag as a tool to quickly check and demonstrate to the client if the desired sheet can be economically cut out from a 1200x300 full-size sheet. This has to do with finding the optimal solution when it comes to looks and waste/cutting. "#ΔX# / 3000" kind of works but it returns 0.33 for a 1000mm etc, not so easily demonstrated to a client. Quote Link to comment
Vectorworks, Inc Employee TDimov Posted January 22, 2021 Vectorworks, Inc Employee Share Posted January 22, 2021 I think the following should be of use to you: Create a new record format and add a dimension field. Attach the record to the Data Tag or the tagged object. Change the formula to be "#Record#.#Field# / #ΔX#". The result would be a scalar (I think what you need - the number of divisions from the sheet). Quote Link to comment
JMR Posted January 22, 2021 Author Share Posted January 22, 2021 Thank you. I got it working for a second, then it disappeared and can't get it to work...enclosed is a sample file, in case you'd want to take a look? The definition reads: #ΔX#x#ΔY# circumference #PERIM# area #AREA##sq m_0_1# #datataghelper#.#FullLength# / #ΔX# #datataghelper#.#FullWidth# / #ΔY# What I see data-tag test.vwx Quote Link to comment
JMR Posted January 22, 2021 Author Share Posted January 22, 2021 Helper record is set to "integer"...is this correct? 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.