-2

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

  • can you please let us know what have you tried so far? – Pratibha Jun 22 '20 at 01:39
  • Hey @Nadin Gomaa welcome to SO ! Please tell us more about what you have tried so far, where you run into problems and so on. – turbopasi Jun 22 '20 at 05:16
  • i searched a lot and i found autodesk.autocade.js plugin but I couldn't handle it and also i found autodesk forge, but it didnt achieve what I want, it only displays autocad files...I want to draw the shape, take its dimensions an save it in the app files – Nadin Gomaa Jun 22 '20 at 07:44

1 Answers1

1

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.

turbopasi
  • 3,327
  • 2
  • 16
  • 43
  • First of all, I would like to thank you for taking your time ..... i will try to search about what you say but someone said to me javascript can draw autocad files and take information from these files ??? – Nadin Gomaa Jun 22 '20 at 07:48
  • There might be a solution to "programmatically control" AutoCAD, but when it comes to open the program itself, you defintely can't do this from within the browser directly (that was what you asked in OP). But I just found an interesting project that might help you get on to the right track https://openjscad.org/ . – turbopasi Jun 22 '20 at 07:57
  • Also another resource : https://www.autodesk.com/autodesk-university/class/AutoCAD-JavaScript-and-Cloud-2014 - They are some informations about a AutoCAD Javascript API – turbopasi Jun 22 '20 at 07:59
  • Yes, I already found it She was able to draw some fixed shapes like circle and rectangle by writing a Java program with shape properties and downloading it in AutoCAD But I want to reverse this to draw shapes in AutoCAD and take shape properties in JavaScript to load them into a table in my app. Finally, I would like to thank you very much again for your efforts – Nadin Gomaa Jun 25 '20 at 10:22
  • thanks, how i browse to get folder directory with javascript api? – MrAhmedElsayed Oct 11 '22 at 00:09