Has anybody had any experience accessing the Autocad or Inventor API with Clojure?
-
I don't like it when people tell me how to ask questions, but I'm going to do it here. Ask a more specific question, or ask perhaps for an example "hello world" equivalent for those API's, and somebody might be able to help you get going. – semperos Oct 24 '11 at 12:39
-
Sorry I can't be specific, because if I would have had an example of accesing the api or have seen one I would'n have posted the question to begin with. Thank you anyway. – logigolf Oct 24 '11 at 13:11
2 Answers
If you can access autocad through Java, then you can get to it from Clojure. I found this SO question on that matter. (http://stackoverflow.com/questions/856973/interfacing-autocad-with-java) Basically they've built a JNI bridge to the autocad API. Once you do that then you can access that through Clojure. It sounds like a non-trivial undertaking though to say the least.
I'm pretty old, and the last time I checked (cough 20+ years ago cough), Autocad was extensible via Autolisp. If that's still true, then would you really want to bolt on Clojure? Just curious.

- 12,602
- 4
- 40
- 57
-
Thanks again Bill. Yes I had read those postings. I also saw possible solution with Java-Com bridge products at http://www.javain.com/javain/index.jsp. There is also a what could be a valid project on Java4Autocad at http://java4autocad.sourceforge.net/. I am probably much older than you are. Have worked with AutoLisp for 20 years. Because of previous Lisp experience I am doing the transition to Clojure working on a project to externally create data to apply on CAD objects Autocad, also 3D systems as Inventor, SolidWorks, Catia, etc... Will be logical to write that end part also in Clojure. – logigolf Nov 08 '11 at 15:58
-
As far as I know, AutoDesk exposes API for their products in .net environment. There is a paralel clojure implementation in Microsoft clr (.net environmet).
https://github.com/richhickey/clojure-clr
I think this would be a better way to aproach Autocad Scripting.

- 2,654
- 20
- 17
-
this is incorrect. Autocad has interface with multiple languages. https://help.autodesk.com/view/OARX/2023/ENU. C++ (OARX), VBA (ACTIVEX), AutoList (DCL). Java script. a Clojure/Java link would probably be the more natural path. – e-Fungus Jun 29 '23 at 19:30