Jump to content
Boh

List object style in a worksheet

Recommended Posts

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!

Share this post


Link to post

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.

 

 

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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?

 

image.thumb.png.e84bbcc90e7c8ee412f221f54aa06aa7.png

 

 

Share this post


Link to post

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);

Share this post


Link to post

Excellent! Thanks Julian. Yours works for Title Block Borders too. Much appreciated.

 

image.thumb.png.1ad0fd97f94b291e3fbfca313c71a018.png

Share this post


Link to post

I am glad it works, but other than the procedure name, I don't see a difference between the scripts.  ???

Share this post


Link to post

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.

 

 

Share this post


Link to post

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?

 

image.thumb.png.464053cb30cb65623d4485ef0771dea9.png

 

 

Share this post


Link to post

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?

Share this post


Link to post
Posted (edited)

Spotted! Works now thanks! It needed the file extension. 

Edited by Boh

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

i will meditate on it over the weekend and I bet on Monday it will work!!

Share this post


Link to post

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.

 

image.png

 

Share this post


Link to post

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.

 

 

Share this post


Link to post

Actually I did know Pat and have used it in a worksheet previously. I just forgot. It's there in the insert function list.

Share this post


Link to post

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.

Share this post


Link to post

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

 

 

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...