AutoCAD的命令脚本scr入门

运行的脚本的方法是,管理、运行脚本,或者在命令窗口输入script,调用脚本文件,甚至更简单,把脚本scr文件用文本文档打开,把内容复制粘贴到CAD命令窗口中就可以!

AutoCAD 的脚本就是cad的命令行序列。可以用纯文本编辑器如记事本来创建编辑脚本,然后把后缀名改成.scr。

就是这么有个性!

然后看几个最简单的cad命令或者是scr脚本。

circle 10,10 10(画圆,坐标是10,10,半径是10)

polygon 5 30,30 i 30(画多边形,五边形,中心点坐标是30,30,内切圆,圆半径是30)

-text 0,0 10 0 PI105(写文本,注意一定是-text,注意前面的横杠,否则多文本就会有一大串,坐标是0,0,字高是10,旋转角度是0,文本内容是PI105,注意结束之后还有一个空格,文本要当心的比较多。)

line 0,0 10,10(画直线,起始点坐标是0,0,结束点坐标是10,10)

pdmode 34 pdsize 8(点半径,点样式编号)

point 0,0(画点,点位坐标是0,0)

z

e

(缩放到当前窗口)

注:以上括号中的内容仅为说明,建立脚本文档时勿输入,如需备注请以分号开头。

以下是建模时绘制三维特征线的命令行脚本:

;大坝心墙2615以下建模脚本 (C)QinDong 2016-05-05
;运行脚本前请关闭捕捉
;C3-C4-C7-C8
3DPOLY
268758.0590,3743257.0000,2580.00
268711.0590,3743257.0000,2580.00
268711.0590,3743086.5800,2580.00
268758.0590,3743086.5800,2580.00
C
;C5-C6
3DPOLY
268679.5590,3743248.9484,2615.00
268679.5590,3743094.6313,2615.00

;C9-F8
3DPOLY
268789.5590,3743094.4228,2615.00
268789.5590,3743245.9540,2615.00

;C4-C5
3DPOLY
268711.0590,3743257.0000,2580.00
268679.5590,3743248.9484,2615.00

;C3-F8
3DPOLY
268758.0590,3743257.0000,2580.00
268789.5590,3743245.9540,2615.00

;C6-C7
3DPOLY
268679.5590,3743094.6313,2615.00
268711.0590,3743086.5800,2580.00

;C8-C9
3DPOLY
268758.0590,3743086.5800,2580.00
268789.5590,3743094.4228,2615.00

;C1-C2
3DPOLY
268711.0590,3743173.7900,2573.50
268758.0590,3743173.7900,2573.50

;C1-C2平行线+3.5
3DPOLY
268711.0590,3743177.2900,2573.50
268758.0590,3743177.2900,2573.50

;C1-C2平行线+8.375
3DPOLY
268711.0590,3743182.165,2580.00
268758.0590,3743182.165,2580.00

;C1-C2平行线-3.5
3DPOLY
268711.0590,3743170.2900,2573.50
268758.0590,3743170.2900,2573.50

;C1-C2平行线-8.375
3DPOLY
268711.0590,3743165.415,2580.00
268758.0590,3743165.415,2580.00

-text 268711.0590,3743173.7900,2573.50 1 0 C1
-text 268758.0590,3743173.7900,2573.50 1 0 C2
-text 268758.0590,3743257.0000,2580.00 1 0 C3
-text 268711.0590,3743257.0000,2580.00 1 0 C4
-text 268679.5590,3743248.9484,2615.00 1 0 C5
-text 268679.5590,3743094.6313,2615.00 1 0 C6
-text 268711.0590,3743086.5800,2580.00 1 0 C7
-text 268758.0590,3743086.5800,2580.00 1 0 C8
-text 268789.5590,3743094.4228,2615.00 1 0 C9
-text 268789.5590,3743245.9540,2615.00 1 0 F8

将以上内容使用记事本另存为扩展名为.scr的文件即可,需要注意的是文中的空行相当于按空格键(或右键、回车等确认输入),因此不能有多余的或删除其中必不可少的空行。

你可能感兴趣的:(AutoCAD,Civil,3D,AutoCAD,Civil,3D工程测量应用,脚本)