How to useing javascript do a command ?

 From:  Michael Gibson
10474.2 In reply to 10474.1 
Hi Kondou, I'm sorry I don't understand your message, some pieces seem to be missing.

You want to click on what to launch the polyline command?

The script code to start a command goes like this though:

moi.command.execCommand( 'polyline' );

For a keyboard shortcut though you can just put in the name of the command ('Polyline') and for a <moi:CommandButton> UI element you can put in an attribute of command="Polyline". You can find the regular button for launching polyline in the file Lines.htm which is inside the commands folder in the install, it looks like this:
<moi:CommandButton icon="moi://ui/icons/PolylineIcon.png" command="polyline"><moi:Text textid="Polyline"></moi:CommandButton>

If you wanted to make some other element other than a <moi:CommandButton> to launch the polyline command then you would use the script code above to do it, for example a push button that launches the polyline command would go like this:

<moi:PushButton onclick="moi.command.execCommand( 'polyline' );">Polyline button</moi:PushButton>

- Michael