Jump to content
Developer Wiki and Function Reference Links ×

Closed WS access


Tom4

Recommended Posts

  • 2 weeks later...
  • 4 weeks later...

I just went back and looked at a script that writes stuff to a WS. Unfortunately a lot of the calls I'm using are now obsolete. Fortunately they still work in 11.5. TargetSprdSheet,LoadCell,SprdSize...

This is only guesswork. First off I guess I'm gonna have some work to do soon...maybe at the upgrade to 12, so I'm interested in hearing about any progress you might make.

From reading the function reference, I would assume that once you have a handle to the WS (GetObj('name of sheet') is what I've been using) you can probably just use any of the "Set" functions in the Work Sheet section to format cells or write to cells or whatever it is you're trying to do.

What are you trying to do?

Charles

Link to comment

The main thing I want to do is to do a recalculate on a worksheet. When I use the recalculate command it works fine if I have the worksheet open but when it is closed it does not recalculate. when I get iot to recalc then I want to export it.

Link to comment
  • Vectorworks, Inc Employee

Try calling RecalculateWS AND ResetObject on the worksheet handle. If there is a worksheet image in the drawing then you will also need to call a ResetObject on the worksheet image.

Also the worksheet will probably not recalculate while your script is running, so if you are trying to update the worksheet and export it in the scame script it probably will not work.

Link to comment

Kevin This is what I have tried. The 2 worksheets one open and one closed neither recalcs unless I go to edit then close the edit command.

GetWSImage :=( Floorplan1);

editWS := ( Floorplan1);

RecalculateWS( Floorplan1 );

ResetObject( Floorplan1 );

Components := GetWSImage;

editWS :=( Components );

RecalculateWS( Components );

ResetObject( Components );

Tom

Link to comment
  • Vectorworks, Inc Employee

Tom,

Your code should look something like this to recalculate the worksheet named Floorplan1.

.......

wsHand := GetObject('Floorplan1');

wsImageHand := GetWSImage(wsHand);

RecalculateWS(wsHand);

ResetObject(wsHand);

If wsImageHand<>NIL then ResetObject(wsImageHand );

......

Kevin

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