Sebastiaan Posted September 29, 2020 Share Posted September 29, 2020 (edited) Hi all, I'm taking my first steps in to Python scripting in Vectorworks. My first project is a worksheet script to create some database rows in a worksheet. What i could not find in the function reference is how to set the 'sum values' option for a column in a database row. Is there a script function for that? I found 'SetSprdSortSumColumns' to set summarize and sort, but could not see how to set 'sum values'. Thank you, Sebastiaan Edited September 29, 2020 by Sebastiaan Quote Link to comment
Pat Stanford Posted September 29, 2020 Share Posted September 29, 2020 Python: def vs.AddWSColumnOperator(worksheet, databaseRow, column, operatorType): return None With an operatorType of 2. Quote // EWSColumnDatabaseOperatorType - worksheet database column operator types. enum EWSColumnDatabaseOperatorType { kWSAllOperators = -1, kWSSortOperator = 0, kWSSummarizeOperator = 1, kWSSumValuesOperator = 2 The inverse function is vs.HasWSColumnOperator. I have no idea why these are named this way instead of using the standard Get and Set names. 1 Quote Link to comment
Sebastiaan Posted October 2, 2020 Author Share Posted October 2, 2020 On 9/29/2020 at 5:54 PM, Pat Stanford said: Python: def vs.AddWSColumnOperator(worksheet, databaseRow, column, operatorType): return None With an operatorType of 2. The inverse function is vs.HasWSColumnOperator. I have no idea why these are named this way instead of using the standard Get and Set names. Sorry for the late reply, but thank you! This works well. No wonder I could not find it, not only is the naming convention different than the other functions, but also the sum values operatortype 2 is not explained in the developer page? https://developer.vectorworks.net/index.php/VS:AddWSColumnOperator Quote Link to comment
Pat Stanford Posted October 2, 2020 Share Posted October 2, 2020 That is part of what makes this forum great. You have access to a number of nerds who have spent far too long digging into the depths of the documentation (and code) to figure some of this stuff out. I am looking at @MullinRJ, @Sam Jones, @JBenghiat. I apologize to all the rest of you who have helped me out over the years and am am drawing a blanks on right now. I think the programming community here for Vectorworks is probably the most helpful (and polite) group I have ever experienced. 1 Quote Link to comment
Sebastiaan Posted October 2, 2020 Author Share Posted October 2, 2020 50 minutes ago, Pat Stanford said: That is part of what makes this forum great. You have access to a number of nerds who have spent far too long digging into the depths of the documentation (and code) to figure some of this stuff out. I am looking at @MullinRJ, @Sam Jones, @JBenghiat. I apologize to all the rest of you who have helped me out over the years and am am drawing a blanks on right now. I think the programming community here for Vectorworks is probably the most helpful (and polite) group I have ever experienced. I am very happy that all of you are here! All of you have inspired me to follow an online Python course, and now I am trying to use that basic knowledge to make my own magic and it's going quite well! But I would never be able to, without all the helpful users, information and example code in this forum! 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.