Search code examples
javascriptautocadautocad-plugin

How can i open AutoCAD program from my vue.js application?


How can i open AutoCAD program from my vue.js application to draw some shapes and get the path of autocad files

i want to draw some shapes and get its dimensions and save these files in my app to reuse these shapes again


Solution

  • For the "open AutoCAD program from my vue.js application" part :

    • You won't be able to do this directly from your vue.js app
    • Vue.js runs in a browser environment and has no direct access to underlying system resources.
    • You need to connect your vue.js app with an underlying service, e.g. NodeJS REST Api which manages opening/closing AutoCAD.
    • Example : Button click on your vue.js app sends request to the REST Service, and Service opens the program.
    • To use NodeJS is just an example. Which language to use depends probably on more background information like available AutoCAD integrations and so on.

    You need to research on which options you have available to control AutoCAD programmatically. If there is some sort of interface api to control AutoCAD from an external service, you then can decide how your service should look like.

    I am afraid this is all I can give you for a very minimal question like yours.

    Autodesk AutoCAD JavaScript API

    I took a quick look Autodesk AutoCAD Javascript API, and indeed let's you control AutoCAD with javascript files/code. However for what I can see, this is only possible from within the program, e.g. you have the load the script specifically from inside the application.