用下面的LISP实现!!
(defun c:star ()
(setvar "cmdecho" 0);控制在 AutoLISP 的 command 函数运行时 AutoCAD 是否回显提示和输入。
(prin1 "This program is Design by 向赞扬!")
(if (null (tblsearch "style" "GB"));设置文字式样gb
(command "style" "gb" "gbeitc,gbcbig" "" "1" "" "" "")
)
(setvar "blipmode" 0);控制点标记的显示
(setvar "whipthread" 3);控制是否可以使用其他处理器(即多线程处理)来提高操作速度
(setvar "plinewid" 0);存储多段线的默认宽度
(setvar "auprec" 2);设置所有只读角度单位
(setvar "limmin" '(0 0));存储当前空间的左下方图形界限
(setvar "limmax" '(999999 999999));存储当前空间的右上方图形界限
(setvar "lunits" 2);设置线性单位
(setvar "autosnap" 63);控制自动捕捉标记、工具栏提示和磁吸
(setvar "pdmode" 35);控制如何显示点对象
(setvar "tilemode" 1);将“模型”选项卡或最后一个布局选项卡置为当前
(setvar "luprec" 2);设置所有只读线性单位和可编辑线性单位的小数位位数
(setvar "aunits" 1);设置角度单位
(setvar "angbase" 0.0);相对于当前 UCS 将基准角设置为 0 度
(setvar "angdir" 0);设置正角度的方向
(setvar "MirrText" 0);控制 MIRROR 命令影响文字的方式
(setvar "dimatfit" 3);当尺寸界线的空间不足以同时放下标注文字和箭头时,本系统变量将确定这两者的排列方式
(setvar "aperture" 10);控制对象捕捉靶框大小
(vl-cmdf "grid" "off");在当前视口中显示点栅格
(setvar "dimtxsty" "gb");指定标注的文字样式
(setvar "dimclrd" 256);为尺寸线、箭头和标注引线指定颜色
(setvar "dimlwd" -3);指定尺寸线的线宽。其值是标准线宽
(setvar "dimdli" 5);控制基线标注中尺寸线的间距
(setvar "dimclre" 256);为尺寸界线指定颜色
(setvar "dimtih" 0);控制所有标注类型(坐标标注除外)的标注文字在尺寸界线*内的位置
(setvar "dimtoh" 0);控制所有标注类型(坐标标注除外)的标注文字在尺寸界线*外的位置
(setvar "dimlwe" -3);指定尺寸界线的线宽
(setvar "dimexe" 2.00);指定尺寸界线超出尺寸线的距离
(setvar "dimexo" 0);指定尺寸界线偏移原点的距离
(COMMAND "dimsah" "off");控制尺寸线箭头块的显示
(setvar "dimblk" "");设置尺寸线或引线末端显示的箭头块
(setvar "dimasz" 2.5);控制尺寸线、引线箭头的大小
(setvar "dimcen" 2.5);本系统变量的绝对值指定了中心标记的大小
(setvar "dimclrt" 256);为标注文字指定颜色
(setvar "dimtxt" 3.5);指定标注文字的高度,除非当前文字样式具有固定的高度
(setvar "dimtfac" 0.6);按照 DIMTXT 系统变量的设置,相对于标注文字高度给分数值和公差值的文字高度指定比例因子
(setvar "dimtad" 0);控制文字相对尺寸线的垂直位置
(setvar "dimjust" 0);控制标注文字的水平位置
(setvar "dimgap" 0.625);设置标注文字周围的距离
(setvar "dimtix" 0);在尺寸界线之间绘制文字
(COMMAND "dimsoxd" "off");控制是否允许尺寸线绘制到尺寸界线之外
(setvar "dimtmove" 0);设置标注文字的移动规则
(setvar "dimscale" 1);为标注变量(指定尺寸、距离或偏移量)设置全局比例因子
(setvar "dimupt" 1);控制用户定位文字的选项
(COMMAND "dimtofl" "on");控制是否将尺寸线绘制在尺寸界线之间(即使文字放置在尺寸界线之外
(setvar "dimlunit" 2);为所有标注类型(除角度标注外)设置单位制
(setvar "dimdec" 2);设置标注主单位显示的小数位位数
(setvar "dimfrac" 0);在 DIMLUNIT 系统变量设置为 4(建筑)或 5(分数)时设置分数格式
(setvar "dimdsep" ".");指定一个单字符作为创建十进制标注时使用的小数分隔符
(setvar "dimrnd" 0.00);将所有标注距离舍入到指定值
(setvar "dimpost" "");指定标注测量值的文字前缀或后缀(或者两者都指定
(setvar "dimlfac" 1);设置线性标注测量值的比例因子
(COMMAND "SETVAR" "DIMZIN" "0" );控制是否对主单位值作消零处理
(setvar "dimaunit" 0);设置角度标注的单位格式
(setvar "dimadec" 2);控制角度标注的显示精确位数
(setvar "dimazin" 0);对角度标注作消零处理
(setvar "dimaltz" 1);控制是否对换算单位标注值作消零处理
(setvar "dimtdec" 3);为标注主单位的公差值设置显示的小数位位数
(setvar "dimtp" 0.02);为标注文字设置最大(上)偏差
(setvar "dimtm" 0.02);为标注文字设置最小(下)偏差
(setvar "dimtfac" 0.6);相对于标注文字高度给分数值和公差值的文字高度指定比例因子
(setvar "dimtolj" 1);设置公差值相对名词性标注文字的垂直对正方式
(setvar "dimtzin" 8);控制是否对公差值作消零处理
(setvar "dimalttz" 1);控制是否对公差值作消零处理。
(command "setvar" "mirrtext" 0);控制 MIRROR 命令影响文字的方式。
(command "setvar" "isavebak" 0);提高增量保存速度,特别是对于大的图形
(command "setvar" "dimtol" 0);将公差附在标注文字之后
(command "setvar" "osmode" 551);设置“对象捕捉”的运行模式:
;设置文字式样standard
(command "style" "standard" "isocp,gbcbig" "" "1" "" "" "")
(command "style" "hztxt" "txt,hztxt" "" "1" "" "" "" "")
(command "style" "gb" "" "" "" "" "" "");设置文字式样gb为当前
(If (Null (Tblsearch "ltype" "center2"));加载线型center2
(command "linetype" "load" "center2" "acad" ""))
(If (Null (Tblsearch "ltype" "hidden2"));加载线型hidden2
(command "linetype" "load" "hidden2" "acad" ""))
(If (Null (Tblsearch "ltype" "phantom2"));加载线型phantom2
(command "linetype" "load" "phantom2" "acad" ""))
(if (null (tblsearch "LAYER" "Product"));创建图层Product
(command "layer" "m" "Product" "c" 6 "" "l" "phantom2" "" "lw" 0.18
"" "")
)
(if (null (tblsearch "LAYER" "Cen"));创建图层Cen
(command "layer" "m" "Cen" "c" 2 "" "l" "center2" "" "lw" 0.18 "" "")
)
(if (null (tblsearch "LAYER" "Dim"));创建图层Dim
(command "layer" "m" "Dim" "c" 7 "" "l" "continuous" "" "lw" 0.18 ""
"")
)
(if (null (tblsearch "LAYER" "Hatch"));创建图层Hatch
(command "layer" "m" "Hatch" "c" 3 "" "l" "continuous" "" "lw" 0.18
"" "")
)
(if (not (tblsearch "LAYER" "Hidden"));创建图层Hidden
(command "layer" "m" "Hidden" "c" 4 "" "l" "hidden2" "" "lw" 0.18 ""
"")
)
(if (not (tblsearch "LAYER" "Line-part"));创建图层Line-part
(command "layer" "m" "Line-part" "c" 1
"" "l" "continuous" "" "lw"
0.42 "" ""
)
)
(if (not (tblsearch "LAYER" "Text"));创建图层Text
(command "layer" "m" "Text" "c" 7 "" "l" "continuous" "" "lw" 0.18
"" "")
)
(if (not (tblsearch "LAYER" "Outline-3D"));创建图层Outline-3D
(command "layer" "m" "Outline-3D" "c" 3
"" "l" "phantom2" "" "lw"
0.18 "" ""
)
)
(if (not (tblsearch "LAYER" "Lab-RPS"));创建图层Lab-RPS
(command "layer" "m" "Lab-RPS" "c" 5
"" "l" "continuous" "" "lw"
0.18 "" ""
)
)
(if (not (tblsearch "LAYER" "Label"));创建图层Label
(command "layer" "m" "Label" "c" 7 "" "l" "continuous" "" "lw" 0.18
"" "")
)
(if (not (tblsearch "dimstyle" "0.3"));创建标注样式标注特征比例为0.3
(command "dimscale" 0.3 "-dimstyle" "s" "0.3")
)
(if (not (tblsearch "dimstyle" "0.5"));创建标注样式标注特征比例为0.5
(command "dimscale" 0.5 "-dimstyle" "s" "0.5")
)
(if (not (tblsearch "dimstyle" "0.8"));创建标注样式标注特征比例为0.8
(command "dimscale" 0.8 "-dimstyle" "s" "0.8")
)
(if (not (tblsearch "dimstyle" "1"));创建标注样式标注特征比例为1
(command "dimscale" 1.0 "-dimstyle" "s" "1")
)
(if (not (tblsearch "dimstyle" "1.3"));创建标注样式标注特征比例为1.3
(command "dimscale" 1.3 "-dimstyle" "s" "1.3")
)
(if (not (tblsearch "dimstyle" "1.5"));创建标注样式标注特征比例为1.5
(command "dimscale" 1.50 "-dimstyle" "s" "1.5")
)
(if (not (tblsearch "dimstyle" "1.8"));创建标注样式标注特征比例为1.8
(command "dimscale" 1.8 "-dimstyle" "s" "1.8")
)
(if (not (tblsearch "dimstyle" "2"));创建标注样式标注特征比例为02
(command "dimscale" 2.0 "-dimstyle" "s" "2")
)
(if (not (tblsearch "dimstyle" "2.5"));创建标注样式标注特征比例为2.5
(command "dimscale" 2.50 "-dimstyle" "s" "2.5")
)
(if (not (tblsearch "dimstyle" "3"));创建标注样式标注特征比例为3
(command "dimscale" 3.0 "-dimstyle" "s" "3")
)
(if (not (tblsearch "dimstyle" "3.5"));创建标注样式标注特征比例为3.5
(command "dimscale" 3.50 "-dimstyle" "s" "3.5")
)
(if (not (tblsearch "dimstyle" "4"));创建标注样式标注特征比例为4
(command "dimscale" 4.0 "-dimstyle" "s" "4")
)
(if (not (tblsearch "dimstyle" "4.5"));创建标注样式标注特征比例为4.5
(command "dimscale" 4.50 "-dimstyle" "s" "4.5")
)
(if (not (tblsearch "dimstyle" "5"));创建标注样式标注特征比例为5
(command "dimscale" 5.0 "-dimstyle" "s" "5")
)
(if (not (tblsearch "dimstyle" "6"));创建标注样式标注特征比例为6
(command "dimscale" 6.0 "-dimstyle" "s" "6")
)
(if (not (tblsearch "dimstyle" "7"));创建标注样式标注特征比例为7
(command "dimscale" 7.0 "-dimstyle" "s" "7")
)
(if (not (tblsearch "dimstyle" "8"));创建标注样式标注特征比例为8
(command "dimscale" 8.0 "-dimstyle" "s" "8")
)
(if (not (tblsearch "dimstyle" "9"));创建标注样式标注特征比例为9
(command "dimscale" 9.0 "-dimstyle" "s" "9")
)
(if (not (tblsearch "dimstyle" "10"));创建标注样式标注特征比例为10
(command "dimscale" 10.0 "-dimstyle" "s" "10")
)
(command "-dimstyle" "R" "1");置1为当前标注样式
(terpri)
(prompt "**<<绘图环境设置by向赞扬>>**")
(prinC)
)
发到这个邮箱里面了,邮箱是lut609@163.com 密码是meiyouimima,密码有效期为一周,需要的话下载吧。