JavaScript Application Programming Interface (API) for AutoCAD
ContentsIndexHome
PreviousUpNext
Acad.Editor.addCommand Function

Autodesk.AutoCAD.js

JavaScript
function Acad.Editor.addCommand(groupName,globalName,localName,flags,jsFunc);
Parameters 
Description 
groupName 
is a string that specifies the command group name for adding this command. 
globalName 
is a string that specifies the global and untranslated name of the command to add. 
localName 
is a string that specifies the local and translated name of the command to add.� 
flags 
is an integer that specifies the flag associated with the command.
Note:The flags should be either Acad.CommandFlag.TRANSPARENT or Acad.CommandFlag.MODAL and can be logically OR'd with other flags in Acad.CommandFlag. 
jsFunc 
is the callback function to be executed when this command is invoked.
Note: It returns the command name and command event name specified in Acad.CmdEventName. As it is a synchronous callback, it should return value, such as return JSON.stringify({ retCode: Acad.ErrorStatus.eJsOk })

Use this method to register an AutoCAD command.

Links
Copyright (c) 2016. All rights reserved.
What do you think about this topic? Send feedback!