Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

End script commands generated with Notepad?

orders3
Contributor

End script commands generated with Notepad?

orders3
Contributor
Contributor

What is the proper sequence, character, special character to end a script commands generated with Notepad?

Such that the command is properly executed and is not influenced by following commands.  I desire a solution that is appropriate for all commands but am having a specific problem with "Zoom Extents".

 

Thanks...

0 Likes
Reply
1,305 Views
4 Replies
Replies (4)

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> end a script commands generated with Notepad?

The last command should end with an <ENTER>

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

orders3
Contributor
Contributor

Pasting <ENTER> in the command line with or without <> prompt "Unknown command".

0 Likes

leeminardi
Mentor
Mentor

At the end of each line of text in a Notepad file is an invisible character that indicates it is the end of that line of text. You want to make sure that the last line of your script also has this end-of-line character.  For example, if you wanted a script to draw three circles it might look like this:

 image.png

Note that the cursor is at the start of the 4th line. Hit the down arrow a few times to check that there aren't additional blank lines in the file.   

For example if Notepad showed the following it would indicate that you have an extra end-of-line character (the cursor is at the start of the 5th line) and that running this script would use an extra "enter" when it was done resulting in a re-execution of the circle command with a prompt to enter the circle center.

 

image.png

Place the cursor at the start of your Notepad file and use Ctrl-End from the keyboard.  It should place the cursor at the end of the file. Check that it is after the last line of text. 

lee.minardi
0 Likes

PatrickByrne
Advocate
Advocate

I am not aware of any command that will indicate the end a script, a space is considered a Return (Enter Key pressed) and a new line is also considered a Return and has to be used in some cases.

 

What we tend to do is add a command after our script. In this case qsave is the last command so there can’t be any spaces or returns after this.

 

zoom
extents
qsave


Script files can also contain comments, any line that begins with a semicolon (;) is considered a comment, and AutoCAD ignores it while processing the script file, you can’t have any empty lines after this as they will be considered as a return.

 

;Start of Script routine
zoom
extents
qsave
;End of Script routine

 

Patrick
http://www.multi-batch.com/
For your entire batch scripting needs