Jason Turley Posted July 10, 2006 Share Posted July 10, 2006 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 Quote Link to comment
islandmon Posted July 10, 2006 Share Posted July 10, 2006 "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); Quote Link to comment
Jason Turley Posted July 10, 2006 Author Share Posted July 10, 2006 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 Quote Link to comment
islandmon Posted July 11, 2006 Share Posted July 11, 2006 You may need to point to the open document which contains the MenuItems you need ... with something like or include a FilePath: PROCEDURE " "; VAR h : HANDLE; BEGIN h := ActLayer; END; Quote Link to comment
ccroft Posted July 12, 2006 Share Posted July 12, 2006 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 Quote Link to comment
PeterT Posted July 18, 2006 Share Posted July 18, 2006 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. :-) Quote Link to comment
ccroft Posted July 20, 2006 Share Posted July 20, 2006 Nice work Peter. Jeeez...am I glad I didn't have to try to figure that one out. Nothing substitutes for bone-headed determination! Now I REALLY know why the language guide recommends not using DoMenu if at all possible. c 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.