Tutorial: Animation in 2D AutoCAD


scripting in AutoCAD is very interesting!
Let me show you the basic level scripting that animate the 2D gears.
-
Step 1:
First get your gears done in 2D AutoCAD.
-
Step 2:
Use "g" in command prompt to create group
Put each gear in separate group, name each group "1" & "2" -
Step 3:
now open notepad and write down following script
============================
rotate
g
1(x,y)
1
rotate
g
2(p,q)
-1
rscript
===================================NOTE: here, we are ordering our beloved autocad to rotate the group 1 with 1 speed about (x,y) axis(co-ordinates).... same withe the group 2, rotate the group 2 with -1 speed about (p,q) axis(co-ordinates)
Use "ID" command to locate the center-point of gear.
-
Step 4:
now save your notepad file with [.scr] extension
your file name can be any thing.
mine is "gear.scr" -
Step 5:
now type "scr" in your autocad command prompt, hit enter, browse to the "XYZ.scr" file you just created.. and you've done!!!!