Jump to content

Recommended Posts

Posted

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.

Posted

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)

 

Posted

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.

Posted

I played around with something similar here

https://www.theswamp.org/index.php?topic=59555.0

 

My thought was to have AI generate lisp or python code, but the code generated was pretty bad.

Also, instead of only drawing primitives, AI should be trained on when the end object is (blocks?)

I need a wall with a window…

 

I think it would also be useful to somehow make AI aware of the drawing / project. Of course that’s a very industry specific thing.

 

Create room 110 at X * Y using room 109 as a template.

“I’m sorry Dave, I can’t do that. The estimator did not include room 110 in the estimate”

 

Cool stuff!

  • Like 1
Posted

@Danielm103 Just a comment "Create room 110 at X * Y using room 109 as a template." I do have a lisp called floor planner, it draws rectangs with an offset of the stud wall thickness. You can then use it to draw internal and external walls. Helps working out room sizes can see problems straight away.

image.png.fdec007911fce2d9c3e91022ca15b453.png

 

 

  • Like 1

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...