Antonio Landsberger Posted July 5, 2021 Share Posted July 5, 2021 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 Quote Link to comment
Vectorworks, Inc Employee Judah Warshaw Posted July 5, 2021 Vectorworks, Inc Employee Share Posted July 5, 2021 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); 2 Quote Link to comment
Pat Stanford Posted July 5, 2021 Share Posted July 5, 2021 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. 1 Quote Link to comment
Antonio Landsberger Posted July 6, 2021 Author Share Posted July 6, 2021 Thank you @Judah Warshaw and @Pat Stanford, both answers are super helpful. I will probably try both of them! I already had thought about preparing a worksheet with everything in place in case I could not create the report through scripts. 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.