Assembly Posted March 22, 2013 Share Posted March 22, 2013 I have a custom PIO, in a Worksheet i want a forumla that sums all the width values. How do I write this as a single expression?. I thought it might be something like: = Sum('StudFrame-3D_V2'.'StudWidth') But it needs a search criteria so I thought maybe: =DATABASE((PON='StudFrame-3D_V2') & ('StudFrame-3D_V2'.'StudWidth')) Can't find anything in the help. Quote Link to comment
Hippocode Posted March 23, 2013 Share Posted March 23, 2013 (edited) =DATABASE((PON='StudFrame-3D_V2') This will load all the objects that match your criteria in the database subrows. ='StudFrame-3D_V2'.'StudWidth' The above statement ( without the SUM ) will load the chosen PIO/record field values into each subrow in one column. The databaserow (not the subrow) should be showing a sum of all widths for that column Edited March 23, 2013 by hippothamus Quote Link to comment
Assembly Posted March 23, 2013 Author Share Posted March 23, 2013 Thanks Hippothamus. But that requires the a database row. I want to be able to do this as a single entry in a spread sheet row. Examples of this are: If you want to find the length of all FramingMember PIO's, whose width is 45mm, depth is 300mm and has a structural use of 'beam', and to do some fine tuning on where vectorworks is to find these objects then your expression looks like this: =CRITERIAVOLUME((INSYMBOL & INOBJECT & INVIEWPORT & (L='Mod SCHEDULE') & ('FramingMember'.'width'=45) & ('FramingMember'.'height'=300) & ('FramingMember'.'structuralUse'='beam')))/(45/1000*300/1000) Another example: To find the area of wall component 1 in Wall Style 'SIP-Shingle' you express like this. =COMPONENTAREA(INVIEWPORT & INSYMBOL & (L='Mod SCHEDULE') & (WST='SIP-Shingle'), 1) Now if you want to utilise VW for BIM you will quickly find that any time you make changes to a wall style, or slab style, that affects the components order then worksheet management becomes a total pain in the a$$. VW is capable BIM tool for measurement, but at a rather tedious one to use. Further more as the ComponentArea search is an integer of component in the wall, it is very easy to not notice that you are measuring an incorrect component. The solution is a vectorscript that generates the worksheet on the fly. IE one that creates an array of wall styles, then an array of component styles, sorts the array and reduces to one instance of each wall and component style. That then writes these formula for you. The logic being that if you pick up everything each time you know your always covered. I have success on walls, slabs, roofs, windor and Framing member. What I want now is to be able to do sum a PIO parameter value, without creating a database line value. Doing exactly what you have outlined above in a single cell expression. Can someone from NA please tell me if this is possible. Cheers Quote Link to comment
Miguel Barrera Posted March 24, 2013 Share Posted March 24, 2013 If you already know vectorscript, why not do all the calculations that you want in the worksheet with a script? You can populate the worksheet directly without having to deal with formulas and whenever variables change, you just run the script again. Quote Link to comment
Assembly Posted March 24, 2013 Author Share Posted March 24, 2013 (edited) That is an option, But i would like to maintain consistency. I'm using the WS search criteria to Limit the search to objects on the MOD-schedule layer. To do this through the script requires a different ForEachObject call to build the array, and it will affect the down stream functions If I can use the same method I would prefer it. Edited March 24, 2013 by Assembly Quote Link to comment
Hippocode Posted March 25, 2013 Share Posted March 25, 2013 That is an option, But i would like to maintain consistency. I'm using the WS search criteria to Limit the search to objects on the MOD-schedule layer. To do this through the script requires a different ForEachObject call to build the array, and it will affect the down stream functions If I can use the same method I would prefer it. With script it will be much easier. That layer can be added in the search criteria for the for each loop. If the layer is variable, you just make it that the active layer becomes a part of the search criteria, giving you the choice to run your script on each sepparate layer. Also, if you let the script check if a cell in your worksheet is allready filled it can skip to the next one, not erasing previous data... Quote Link to comment
Assembly Posted March 25, 2013 Author Share Posted March 25, 2013 Building on the code I have already developed, it will be simplest to generate the search strings for the WS cell. If it can't be done then I will calculate through script. Can a Nemetschek person please at least confirm if this is possible or not: Is there a way to write a single cell expression that sums the values of a PIO parameter? Quote Link to comment
bcd Posted March 25, 2013 Share Posted March 25, 2013 Why not drop the SUM badge on the Width column? Quote Link to comment
Assembly Posted March 25, 2013 Author Share Posted March 25, 2013 Because I am using vectorscript to write the worksheet. If it is possible to write creat a single cell formula it will save me time. The code design requires a string To be passed to the cell. I can compute a value withand pass that. All the wall slab and roof tools have calls that allow single expression for file wide data. There are clear advantages over using database rows interms of formatting a work sheet. Now I've got my head arround how the WS paste function and criteria formula work I like it. A further advantage of writing single cell formula is how quick it is to customise a new search once you have the base formula. I have four values I need totalled in this one PIO. Using the database method I think i would need an individual database row for each value I need summed. Given the lack of response from Neme, I'm guessing I can't. Mark it up as yet annother inconsistent VW workflows. 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.