Jump to content

function to check 'sum values' in DB column?


Sebastiaan

Recommended Posts

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 by Sebastiaan
Link to comment

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.

  • Like 1
Link to comment
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

Link to comment

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.

  • Like 1
Link to comment
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!

 

 

Link to comment

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.

×
×
  • Create New...