Using Meta AI in AutoCAD with Python

Using Meta AI in AutoCAD with Python

daniel_cadext
Advisor Advisor
1,450 Views
6 Replies
Message 1 of 7

Using Meta AI in AutoCAD with Python

daniel_cadext
Advisor
Advisor

Sorry to spam the forums, but I thought this was cool

 

 

 

import traceback
from pyrx_imp import Rx, Ge, Gi, Db, Ap, Ed, Cv

from meta_ai_api import MetaAI

def PyRxCmd_SupZuck():
    try:
        ai = MetaAI()
        while True:
            res = Ed.Editor.getString(1, "\n>>>: ")
            if res[0] != Ed.PromptStatus.eOk:
                return
            zuckSaid = ai.prompt(message=res[1])
            print(zuckSaid['message'])   
    except Exception as err:
        traceback.print_exception(err)

 

 

 

ai.png

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Accepted solutions (1)
1,451 Views
6 Replies
Replies (6)
Message 2 of 7

daniel_cadext
Advisor
Advisor
Accepted solution

Might be better in a palette

https://github.com/CEXT-Dan/PyRx/tree/main/PySamples/wxWidgets/PyChat

 

pychat.png

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 3 of 7

Sea-Haven
Mentor
Mentor

In some programs have added a HELP button, this can open Word doc, run an animation, open txt, open pdf and so on. IN DCL HELP can be a button, ok_cancel_help button. Or a custom button. Also ok_cancel_help_info button are built in.

Message 4 of 7

daniel_cadext
Advisor
Advisor

I remember Clippy

This is quite different than a static help though.  IMHO, it’s kind of a parlor trick at the moment.

 

st.png

 

 

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 5 of 7

Sea-Haven
Mentor
Mentor

Nice idea like a look up index say when have a pop menu can ask say "Plot A1" which matches help for plotting A1 sheet layouts lisp.

0 Likes
Message 6 of 7

daniel_cadext
Advisor
Advisor

That’s the ticket!

let’s say, ask AI to write an AutoLISP routine to plot all the layouts in a drawing.

And AI pops out a result.  This is wrong, but.. the idea is, the result can be parsed and executed

When AI gets better, and it will, you can just tell AutoCAD to do a task, by verbal command or at the prompt

 

plot.png

 

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 7 of 7

daniel_cadext
Advisor
Advisor

Also, how to give AI more context.. to where you can ask questions like.

Please estimate the material cost using material A vs material B, considering inflation and delivery costs

 

AI will need to know the delivery date, what’s in the drawing etc. I imagine Excel will have this for bean counters.

 

Please analyze this drawing for mistakes.. : )

 

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes