Jump to content
Developer Wiki and Function Reference Links ×

Simple printing script


Recommended Posts

I have a simple printing script that I was using in VectorWorks 11 and am trying to get to work in VectorWorks Architect 12. I have been over the script a number of times and it all looks good to me but the "Page Setup" bit fails. Any ideas?

SetPref(16,FALSE);

SetPref(10,TRUE);

DoMenuTextByName('Guides',4);

DoMenuTextByName('Page Setup',0);

DrwSize(1,1);

DoMenuTextByName('Print',0);

DoMenuTextByName('Guides',3);

SetPref(10,FALSE);

SetPref(16,TRUE);

I have looked at using "PrintUsingPrintDialog" but I can't seem to get it working. Here is my script.

Thanks

Jason

Link to comment

"Note: DoMenuTextByName uses the internal VectorWorks menu item name to reference the menu command, and calls to this procedure will work on localized (international) versions of VectorWorks without modification. Note also that when calling VS plug-ins, you have to use the filename (which could be different from the internal plug-in name)."

Parameters:

subMenu Menu item selector.

index Menu chunk item position (range of 1 - n).

Example:

PROCEDURE DoMenuTextByNameExample;

BEGIN

DoMenuTextByName('Print',0); {calls the print dialog}

DoMenuTextByName('Standard Views',8); {sets view to right isometric}

END;

RUN(DoMenuTextByNameExample);

Link to comment

Shouldn't my simple printing script work in its current form? The "Page Setup" bit is correct as shown in the VectorScript reference but the script throws up this error:

Error: DOMENUTEXTBYNAME - Menu cannot be found. Page Setup

This is getting a bit above me. Would you mind showing me where I have gone wrong? How I can use the "PrintUsingPrintDialog" function.

Thanks

Jason

Link to comment

Jason

Not sure why DoMenu...'Page Setup' doesn't work unless they changed something about that menu command in Vworks 12. Unfortunately I haven't made the move to 12 yet so I can't investigate. That error message would come up if for eg you had a spelling mistake...or an errant space.

I may be able to help w/ PrintUsing. I'm assuming that your present script is shown in it's entirety. This kind of script will run without the full Procedure and Run statements. To use PrintUsing you need something like:

Procedure prnt;

Var

dummy: integer;

Begin

dummy:=PrintUsingPrintDialog;

End;

Run(prnt);

This particular function also wants to return an integer and I can't run it in 11.5 unless I give it somewhere to store that number, even if I don't have any particular use for it. Thus "dummy".

All your DoMenu this and that would go directly above and below PrintUsing exactly as in your old script, including the all important punctuation. It must all fall within Begin and End.

Hope it Helps

Charles

Link to comment

In VectorWorks 12, it seems that they have combined the "Set Print Area" and the "Page Setup" into one dialog. Choosing the "Page Setup" dialog now brings up what used to be called the "Set Print Area" dialog, and what used to be the old "Page Setup" dialog is now called "Printer Setup" and is accessed by clicking the "Printer Setup" button in the "Page Setup" dialog.

If you go to the Workspace Editor, you will find a menu command called "Printer Setup". If you add this menu command to your workspace, then "DoMenuTextByName('Page Setup', 0);" will work as expected.

If this seems convoluted, its O.K., because they have provided no documentation to back it up. Good old trial and error prevails again. :-)

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