Dmytro Posted yesterday at 09:13 AM Share Posted yesterday at 09:13 AM Hi everyone, I would like to share a small open-source prototype of an LLM-based AutoCAD automation tool. This is a .Net plugin, that generates other .Net plugins for autocad based on a user prompt :) Here you can find a short demo of the plugin: Here you can find the sources (and installer to try it yourself): https://github.com/dimitrovakulenko/Scripture I'd love to hear your feedback and ideas! Feel free to share your thoughts in the comments below. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted 16 hours ago Share Posted 16 hours ago How does it compare to ChatGP and MS Pilot ? Providing the same code ? COPILOT "Make 12 random objects line circle pline in model space within bounds 0,0 1000,1000. Using Autocad lisp" The result was so close missing a closing ). (defun c:RandomObjects () (defun random-point (min max) (list (+ min (random (- max min))) (+ min (random (- max min))))) (defun random-radius (min max) (+ min (random (- max min)))) (defun create-random-line () (entmake (list (cons 0 "LINE") (cons 10 (random-point 0 1000)) (cons 11 (random-point 0 1000))))) (defun create-random-circle () (entmake (list (cons 0 "CIRCLE") (cons 10 (random-point 0 1000)) (cons 40 (random-radius 10 50))))) (defun create-random-polyline () (entmake (append (list (cons 0 "LWPOLYLINE") (cons 90 4)) (mapcar '(lambda (pt) (cons 10 pt)) (list (random-point 0 1000) (random-point 0 1000) (random-point 0 1000) (random-point 0 1000)))))) (repeat 4 (create-random-line)) (repeat 4 (create-random-circle)) (repeat 4 (create-random-polyline)) (princ "\n12 random objects created in model space.") (princ) ) (c:RandomObjects) Quote Link to comment Share on other sites More sharing options...
Dmytro Posted 4 hours ago Author Share Posted 4 hours ago The prototype allows usage of different models. I've used it with chatGPT 4.0o deployed via Azure. (You can also use your model from open ai directly). With some minor code adjustments it would be possible to try other models as well, i.e. mistral, ollama, etc. The strength of this prototype is the implemented workflow: we ask LLM to generate a script, we try to compile it on fly (don't know if this can be done with lisp, dotnet Roslyn API allows to do that for csharp), if a script cannot be compiled we make another request(s) to LLM to try fix the script based on errors reported by compiler. Fixing process is done in a loop. This way I guarantee the generated script can actually be compiled. The script itself might not solve the problem perfectly, cause it is just a generated by LLM, that can hallucinate. Step2 is supposed to allow fine-tuning of the script. Step-2 is very simple now: allows manual editing and automatic fixing by providing more context to an LLM. Please check out the state machine diagram on project GitHub page to better understand what I've just tried to explain. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.