SCRIPT GUIDE

SCRIPT GUIDE

khalili_masoomeh
Enthusiast Enthusiast
2,064 Views
7 Replies
Message 1 of 8

SCRIPT GUIDE

khalili_masoomeh
Enthusiast
Enthusiast

Hello Everyone! 

 

I'm beginning to learn Scripts in Autocad, But I didn't Find any Reference guide for it.  I don't know what command i should write for any functions. for Example for writing a text how i should write the script or creating a layer or any other works we want to do by scripts.. Is there any Reference guide to introduce these commands and tools and how to use them in script??

 

Thanks in Advance

Masum

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

cadffm
Consultant
Consultant
Accepted solution

The reference guide is your help[F1] because you only use normal commands in your script.

 

If you dont know the command,

start the command like everytime and press [F1] for the help topic or [F2] to see the command name and workflow in the textscreen.

 

Start circle command, press F2 to following the worksteps, press F1 for help to learn what is documented.

 

You will see the command called CIRCLE, asks for position and diam.

 

Lets try it again via commandline, tyoe in:

CIRCLE<enter>

50,50<enter>

25<enter>

 

Works? You created a circle by using the keyboard ONLY, thats it.

 

Write the same input into your simple textEDITOR (not in Word).

Write only the same like before, empty document, first line first char:

CIRCLE<enter>

50,50<enter>

25<enter>

 

Nothing more.

Save the file as Circle.SCR

 

Start a new drawing, load your first script, command SCRIPT

 

Yes, need to learn also very special things, but for the first steps not.

 

Hopeful you doesn't means LISP VBA Or .NET.

Sebastian

Message 3 of 8

Sea-Haven
Mentor
Mentor

Can you explain in broad terms what you want to do, using lisp is better than a script as calculation, new point locations can be worked out.

 

If using scripts you may not want dialogue box input so -insert can be used instead of insert, also use of the system variable Filedia 0 or 1 can turn off dialouges.

Message 4 of 8

khalili_masoomeh
Enthusiast
Enthusiast

thank you so much for replying . Yes my question was exactly about Scripts. you mean for each command i should go to help and see what i should write? there isn't any general reference to see how you should write something?? If i look for commands in help center still there are some questions for me for example you wrote CIRCLE and the next line 50 comma 50 . how can i know when i should press enter? when i should use comma when i should use @ , when i can write something in one line , when i should use dot (.) when i should press Space, what should i write insted of Yes/No ..and So on... You know I want to know the way i can use that commands ,the tool is for example a Rectangle and my Question is first what i should write for rectangle i should write exactly (Rectangle) or some other like Rectang , and the next question is after i write Rectang then i have to go to next line or no i should write in front of it and then when i want to change layer of that rectangle how i should write this how i should give the numbers and colors . how i can copy things... 

0 Likes
Message 5 of 8

khalili_masoomeh
Enthusiast
Enthusiast

Thank you, Yes you are right , the LISP would be better but i don't want to spend much time for learning LISP i do not want to do professional works . I want to write scripts to draw some things in order and repeat it for a simple work. for example i want to write something to draw a simple beam, some rebars in it ,some dimensions, tags and specific layers ..

0 Likes
Message 6 of 8

ВeekeeCZ
Consultant
Consultant

LISP can be almost as simple as SCRIPT. With SCRIPT you will very soon hit its limitations. With LISP it's the other way around... you can expand your knowledge if your current task will require.

Message 7 of 8

Kent1Cooper
Consultant
Consultant

@khalili_masoomeh wrote:

.... you mean for each command i should go to help and see what i should write? there isn't any general reference to see how you should write something?? If i look for commands in help center still there are some questions for me for example you wrote CIRCLE and the next line 50 comma 50 . how can i know when i should press enter? when i should use comma when i should use @ , when i can write something in one line , when i should use dot (.) when i should press Space, what should i write insted of Yes/No ..and So on... .... what i should write for rectangle i should write exactly (Rectangle) or some other like Rectang , and the next question is after i write Rectang then i have to go to next line or no i should write in front of it and then when i want to change layer of that rectangle how i should write this how i should give the numbers and colors . how i can copy things... 


 

You don't need to go to Help unless you don't know how to use a particular command.  All you need is to do what you want manually at the command line, but using hyphen-prefixed command names where appropriate, such as -LAYER or -INSERT, to avoid dialog boxes, and duplicate exactly the same entries into a Script file.  That goes for where you use @, and where you use commas, and whether you need to spell out a full command name or use an alias, and so on.

 

If you're not aware of the core concept that 50-comma-50 is standard input format for X-coordinate-comma-Y-coordinate for specifying a point [in the example case the center of the Circle], maybe you need some basic training.

 

You can use Enter or space interchangeably in most cases [except when something like Layer or Block names with spaces in them are involved], exactly when you can use either one at the command line.  That Circle example could be simply:

CIRCLE 50,50 25

 

For the last parts of your questions, you can use the CHPROP and COPY commands just as you use others -- just do it manually, and duplicate what you did into a Script file.

Kent Cooper, AIA
Message 8 of 8

Sea-Haven
Mentor
Mentor

Google "REBAR LISP" there is a lot of programs out there some very professional and so have a cost, others free.

 

Again lisp is much better.

 

https://www.cadtutor.net/forum/topic/69388-double-cranked-poly-line-that-help-civil-engineers/

0 Likes