;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; winwin development house lt.,ltd
;; 2007.03.30  wens
;;context
;;	1.command pro	                cad环境设置
;;	2.command wdim                  标注的参数值设定
;;	3.command chc			修改所选择图形的颜色
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun c:pro()			;;;//cad环境设置
       (setvar "cmdecho" 0)
       (setvar "acadlspasdoc" 1)       ;;;;每个图面都加载acad.lsp
       (command "MBUTTONPAN" "1")      ;;;;设置鼠标的中间键使用PAN移动视窗
       (command "SHORTCUTMENU" "0")    ;;;;禁用所有默认模式、编辑模式和命令模式的快捷菜单
       (command "HIGHLIGHT" "1")       ;;;;打开选定对象亮显
       (command "PICKFIRST" "1")       ;;;;在发出命令之前选择对象
       (setvar "pickadd" 1) 		;;;（单独选择或通过窗口选择）都将添加到当前选择集
       (setvar "pickdrag" 0)           ;;;用两点法选择窗口,在一个点单击，然后单击另一点
       (setvar "pickauto" 1)           ;;;在“选择对象”提示下自动选择窗口（用于窗口选择或交叉选择）
       (command "regenauto" "on")	;;;立即自动重新生成图形
       (command "filedia" "1")	       ;;;;控制与读写文件命令一起使用的对话框的显示
       (setvar "cmdecho" 1)
       (princ)
 );;pro    //环境设置

;;标注的参数值设定
(defun c:wdim()
       	(setvar "cmdecho" 0)
        (command "dimassoc" "1")
	(command "dimdle" "0.000")
	(command "dimdli" "0.3")
	(command "dimsd1" "off")
	(command "dimsd2" "off")
	(command "dimexe" "0.5")
	(command "dimexo" "0.5")
	(command "dimaso" "on")
	(command "dimse1" "off")
	(command "dimse2" "off")
	(command "dimasz" "2.5")
	(command "dimdsep" ".")
	(command "dimupt" "on")
	(command "dimlunit" "2")
	(command "DIMTAD" "0" )
        (command "DIMTOH" "1" )    
	(command "DIMDEC" "3" )
	(command "DIMRND" "0.000" )
	(command "DIMADEC" "2" )
	(command "dimzin" "1" )
	(command "DIMATFIT" "3")
	(command "dimlfac" "1.000" )
	(command "VIEWRES" "Y" "10000" )
        (command "whiparc" "1" )
       	(setvar "cmdecho" 1)
(princ)
)


;;修改所选择图形的颜色
(DEFUN C:chc()
  (SETVAR "CMDECHO" 0)
  (SETQ ENT (SSGET))
  (SETQ COLOR (ACAD_COLORDLG 1))
  (COMMAND "CHPROP" ENT "" "C" COLOR "")
  (PRINC)
 )
