Jump to content
Developer Wiki and Function Reference Links ×

Is there a way to create a worksheet report and set the criteria?


Recommended Posts

Hi folks,

 

I would like to be able to

1) create a worksheet (vs.CreateWS)

2) create a report (?)

3) set/edit the report criteria (?)

using VectorScript or Python/Marionette

 

For neither 2 or 3 was I able to find a corresponding VS command in the developer wiki:

https://developer.vectorworks.net/index.php?title=Category:VS_Function_Reference:Worksheets&pageuntil=SetWSCellFormula VS%3ASetWSCellFormula#mw-pages

 

Does anybody have an idea if there is a way to accomplish this?

 

Kind regards,

Antonio

Link to comment
  • Vectorworks, Inc Employee

If you look at the remarks section for https://developer.vectorworks.net/index.php/VS:SetWSCellFormula you will see:

 

If the 0 column is specified, a database row is created and the formula set as the database row criteria.

 

Some examples would be:
 


{ creates a database sub-row for the record 'Part Info' }
SetWSCellFormula(h,2,0,2,0,'=DATABASE(R IN [''PART INFO''])');

or 

dynCharArray := '=DATABASE(((R IN [''Window'']) & (''Window''.''OnSchedule''=TRUE)))';
SetWSCellFormulaN(tempHandle,4,0,4,0,dynCharArray);

 

You would then have to add the formula for each column for the field you want:

 

dynCharArray := '=(Window.IDLabel)';
SetWSCellFormulaN(tempHandle,4,2,4,2,dynCharArray);

 

  • Like 2
Link to comment

Reports are really just worksheets that can be brought in from other files. I think of them as template worksheets as once they are brought in they will then operate on the objects in the current drawing, but with all the formatting and formulas already in place.

 

Look at the ImportResourceToCurrentFile and ImportRestoCurrFileN functions. You will probably need to build a resource list to find the Reports in your library files.

 

But this way you don't have to edit the script if you need to change the content, just edit the Report from the library and import again.

  • Like 1
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...