Jump to content

Hello Community!

This Saturday, April 11, from 9am – 1pm EDT we will be performing maintenance on the Vectorworks Community Board. During this time, the site will be unavailable.

Sign in to follow this  
michael john williams

worksheets and schedules

Recommended Posts

OK, how about a partial solution. The attached script will create a worksheet showing both the display names and the record/field name needed to paste into a database header row in a worksheet. The created worksheet will be named with the name of the PIO and the date/time it was created (this is so I don't confuse myself if I am creating new PIOs). The Record.Field are enclosed in single quotes so you can just copy and paste the entire field without having to worry about spaces in the names.

Please use as you see fit.

Pat

Procedure GetPIORecordFields;

{Creates a worksheet showing the display and field names}

{for the first selected object on the active layer}

{Useful for determining the record.field names required}

{for use in a worksheet.}

{January 30, 2008}

{? 2008, Coviana, Inc - Pat Stanford pat@coviana.com}

{Licensed under the GNU Lesser General Public License}

Var H1 ,H2 :Handle;

S1,S2,S3,S4 :String;

N1,N2 :Integer;

WSH :Handle;

B1 :Boolean;

Begin

H1:=FSActLayer;

H2:=GetRecord(H1,1); {get a handle to the first record}

If H2 <> Nil then

Begin {If a record exists then create worksheet}

S1:=GetName(H2);

N1:=NumFields(H2);

N2:=1;

S3:='';

WSH:=CreateWS(Concat(S1,' ',Date(2,1)),N1+2,2);

SetWSPlacement(WSH,200,200,800,700);

SetWSColumnWidth(WSH,1,1,200);

SetWSColumnWidth(WSH,2,2,200);

SetWSCellFormula(WSH,1,1,1,1,Concat('Parameter Fields for PIO: ',S1));

SetWSCellFormula(WSH,3,1,3,1,'Display Name');

SetWSCellFormula(WSH,3,2,3,2,'Cell Formula');

While N2<=N1 Do

Begin {populate the worksheet with all the fields}

S2:=GetFldName(H2,N2);

S3:=Concat(Chr(39),S1,'.',S2,Chr(39));

SetWSCellFormula(WSH,N2+3,2,N2+3,2,S3);

B1:=GetLocalizedPluginParameter(S1,S2,S4);

SetWSCellFormula(WSH,N2+3,1,N2+3,1,S4);

N2:=N2+1;

end;

ShowWS(WSH,True);

SetTopVisibleWS(WSH);

end;

End;

Run(GetPIORecordFields);

Share this post


Link to post

Pat,

Thanks again.

I tried the script and it works great.

It took me a minute to figure out that it wouldn't work on PIO's that were inserted into walls, like doors or windows, but dragging them free of the wall solved the problem.

A great advantage to having the info on a worksheet is that you can see it WHILE you are working on another worksheet, unlike using the PlugIn Editor which will not allow you to work with anything else while it is open, meaning that you must write down or memorize the info that you seek.

I think this is a huge improvement.

Share this post


Link to post

Well code can be very succinct (The script is only 127 words), but your description is more along the lines of teaching a man to fish while I just gave him a fish.

Both are good things. ;-)

Pat

Share this post


Link to post

Goooooooooosh!

Come back after a day and a hugh thread - and all good stuff, which at the mo I do not understand but I am gratful for the input and will give it a go. It will take at least a day to play around with it and try it out and set it up as our office template.

But I suppose that's my point to the average user this sounds so complicated and not user friendly that it is not used. I do not know the first thing about scripts and I feel I would have to be a CAD programmer to really do it. The VW help section on worksheets and schedules is poor and so minimal.

NNA are pushing BIM but if its hard to understand and use then it will not be used and fail. NNA should backing up the push for BIM with workable templates and not just US based but other countries as well.

Look at Excel, there are hundreds of templates easily available and easy to adapt.

Share this post


Link to post

Michael,

Don't confuse scripting with the worksheets and schedules. You don't need to write scripts to use worksheets. You just need to follow Wes's directions and the Help files to modify the schedules that are provided. It's convoluted to say the least, especially if you don't do it often, but it isn't terribly hard. You should definitely keep trying.

The script that Pat provided is a completely different thing. It's like learning another language. I've looked longingly at those scripts but I just don't have the time to devote to learning it.

Share this post


Link to post

Boxjoint,

Go to the wish list and submit a "wish" for the feature you described. I think it is a good Idea!

Share this post


Link to post

boxjoint, pat and all,

There is another solution for accessing PIO names that doesn't involve using the VS Plug-in editor or scripting.

You can do this directly from the worksheet using the Paste Criteria command.

Proceed as follows:

- Enter the equal sign in the formula bar

- Click on the "Paste Criteria..." command in the worksheet menu

- The Paste Attributes dialogs opens , then click on the 'Custom' button.

- Now in the Criteria dialog, select the Field Value criterion, pick your PIO field and make sure you set the criteria operator to 'NONE' (third pulldown menu).

- Click OK and you are done.

We are well aware that accessing PIO names from the worksheet isn't straightforward and intuitive. This area is on the radar and we are working on better solutions.

Hugues

NNA

Share this post


Link to post

Hugues,

Thank you for the reply.

Your tip works well.

Thanks also for planning future improvements on this.

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.

Sign in to follow this  

 

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