MaxStudio Posted March 5, 2012 Share Posted March 5, 2012 Anyone have a simple example of a plugin object that adds or changes info on a worksheet? Im trying to do the following: Create a plugin object with some sort of label. Add that label to the worksheet. List the variables (width, height) of the plugin on the worksheet. If I change the width of the plugin object I would like it to change on the worksheet too. Is this possible? Any simple examples that might be a good place for me to start? Thanks Derek Quote Link to comment
Pat Stanford Posted March 5, 2012 Share Posted March 5, 2012 Derek, That is a default ability of all PIOs. Just set up a database and use the record.field format in the worksheet and you should be fine. For example ='door'.'width' will give you a column in the database showing the width field of the door PIO. Change it in the worksheet and it will update the object. Change the object and Recalculate the worksheet and it will update. If you don't have spaces in your PIO field names you dont' have to use the quotes, but it is safer. Quote Link to comment
MaxStudio Posted March 5, 2012 Author Share Posted March 5, 2012 Pat, Thanks. By creating a database do you mean a "record format"? When i click on the data tab of my plugin object it only lists a "record format" which is currently linked to my title block. Should I create another one for the plugin object? Derek Quote Link to comment
Pat Stanford Posted March 5, 2012 Share Posted March 5, 2012 When you create a PIO, you create a "hidden" record format that is called the parameter record. Depending on the type of PIO (Point, line, etc.), you will get some default parameters and you can then add as many other as you want/need. In the worksheet, there are two different types of rows, spreadsheet rows and database rows. Spreadsheet rows are like rows in Excel. Database rows automatically crease a sub row for each item that matches the criteria of the database. You create the database by clicking and holding on the Row Header (the column with the row number) and selecting Database. You then enter the criteria you want to use. As an easy way to play and see kind of how this works (assuming you have Architect), make a new blank file and put in a couple of windows. Make sure that you click the button in the OIP that says On Schedule. Now go to the Tool:Reports:VA Create Schedule and Select Window Schedule. Select the Place WS on Drawing option. Double click on the worksheet on the drawing to open it up for editing. Click and hold on the little black downfacing triangle at the top left and choose Database Headers from the popdown menu. This will expose row 4 (not 4.1, 4.2, etc.). The cells in this Database Header Row contain the formulas for all the subrows. If you click and hold on row header for row 4 and choose Edit Criteria, you will see the criteria for the objects that are displayed in the database subrows. HTH. Quote Link to comment
MaxStudio Posted March 5, 2012 Author Share Posted March 5, 2012 Pat, I found an old thread you posted: http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=112259 I created my plugin object and ran the script. It gave me the list and I used the information generated by your script to better understand what was going on. I was able to get information exchanged between the plugin object and the worksheet. thank you Derek Quote Link to comment
JBenghiat Posted March 6, 2012 Share Posted March 6, 2012 Outside of Architect, you can use Tools>Create Report to automatically create a worksheet linked to your PIO parameters. Choose the "Objects with a Record" option, and select the name of your PIO as the name of your record. Next select and order the fields you want to display. You can continue to edit the worksheet as mentioned above. -Josh Quote Link to comment
MaxStudio Posted March 9, 2012 Author Share Posted March 9, 2012 is it possible to access an external worksheet, such as an excel file, rather than a worksheet in vectorworks? If so, is it possible to have two separate files access the same worksheet? Quote Link to comment
Pat Stanford Posted March 9, 2012 Share Posted March 9, 2012 No way I know of to link directly to Excel. If you want to manipulate the data you could create a VW worksheet and then export it and import it into Excel. You can also go the other way, but no live active links. Or maybe you could using the OBDC database routines, but I don't know enough about that to talk. Quote Link to comment
MaxStudio Posted March 9, 2012 Author Share Posted March 9, 2012 What I'm trying to do is link two drawing files. A plan file and an interior elevation file. Both are drawn in 2d using the plugin objects created. Im trying to figure out if there is a way to have one worksheet that would allow me to interact with both file simultaneously. Is it possible to xref a worksheet from one file to another? 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.