Simple Command Line Error

Simple Command Line Error

nt937HX
Observer Observer
531 Views
4 Replies
Message 1 of 5

Simple Command Line Error

nt937HX
Observer
Observer

Hi,

 

I am new to scripting in AutoCAD but I am in need of a way to automate some processes.

 

I am trying to run this simple script:

         ; Test script
         _textscr
         Hello, AutoCAD!

 

Instead of displaying Hello, AutoCAD! I receive the below error.

nt937HX_0-1712808358452.png

I am sure this is a simple question but I appreciate your help.

Nathan

 

0 Likes
532 Views
4 Replies
Replies (4)
Message 2 of 5

imadHabash
Mentor
Mentor

Hi and Welcome to AutoCAD Forum,

TEXTSCR (Command) Opens a text window that displays a history of prompts and command line entries for the current session. So it's normal that you have such an error with Hello command because there is NO hello command in AutoCAD . 

BUT if your need is how scripting in AutoCAD then i suggest to follow this link that may help you . 

 

Imad Habash

EESignature

0 Likes
Message 3 of 5

paullimapa
Mentor
Mentor

Script file basically contains a sequence of AutoCAD commands.

Hello, 

The above line is not a command as you can see from the response on the Text window

paullimapa_0-1712811928254.png

Now if you incorporate lisp functions then the following line will work when placed in the script file:

(alert "Hello, AutoCAD")

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 5

cadffm
Consultant
Consultant

Hi,

 

and why the error appears for "Hello," and not for "Hello, Autocad!":

Because a commandname never include a blank, the blank will interpret as [Enter]

 

 

Sebastian

0 Likes
Message 5 of 5

Kent1Cooper
Consultant
Consultant

(prompt "Hello, AutoCAD!")

Kent Cooper, AIA
0 Likes