Elite Exhibits Posted June 16, 2023 Share Posted June 16, 2023 What to add to a VectorScript for ... "Increase or Decrease by a factor of 2" "Increase by a factor of 2" or "Decrease by a factor of 2" are under Miscellaneous key shortcuts ... not in the Menus (?) ... not found in the https://developer.vectorworks.net when searching for "by a factor of" Or What can be added to a VectorScript to execute a keyboard key shortcut command (⌘-1 for example) ? ... and does this need to be the original VectorWorks key shortcut ? Any applicable answers and appropriate advice, as always, are aptly appreciated. Peter Quote Link to comment
Jesse Cogswell Posted June 16, 2023 Share Posted June 16, 2023 That depends entirely on what you are trying to increase or decrease. If it's a 2D object, you would use HScale2D, but would need to use HCenter to get the object's center point first. If you are trying it on a 3D object, you would use HScale3D. In either case, you would set the scale factors to 2 for increase, or 0.5 for decrease. Quote Link to comment
michaelk Posted June 16, 2023 Share Posted June 16, 2023 Are you trying to change the zoom or scale and object? Jesse is right about scaling. zoom would be SetZoom(GetZoom*2); or SetZoom(GetZoom/2); Quote Link to comment
Pat Stanford Posted June 16, 2023 Share Posted June 16, 2023 There is no Vectorscript command to execute a keyboard shortcut. The closes is DoMenuTextByName the you can use to execute a menu command. IF you can figure out the correct name to use. @Jesse Cogswellwas it you who published the list of DMTBN names? There is no Vectorscript command that is the equivalent of Command 1/2 Zoom In/Zoom Out. Best equivalent would be to use GetZoom and SetZoom and do the math yourself. Quote Link to comment
Jesse Cogswell Posted June 16, 2023 Share Posted June 16, 2023 (edited) I don't have any DoMenuTextByName information outside of what's provided in the Function Reference Appendix H. I could have sworn that we've talked about this very issue before, I remember discussing the difference to the compiler of using *0.5 vs. /2, but I'll be damned if I could find it in my post history. EDIT: Found it. We've answered this question before. Edited June 16, 2023 by Jesse Cogswell Quote Link to comment
Elite Exhibits Posted June 16, 2023 Author Share Posted June 16, 2023 A list would be great ... I was looking for Edit Extrude in the DoMenuTextByName information in the Function Reference Appendix Peter Quote Link to comment
Elite Exhibits Posted June 16, 2023 Author Share Posted June 16, 2023 @Jesse Cogswell I was originally digging for this on the FORUM, the ... using *0.5 vs. /2, ... Found it: Script to go direct to the Edit Symbol Mode from the drawing (Via the Resource Manager ...) Peter Quote Link to comment
Elite Exhibits Posted June 16, 2023 Author Share Posted June 16, 2023 A big thanks to @michaelk & @Jesse Cogswell I have a working script... ... just need to type in the right search string into Google site:Forum ... Peter Quote Link to comment
Jesse Cogswell Posted June 16, 2023 Share Posted June 16, 2023 Extrude would be handled through the HExtrude command. I linked the appendix in the post above, that will be everything that DoMenuTextByName can do outside of calling custom menu commands. In general, I would shy away from using DoMenuTextByName wherever possible, and instead invest in learning the Vectorscript/Python language and functions. The Function Reference and the Vectorscript Language Guide are fantastic resource for getting information. Quote Link to comment
Pat Stanford Posted June 16, 2023 Share Posted June 16, 2023 @Patrick Winkler posted a more complete list of DMTBN "codes" than what is in the Appendix back in 2017. Quote Link to comment
Elite Exhibits Posted June 16, 2023 Author Share Posted June 16, 2023 @Jesse Cogswell As it stands, the simplicity of DoMenuTextByName should be a simple proposition as one already knows what the Menu Item is - The problem arrises in the locating the correct text to follow it. Something that is quite an illogical challenge, even with all the pages in the Developer Wiki. Thanks again for the assistance ... Peter Quote Link to comment
Elite Exhibits Posted June 16, 2023 Author Share Posted June 16, 2023 Thank you again ... @Pat Stanford @Jesse Cogswell@michaelk current project that requires editing many long extrudes in different odd views. When editing these extrudes the result, more often than desired: VW shows the Layer Plane fundamental shape completely off the screen some where ! So the work around is: Select Extrude / Edit Extrude / Command-5 / Command-6 / Command-2 (... proceed with the editing) or this script ********************************************* PROCEDURE DoMenuTextByNameExample; BEGIN DoMenuTextByName('Edit',0); DoMenuTextByName('Standard Views',1); {sets view to Top/Plan} DoMenuTextByName('Fit To Objects',0); SetZoom(GetZoom*0.5); END; RUN(DoMenuTextByNameExample); ********************************************* I assume that there is chaff in the above, but I find any attempts to clean it futile. ¿ My VectorScript experience ? : If it works - just leave it alone ! Thanks again Peter Quote Link to comment
Pat Stanford Posted June 16, 2023 Share Posted June 16, 2023 I posted a longer script back in April that actually moves the location of the "construction" objects inside a solid to the location of the object. Not sure you need this, but your description sounds like a similar problem. 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.