Boh Posted August 5, 2019 Share Posted August 5, 2019 Is it possible to list the style of an object in a data base worksheet? Im particularly interested in title block border styles and WinDoor styles. I have two way worksheets where I can manipulate title blocks or WinDoor objects throughout a file but I can’t figure out how to list the title blocks style. It would be great to be able to change style from the worksheet if possible. Anyone got got a suggestion? Thanks in advance! Quote Link to comment
Boh Posted August 6, 2019 Author Share Posted August 6, 2019 @Pat Stanford do you know if this is possible? Quote Link to comment
Pat Stanford Posted August 6, 2019 Share Posted August 6, 2019 I don't have WinDoor, so I can't comment on that. I took a quick look at the title block boarder object yesterday and it appears that the Style is stored in the parameter record. I have not had time to look and see if there are other hidden records storing the information. So for a quick starting point I have to say NO it is not possible, at least not easily. Quote Link to comment
Boh Posted August 6, 2019 Author Share Posted August 6, 2019 Thanks Pat. I have already run your awesome "List PIO record fields" script on a title block border object and a "style" field doesn't appear unfortunately. It must be accessible somehow, even if just to show in a worksheet as an uneditable item. That way one could cross check all title block borders in a file. Quote Link to comment
Pat Stanford Posted August 6, 2019 Share Posted August 6, 2019 Turns out that PIO Styles are not stored in a record, but is an actual script property of the object itself. Copy and paste the following script into a blank Vectorscript and name it GetPIOStyle. Then use the following function in a database row cell where the objects are Title Block Borders (or any other Styled PIO, I think). =RUNSCRIPT(GetPIOStyle) Procedure GetPIOStyle; Begin WSScript_SetResStr(GetPluginStyle(WSScript_GetObject)); End; Run(GetPIOStyle); Again, I don't have WinDoor, so I think it will work, but I have no way to test. Quote Link to comment
Boh Posted August 6, 2019 Author Share Posted August 6, 2019 Great Pat thanks! Works perfectly for the Title Block Border Style pio's and probably most other object styles. No joy with the WinDoor PIO's @mike m oz do you have any advice on this one? Quote Link to comment
Julian Carr Posted August 7, 2019 Share Posted August 7, 2019 This script works for me. Pat's one doesn't. You have to call the script name not the procedure name however, in RunScript(). Procedure T; BEGIN WSScript_SetResStr(GetPluginStyle(WSScript_GetObject)); END; Run(T); Quote Link to comment
Boh Posted August 7, 2019 Author Share Posted August 7, 2019 Excellent! Thanks Julian. Yours works for Title Block Borders too. Much appreciated. Quote Link to comment
Pat Stanford Posted August 7, 2019 Share Posted August 7, 2019 I am glad it works, but other than the procedure name, I don't see a difference between the scripts. ??? Quote Link to comment
Julian Carr Posted August 7, 2019 Share Posted August 7, 2019 I agree Pat. Some invisible characters in the code I suspect. Quote Link to comment
Pat Stanford Posted August 7, 2019 Share Posted August 7, 2019 If this is something you want to be able to use in multiple files and not have to maintain the script in each one, take a look at this post. It explains how to make a text file containing the script, where to save that text file, and how to tell the runscript command to look in that location. Quote Link to comment
Boh Posted August 7, 2019 Author Share Posted August 7, 2019 That sounds like a great idea. Unfortunately can't get it to work. Have doubled checked instructions, refreshed libraries, restarted VW... and yes my user libraries all work for other resources. Your magnetic personality is not kicking in today!!! Surely note pad should work as a text editor? Quote Link to comment
Pat Stanford Posted August 7, 2019 Share Posted August 7, 2019 Please go to Vectorworks Preferences:User Folders tab. What is the Folder Location shown for the Workgroup and Project Folders? What is the path to User Data and Preferences Folder? Quote Link to comment
Peter Vandewalle Posted August 7, 2019 Share Posted August 7, 2019 Have you tried to add the extension to the filename? =RunScript(120, ‘GetPluginStyle.txt’) Quote Link to comment
Boh Posted August 7, 2019 Author Share Posted August 7, 2019 (edited) Spotted! Works now thanks! It needed the file extension. Edited August 7, 2019 by Boh Quote Link to comment
Boh Posted August 9, 2019 Author Share Posted August 9, 2019 So now the script only works when I have it in my user library. It doesn't work when it is in my workgroup library - have refreshed, restarted etc. And the workgroup library is definitely set up correctly as other default resources are accessible). Hmmm... Quote Link to comment
Pat Stanford Posted August 9, 2019 Share Posted August 9, 2019 Try -120 instead of 120 and see what happens. Based on the documentation, it appears that the Workgroup folder is not supported, but there might be a way around it. Quote Link to comment
Boh Posted August 9, 2019 Author Share Posted August 9, 2019 i will meditate on it over the weekend and I bet on Monday it will work!! Quote Link to comment
Vectorworks, Inc Employee Judah Warshaw Posted August 9, 2019 Vectorworks, Inc Employee Share Posted August 9, 2019 I'm sorry that I did not see this earlier but...there is a built in worksheet function for this: =PLUGINSTYLENAME You can find it in the Insert | Function menu item. 1 Quote Link to comment
Pat Stanford Posted August 9, 2019 Share Posted August 9, 2019 Even better, but if Julian and I did not know about it, perhaps we need a better way of exposing the worksheet functions. But always good to refresh my memory on how to do worksheet scripts. Thanks for pointing it out. Quote Link to comment
Julian Carr Posted August 9, 2019 Share Posted August 9, 2019 Actually I did know Pat and have used it in a worksheet previously. I just forgot. It's there in the insert function list. Quote Link to comment
Pat Stanford Posted August 9, 2019 Share Posted August 9, 2019 It is definitely there. I was thinking more along the lines of a searchable/crossreferenced webpage. There are getting to be so many functions, that we need something more that just what is in the manual. Something more like the Vectorscript Function Reference. Sortable by Name, Category, Object Type, etc. Quote Link to comment
Boh Posted August 11, 2019 Author Share Posted August 11, 2019 Yes I looked and couldn't find it before I decided to go to the forum. Thanks Judah, Julian and Pat with your help. Nice to learn a few things along the way! Cheers 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.