Use the WEBLOAD command in AutoCAD, acjsLoadJSScript() in C++, Application.LoadJSScript() in .NET, or webload in LISP to load and execute JavaScript code.
Using the acedInvoke(…), you can call the JavaScript functions from your C++ code. Register the functions using a global JavaScript function, the syntax is:
defun(string name,callback)
Acad::ErrorStatus acjsLoadJSScript(const ACHAR* uriOfHTML)
Acad::ErrorStatus acjsDefun(const ACHAR* name, JsCallbackType callback);
where jsCallbackType is defined as:
typedef JSON (*JsCallbackType)(const JSON* params)
Use this information to load the .NET assembly, you would require for executing the JavaScript APIs:
.NET Assembly Information
Assembly | accoremgd.dll |
Namespace | Autodesk.AutoCAD.ApplicationsServices.Core |
Class | Application |