Subject: Understanding script syntax



The following table describes the syntax to use in script files when calling commands and specifying actions. For example, script files can contain comments; any line that begins with a semicolon is considered a comment, and the program ignores these lines when replaying the script.

Script syntax

Character

Description

;

Semicolons indicate comments. Any text after a semicolon on the same line is ignored.

blank space

Spaces and new, empty lines in scripts are the equivalent of pressing the Enter key.

_

Underscores before a command or keyword run the English name of the subsequent command, not a localized version in a different language.

 

For example, a script with the syntax _CIRCLE can be used in other language versions of the program without replacing every occurrence of the command name CIRCLE.

.

Periods before commands run the original, standard version of the subsequent command. This ensures that a redefined version of a command is not run.

-

Dashes before commands run the command line version of the command. For example, LAYER runs the dialog box version of the command, and -LAYER runs the command line version where all input can be entered via the script.

Apostrophes before commands run the command transparently, i.e., within another command. For example, with the LINE command running, change the current color without interrupting the command by typing 'COLOR.

The following is text from a sample script:

; Draw a circle (this is a comment)

_.CIRCLE 0,0,0 _DIAMETER 3

The following shows the same script but with @ representing the location of spaces for clarity:

; Draw a circle (this is a comment)

_.CIRCLE@0,0,0@_DIAMETER@3@

The spaces are critical, representing the Enter key and moving the command to a new option or exiting the command. The space after the number 3 (the circle diameter) represents the user pressing Enter to submit the diameter to complete the command. A new blank line could also have been used in the script file and produced the same result as using a space.

Understanding_script_syntax
© Copyright 2022. BackToCAD Technologies LLC. All rights reserved. Kazmierczak® is a registered trademark of Kazmierczak Software GmbH. Print2CAD, CADdirect, CAD.direct, CAD Direct, CAD.bot, CAD Bot, are Trademarks of BackToCAD Technologies LLC. DWG is the name of Autodesk’s proprietary file format and technology used in AutoCAD® software and related products. Autodesk, the Autodesk logo, AutoCAD, DWG are registered trademarks or trademarks of Autodesk, Inc. All other brand names, product names, or trademarks belong to their respective holders. This website is independent of Autodesk, Inc., and is not authorized by, endorsed by, sponsored by, affiliated with, or otherwise approved by Autodesk, Inc. The material and software have been placed on this Internet site under the authority of the copyright owner for the sole purpose of viewing of the materials by users of this site. Users, press or journalists are not authorized to reproduce any of the materials in any form or by any means, electronic or mechanical, including data storage and retrieval systems, recording, printing or photocopying.