Is there a way to execute Menu Commands?


#1

Hi

In Javascript for Adobe Illustrator you can execute Menu Commands (see here https://forums.adobe.com/thread/1405101)
Is this possible in Ruby as well ?


#2

Look up:

Sketchup.send_action()

This lets you launch tools as if from the menu items, however, there’s no direct access to 3rd party extensions etc this way, and complex operations - like say launching the Circle tool, setting its normal, picking a center and then a point on the circumference to create a circle are not doable that way either [no ‘macro’ equivalent] - to do that there are API methods for doing most common operations - in the case of circle it’d be:

entities.add_circle(center, normal, radius, numsegs)

The Tool methods let you make a custom tool that looks very muck like a native one, but perhaps does something slightly differently.

e.g. my 2dTools Circle is always drawn flat on the ground, irrespective of the picked points’ heights and no face is added - unlike the native circle-tool…