查看: 2222|回复: 0

AutoCAD自动初始化Vls程序

[复制链接]
2443725 发表于 2004-5-22 18:57 | 显示全部楼层 |阅读模式
<b><BR></b>
AutoCAD每次新建图形时标注设置和图层均需手动修改,很麻烦,几年前自作了几个lisp程序,现提供初始化样本与大家分享。下面带“;“的行根据各自环境不同而标记,建议不要去掉“;”。在AutoCAD中的VL编辑器中打开support中的acad.mnl文件将下面程序复制该文件的最后面并存盘退出AutoCAD。这样每次运行AutoCAD均可自动将图层各标注格式设置好。当然这只是绘图环境为1:1的情况。大家可对此程序修改至符合自己的习惯。


(defun s::startup()<BR>                (print)<BR>                (setvar "cmdecho" 0)<BR>                 ;(setq mnu_name (strcase (getvar "MENUNAME")))<BR>                ;setq mnu_name (substr mnu_name 3 30))<BR>;if (/= mnu_name "<A>\\bhCAD\\support\\ACAD</A>")<BR>                 ; (command "menu" "/bhcad/support/acad.mnu"))<BR>; (princ "\nBHCAD正在装载! 请稍候...")<BR>                                (setq ht_scale 1.0)<BR>                (command "layer" "M" "aid"                                 "C" "magenta" "aid"                                 "L" "hidden"                                "aid" "")<BR>                                (command "layer" "M" "bord"                                "C" "white" "bord"                                "L" "continuous" "bord""")<BR>                                (command "layer" "M" "btl"                                 "C" "green"                 "btl"                                "L" "continuous" "btl""")<BR>                                (command "layer" "M" "center"                "C" "cyan"                                 "center"                "L" "center"                                "center" "")<BR>                                (command "layer" "M" "dashed"                "C" "yellow"                "dashed"                "L" "dashed"                                "dashed" "")<BR>                                (command "layer" "M" "xdhx"                                "C" "cyan"                                "xdhx"                                "L" "center"                 "xdhx" "")<BR>                                (command "layer" "M" "cdhx"                                "C"                8                                                                "cdhx"                                "L" "center"                 "cdhx" "")<BR>                                (command "layer" "M" "jh"                                                "C" "red"                                 "jh"                                                "L" "continuous" "jh" "")<BR>                                (command "layer" "M" "mxb"                                 "C" "red"                                 "mxb"                                 "L" "continuous" "mxb" "")<BR>                                (command "layer" "M" "phantom" "C" "magenta" "phantom" "L" "phantom"                 "phantom" "")<BR>                                (command "layer" "M" "thin"                                "C" "red"                                 "thin"                                "L" "continuous" "thin" "")<BR>                                (command "layer" "M" "dim"                                 "C" "red"                                 "dim"                                 "L" "continuous" "dim" "")<BR>                                (command "layer" "M" "pmx"                                 "C" "red"                                 "pmx"                                 "L" "continuous" "pmx" "")<BR>                                (command "layer" "M" "szx"                                 "C" "blue"                                 "szx"                                "L" "continuous" "szx" "")<BR>                                (command "layer" "M" "text"                                "C" "green"                 "text"                                "L" "continuous" "text" "")<BR>                                (command "layer" "M" "blx"                                "C" "red"                 "blx"                                "L" "continuous" "blx" "")<BR>                                (command "layer" "M" "hidden"                "C" 251                                                 "hidden"                "L" "continuous" "hidden" "")<BR>                                (command "layer" "M" "solid"                 "C" "white"                 "solid"                 "L" "continuous" "solid" "")<BR>                                ;(command "Style" "UMHZ" "ROMANS,UMHZ" 0 0.75 0 "" "" "")<BR>                ;(setvar "dimtxsty" "umhz")<BR>                (setvar "dimtxt" (* 3.5 ht_scale))                (setvar "dimtvp" (* 2 ht_scale))<BR>                (setvar "dimexe" (* 3 ht_scale))                                (setvar "dimasz" (* 3.5 ht_scale))<BR>                (setvar "dimcen" (* 2.0 ht_scale))                (setvar "dimzin" 8)<BR>                (setvar "dimsho" 1) (setvar "dimexo" 0)<BR>                (setvar "dimtih" 0)                (setvar "dimtix" 1) (setvar "dimupt" 0)<BR>                (setvar "dimtoh" 0)                (setvar "dimtofl" 1) (setvar "dimtolj" 0)<BR>                (setvar "dimtad" 1)                (setvar "dimdli" (* 10 ht_scale))<BR>                (setvar "dimclrt"                3)                 (setvar "dimclrd" 1)                (setvar "dimclre" 1)<BR>                (setvar "dimgap" 2)(setvar "luprec" 2)<BR>                (setvar "pickadd" 1) (setvar "cecolor" "bylayer")(setvar "dimgap" (* 2 ht_scale))<BR>                (setvar "celtype" "bylayer")<BR>                (setq zk 0.75                 qxjd 90 gcwz "Q" mxpl "L")<BR>                (setvar "textsize" (* 3.5 ht_scale))<BR>                (setvar "ltscale" (* 10.0 ht_scale)) (setvar "hpspace" (* 2.0 ht_scale))<BR>                (setq cl (* 3.0 ht_scale))<BR>                (setq old_osmode 167)<BR>                (setvar "osmode" old_osmode)<BR>                (setvar "userr1" ht_scale)                (setvar "userr2" cl)                 (setvar "userr3" zk)<BR>                (setvar "hpscale" (* 20 ht_scale))                (setvar "hpname" "line")<BR>                (setvar "hpang" (/ pi 4))<BR>                ;load "int")<BR>                ;(load "ymcad")<BR>                ;(princ "\n欢迎您使用BHCAD系统!")<BR>                (princ)<BR>)

您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

快速回复 返回顶部 返回列表