Running scripts in Autocad.

Running scripts in Autocad.

laraujo
Enthusiast Enthusiast
1,202 Views
7 Replies
Message 1 of 8

Running scripts in Autocad.

laraujo
Enthusiast
Enthusiast

Dear Sirs, I was wondering if I could use Chat GPT to write an Autocad script. So I instructed Chat GPT as follows: 

 

"generate an autocad script that draws reinforced concrete stairs with given height and width"

and the script came: 

 

 

I renamed it as test.scr. Had to change extension in order to attach it.

 

But Autocad did not run it. Am I breaking any rule? Is this possible (to generate Autocad scripts using Chat GPT)?

0 Likes
Accepted solutions (1)
1,203 Views
7 Replies
Replies (7)
Message 2 of 8

atGK8NU
Advocate
Advocate

There are no rules that you are breaking.

But ChatGPT is not yet "smart" enough to create scripts without making mistakes. 

0 Likes
Message 3 of 8

Kent1Cooper
Consultant
Consultant

ChatGPT is already notorious for not knowing AutoLisp well enough to write routines in that.  I hadn't seen any attempts to use it for a Script yet.  But its output is not remotely like the right kind of "language" for an AutoCAD Script.  It looks, at least in several places, more like maybe BASIC programming language.  You may not have broken any rule, but it did, if writing something without knowing anything about what you're writing constitutes "breaking a rule."

Kent Cooper, AIA
0 Likes
Message 4 of 8

pendean
Community Legend
Community Legend
Accepted solution

@laraujo wrote:

... "generate an autocad script that draws reinforced concrete stairs with given height and width"...


Q: are you using an old LT version of AutoCAD by chance? I ask because you are asking for a "script" when there exist dozens of free Stairs routines in LISP format for many needs and many options, you just have to find one to start with 

https://www.google.com/search?q=autocad+lisp%3A+draw+stairs+with+height+and+width 

0 Likes
Message 5 of 8

laraujo
Enthusiast
Enthusiast

Thanks. My Autocad is 2021. 

0 Likes
Message 6 of 8

Kent1Cooper
Consultant
Consultant

@laraujo wrote:

Thanks. My Autocad is 2021. 


But is it full AutoCAD, or AutoCAD LT?  LT cannot use AutoLisp until that was added in the 2024 version, so if you're using LT, that would be a reason to need a Script rather than an AutoLisp routine.

OR maybe by "script" you actually intend something else, such as an AutoLisp routine.  Sometimes people use the word "script" for any kind of coded operation, but in AutoCAD, the word has a specific meaning, and it's different from [though related to] an AutoLisp routine, and from [another kind of coded operation] a command macro.  If that's your meaning, and you ask ChatGPT to write an AutoLisp routine, it will probably do something very different, and probably looking reasonably like AutoLisp language, but I would bet it will not get it right [yet].

Kent Cooper, AIA
0 Likes
Message 7 of 8

laraujo
Enthusiast
Enthusiast
Sorry, I thought the Forum was just for writing something without knowing anything about it. Isearched for "Autocad beginners forum" and got: "AutoCAD Forums - This is the best place for AutoCAD beginners to ask basic questions."
0 Likes
Message 8 of 8

Kent1Cooper
Consultant
Consultant

Someone may be able to direct you to something, or work out something or the beginnings of something, but an answer to the question is still needed.  And a sample of the kind of thing you want to be drawn would be important -- there's not anywhere near enough information in Message 1.

Kent Cooper, AIA
0 Likes