Jump to content
Developer Wiki and Function Reference Links ×

What to add to a VectorScript for ... "Increase or Decrease by a factor of 2" 


Recommended Posts

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

Link to comment

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.

Link to comment

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 by Jesse Cogswell
Link to comment

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.

Link to comment

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

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