Jump to content

How to activate Google Spreadsheet


Recommended Posts

I would like to know about how I can activate Google Spreadsheets from Vectorworks .

 

I am struggling to output some data from Vectorworks using the code with Python.


I cannot find any solution so far, so I’ll appreciate with you if you give me any tips.

 

thanks.

 

Link to comment

If you’re looking to manually move data, you can go to the file menu in the worksheet window, and export as csv or Excel, and import to Sheets. 
 

If you want to use python to do this programmatically, it is definitely possible — VectorScript can read your worksheet data, and you can either use Google’s API and an OAuth key to write directly to a Sheet, or post the data to the sheet and process with an Apps Script. 

  • Like 1
Link to comment

The best solution depends a lot on exactly what you are trying to accomplish, and your current knowledge of Python and/or Javascript. This isn't the sort of thing where a 10-line example will give you what you need -- if you're new to coding, you may want to contract for this work on spec.

 

One caveat -- you aren't going to be able to have a live connection between VW and GS with Python. You may be able to get some live sync by using an ODBC connection in VW and an Apps Script to build the sheet. You should also be able to build a live connection via the SDK.

 

Possibly the most straight-forwards method is to write data to an Excel sheet on Google Drive, and then (if you don't want to manually import) create an Apps Script to import the Excel workbook into Sheets.

VS has commands for working with Excel files here: https://developer.vectorworks.net/index.php/VS:Function_Reference#Excel. You can also find third party Excel libraries for Python.

A tutorial for importing via Apps Scripts is here: https://spreadsheet.dev/automatically-convert-excel-spreadsheets-to-google-sheets-using-apps-script#use-apps-script-to-convert-excel-xls-xlsx-to-google-sheets

 

Similarly, you can use Python's csv library to export your data and read via App Script. 

 

 

If importing to Sheets seems daunting, you can use an intermediary service like Zapier, which can monitor a cloud drive or web hook and create your Excel data: https://zapier.com

 

 

If you want to create your Sheet  directly from Vectorworks's Vectorworks, start with these commands to read  worksheet data and formatting: https://developer.vectorworks.net/index.php/VS:Function_Reference#Worksheets

 

Google offers a Python API for working with worksheets. You can find an overview and examples here: https://developers.google.com/sheets/api/guides/values#python

 

 

Or a variant of that would be to use Python to post the data to the Sheet's web app, and process with Apps Scripts. https://trevorfox.com/2017/01/google-apps-script-doget-and-dopost-tutorial-6-web-app-examples/

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