@@ -3984,17 +3984,19 @@ var Autodesk;
3984
3984
if ( typeof ( jsFunc ) !== 'function' ) {
3985
3985
throw TypeError ( "jsFunc should be of type function" ) ;
3986
3986
}
3987
-
3987
+ unregisterCallback ( jsFunc ) ;
3988
3988
//syncronously execute the adding of the command, this registers
3989
3989
//the command with Autocad. autocad will fire a synchronous event,
3990
3990
//identified by globalName when the command is typed
3991
3991
var retCode = AutoCAD . EditorInterop . addCommand ( groupName , globalName , localName , flags ) ;
3992
+ console . log ( retCode ) ;
3992
3993
if ( retCode != Acad . ErrorStatus . eJsOk ) {
3993
- throw Error ( "Error: add command failed." ) ;
3994
+ // throw Error("Error: add command failed.");
3994
3995
}
3995
3996
3996
3997
//now register a callback with the globalName so that js gets called when the command
3997
3998
//is invoked
3999
+
3998
4000
registerCallback ( groupName + "." + globalName , jsFunc ) ;
3999
4001
}
4000
4002
Editor . addCommand = addCommand ;
@@ -6029,10 +6031,12 @@ var Autodesk;
6029
6031
EditorInterop . executeCommand = executeCommand ;
6030
6032
6031
6033
function addCommand ( groupName , globalName , localName , flags ) {
6034
+
6032
6035
var jsonStr = exec ( JSON . stringify ( {
6033
6036
functionName : 'Ac_EditorInterop.addCommand' ,
6034
6037
functionParams : { groupName : groupName , globalName : globalName , localName : localName , flags : flags }
6035
6038
} ) ) ;
6039
+
6036
6040
var jsonObj = JSON . parse ( jsonStr ) ;
6037
6041
6038
6042
if ( jsonObj . retCode == undefined )
0 commit comments