本帖最后由 ZZXXQQ 于 2014-4-1 08:24 编辑
- (defun c:ysyl()
- (setq cmdmode (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (dcl_yl)
- (prin1)
- )
- (defun dcl_yl()
- (if (> (setq dcl_id (load_dialog "yl.dcl")) 0) (progn
- (if (new_dialog "yl" dcl_id) (progn
- (def_ysyl)
- (action_tile "新建圆形电杆引上管" "(setq ddtype 1) (ok_ysyl)")
- (action_tile "原有圆形电杆引上管" "(setq ddtype 2) (ok_ysyl)")
- (action_tile "新建三角电杆引上管" "(setq ddtype 3) (ok_ysyl)")
- (action_tile "原有三角电杆引上管" "(setq ddtype 4) (ok_ysyl)")
- (action_tile "新设预留" "(setq ddtype 5) (ok_ysyl)")
- (action_tile "accept" "(ok_ysyl)")
- (setq dd (start_dialog))
- )
- (princ "\n无法显示对话框!")
- )
- (unload_dialog dcl_id)
- )
- (princ "\n无法加载对话框!")
- )
- (if (= dd 1) (draw_ysyl))
- )
- (defun def_ysyl()
- (if (= bl_ysyl nil)
- (set_tile "bili" "1")
- (set_tile "bili" (rtos bl_ysyl)))
- (setq sldkey_list '("新建圆形电杆引上管" "原有圆形电杆引上管" "新建三角电杆引上管" "原有三角电杆引上管" "新设预留"))
- (setq sld_list '("新建圆形电杆引上管" "原有圆形电杆引上管" "新建三角电杆引上管" "原有三角电杆引上管" "新设预留"))
- (mapcar 'show_sld sldkey_list sld_list)
- (setq ddtype 1)
- (mode_tile "新建三角电杆引上管" 3)
- )
- (defun show_sld(key sld)
- (setq x (dimx_tile key))
- (setq y (dimy_tile key))
- (start_image key)
- (fill_image 0 0 x y -2)
- (slide_image 0 0 x y sld)
- (end_image)
- )
- (defun ok_ysyl()
- (setq bl_ysyl (atof (get_tile "bili")))
- (done_dialog 1)
- )
- (defun draw_ysyl()
- (setvar "cmdecho" 0)
- (setvar "clayer" "0")
- (while (setq pt0 (getpoint "\n 请输入插入点:"))
- ; (setq r0 (/ (* (getangle pt0 "\n 请输入旋转角度值:") 180) pi))
- (command "-insert" (nth (1- ddtype) sld_list) pt0 bl_ysyl "" PAUSE)
- )
- (setvar "CMDECHO" cmdmode)
- (prin1)
- )
|