Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

End script commands generated with Notepad?

4 REPLIES 4
Reply
Message 1 of 5
orders3
1205 Views, 4 Replies

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

End script commands generated with Notepad?

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...

4 REPLIES 4
Message 2 of 5
Alfred.NESWADBA
in reply to: orders3

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 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

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 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 5
orders3
in reply to: Alfred.NESWADBA

orders3
Contributor
Contributor

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

0 Likes

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

Message 4 of 5
leeminardi
in reply to: orders3

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

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
Message 5 of 5
PatrickByrne
in reply to: leeminardi

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

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report