找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 748|回复: 2

[LISP程序]:autocadlsp程序

[复制链接]

已领礼包: 6个

财富等级: 恭喜发财

发表于 2004-12-1 17:12:51 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
;;; 程序功能简介: 通过提供图像按纽对话框,让用户选择线型,线型比例和进行线型替换


(defun c:acl(/ dcl_id do_wht              $_page pages $_str_lt ok_tip
                 s_set fx_lst tx_lst
                 $_old_ts sel_tip conv_tip i old_sel old_sca tx_s);;

   ;;; 定义子程序:
   ;;;               1. fx                       用于初始化对话框各部件
   ;;;               2. c_sel           用于选择实体
   ;;;               3. set_variablses 用于进行线型设置
   ;;;               4. $_ok_func                退出对话框并执行相应动作
   ;;; 变量说明:
   ;;;               dcl_id         调用对话框文件后返回的索引号
   ;;;               do_wht         结束对话框时的状态码, 供后处理用.
   ;;;               fx_k              记录图像按纽 key 值的变量
   ;;;               fx_lst         图像按纽序号表
   ;;;               ob, oc         用于记录 AutoCAD 系统变量 blipmode 和 cmdecho
   ;;;                         中间变量
   ;;;               $_page         当前页号
   ;;;               pages               总页数
   ;;;               $_str_lt    线型字符串
   ;;;               ok_tip         ok 标记
   ;;;               s_set               选择集
   ;;;               fx_lst         中间变量表
   ;;;               tx_lst         字符串变量表
   ;;;               tx_s              字符串变量表


  ;;; * * * * * * * 开               始   定         义           子        程   序  * * * * * * *


(defun dcl_coor (dia_box_w dia_box_h / sw sh ix iy i)
    (setq i (getvar "screensize"))
    (setq sw (car i))
    (setq sh (cadr i))
    (setq i (list (fix (/ (- sw dia_box_w) 2.0)) (+ 50 (fix (/ (- sh dia_box_h)
                                                               2.0
                                                            )
                                                       )
                                                 )
            ))
    (setq ix (car i))
    (setq iy (cadr i))
    (if (< ix 0)
        (setq ix 0)
    )
    (if (< iy 0)
        (setq iy 0)
    )
    (setq i (list ix iy))
    i
)



  ;;; =============================================================
  ;;;              $_ok_func          退出对话框并执行相应动作
  ;;; =============================================================
  (defun $_ok_func (/ ename ent_i old_lt new_lt)
    (setq ok_tip 1)
  )
  ;;; -------------------- End def $_ok_func            ------------------


  ;;; =============================================================
  ;;;              $_esel_func             edit_selection部件函数
  ;;; =============================================================
  (defun $_esel_func ( / tmpt)
    (if (check_int (setq tmpt (get_tile "edit_select_key")))
        (setq $_lt_i (atoi (setq tmpt (get_tile "edit_select_key"))))
    )
    (setq tmpt 12)
  )
  ;;; -------------------- End def $_esel_func                ------------------


  ;;; =============================================================
  ;;;              $_escal_func               edit_scale部件函数
  ;;; =============================================================
  (defun $_escal_func ( / tmpt)
    (if (check_real (setq tmpt (get_tile "edit_scale_key")))
        (setq $_ls_i  (setq tmpt (get_tile "edit_scale_key")))
    )
    (setq tmpt 12)
  )
  ;;; -------------------- End def $_escal_func    ------------------


  ;;; =============================================================
  ;;;              $_sel_func           selection部件函数
  ;;; =============================================================
  (defun $_sel_func ()
    (setq sel_tip 1)
    (setq conv_tip 0)
  )
  ;;; -------------------- End def $_sel_func              ------------------

   ;;; =============================================================
   ;;; check_real 编辑框处理程序
   ;;; =============================================================
   (defun check_real(real_number)

     (if (and (> (distof real_number 2) 0)
              (<= (distof real_number 2) 100000000.0)
              (distof real_number 2)
         )
         (progn
            (set_tile "error_text" "")
            (setq old_sca real_number)
         )
         (progn
           (set_tile "error_text"
                     "错误! 应是实数,范围(0--100000000.0)"
           )
           (set_tile "edit_scale_key" old_sca)
           nil
         )
     )
   )
   ;;; -------------------- End def check_real-----------------------


   ;;; =============================================================
   ;;; check_int 编辑框处理程序
   ;;; =============================================================
   (defun check_int( int_number )
     (if (and (>= (distoi int_number) 1)
              (<= (distoi int_number) 25)
         )
         (progn
            (set_tile "error_text" "")
            (setq old_sel int_number)
         )
         (progn
           (set_tile "error_text"
                     "错误! 应是整数,范围(1--25)"
           )
           (set_tile "edit_select_key" old_sel)
           nil
         )
     )
   )
   ;;; -------------------- End def check_int-----------------------


   ;;; =============================================================
   ;;; distoi 看是否是整数
   ;;; =============================================================
   (defun distoi( int_number / tmpt)
     (if (distof int_number 2)
         (progn
           (if (eq (atoi int_number) (distof int_number 2))
               (progn
                 (atoi int_number)
               )
               (progn
                 (setq tmpt nil)
               )
           )
         )
         (progn
           (setq tmpt nil)
         )
     )
   )
   ;;; -------------------- End def distoi-----------------------




  ;;; =============================================================
  ;;;              $_conv_func             convertion部件函数
  ;;; =============================================================
  (defun $_conv_func ()
    (setq sel_tip 0)
    (setq conv_tip 1)
  )
  ;;; -------------------- End def $_conv_func                ------------------


  ;;; =============================================================
  ;;; set_variables 用于进行线型设置
  ;;; =============================================================
  (defun set_variables()
    (setq $_str_lt (nth (1- $_lt_i) $_old_ts))

  )
  ;;; -------------------- End def set_variables ------------------



  ;;; 1. 使用 entsel, ssadd , 通过人机交互, 构造实体选择集.
  ;;; 2. 使用 sslength, ssname, entget 操作实体选择集并获取所需实体数据.
  ;;; 3. 使用 redraw 实现对选中实体的加亮与恢复,(因 entsel 不能加亮实体).
  ;;; =============================================================
  ;;; c_sel 用于选择实体
  ;;; =============================================================
  (defun c_sel( / ename i etype)
       ;;; 初始化选择集, 即构造空选择集.
       (print)

       (setq s_set (ssadd))

       (PRINC "\n请选择实体进行线型替换<回车结束>:")
       (setq enam (SSGET))
       (if enam
          (progn
              (print)
              ;;; 判断当前所选的实体是否能够修改线型, 如: block 图块就没必要
              ;;; 修改.
              (setq count 0)
              (while (< count (sslength enam))
                     (setq ename (ssname  enam count))
                     (setq count (+ 1 count))
            ;;                   (setq ename (car ename))                        ; 取实体名
                     (setq i (cdr (assoc 0 (entget ename))))
                          ;取绘图命令类型,0组码
                     (if (or (= i "LINE")
                             (= i "PLINE")
                             (= i "ARC")
                             (= i "CIRCLE")
                             (= i "ELLIPSE")
                         )
                        (setq s_set (ssadd ename s_set)) ; 将实体加入到选择集s_set
                     )
              )
           )
       )
       (setq i 0)
       (while (< i (sslength s_set))
              (progn
                  (setq ename (ssname s_set i))
                  (redraw ename 4)
                  (setq i (1+ i))
              )
       )
       (if (= (sslength s_set) 0)
           (progn
             (print)
             (princ "\n没有选到实体!\n")
           )
       )

  )
  ;;; -------------------- End def c_sel----------------------------

   ;;; =============================================================
   ;;; $_list_func 编辑框处理程序
   ;;; =============================================================
   (defun $_list_func( key value)
     (cond
       (
       (= key "edit_select_key") (set_tile key value)
       )
     )
   )
   ;;; -------------------- End def list_fucn-----------------------




   ;;; =============================================================
   ;;; ntomth 取表中从第N个元素开始M个元素子表子程序
   ;;; =============================================================
   (defun ntomth ( l_list n m / s_list i)

      (setq i 0)

      (repeat  m
        (progn
           (setq s_list (append s_list (list (nth  (+ n i) l_list))))
           (setq i (+ i 1))
        )
      )
     (setq i s_list)
   )

   ;;; -------------------- End def ntomth  -----------------------


   ;;; =============================================================
   ;;; ss_pst 返回元素在表中位置子程序
   ;;; =============================================================
   (defun ss_pst ( l_list l_elmt / pstion i)

      (setq pstion 0)
      (setq i 0)
      (repeat  (length l_list)
        (progn
           (if (= l_elmt  (nth              i l_list))
               (setq pstion i)
           )
           (setq i (+ i 1))
        )
      )
     (setq i pstion)
   )

   ;;; -------------------- End def ss_pst -----------------------


   ;;; =============================================================
   ;;; fx 初始化对话框各部件子程序
   ;;; =============================================================
   (defun fx (/ fx fx_lst1 n m fx1 fx_k i)
     ;;; 用幻灯片初始化图像按纽

     (setq n (* (1- $_page) 8))
     (if (<= (+ n 8) (length tx_s))
         (setq m 8)
         (setq m (- (length tx_s) n))
     )
     (setq fx_lst1 (ntomth tx_s n m))

    (set_tile "edit_select_key" (itoa $_lt_i))
    (set_tile "edit_scale_key"  $_ls_i)

    (set_tile "convert_button_key" "1")
    (mode_tile "last_page_key" 1)
    (mode_tile "next_page_key" 0)

     (setq i 1)
     (foreach fx1 fx_lst1
       (progn
         (setq fx_k (strcat "image_lt" (itoa i )))
         (start_image fx_k)
         (slide_image
           10 -45
           (dimx_tile fx_k) (+ (dimy_tile fx_k) 100)
           (strcat "abdac(" (nth (1- i) tx_s) ")")
         )
         (end_image)
         (setq i (1+ i))
       )
     )

   )
   ;;; -------------------- End def fx -----------------------------


  ;;; =============================================================
  ;;; $_last_func 上一页按钮处理子程序
  ;;; =============================================================
  (defun $_last_func ( / n m fx_lst1 tx_lst1 i fx1 fx_k image_key tx1 )
    (setq $_page (- $_page 1))
    (mode_tile "last_page_key" 0)
    (mode_tile "next_page_key" 0)
    (if (<= $_page 1)
        (progn
          (setq $_page 1)
          (mode_tile "last_page_key" 1)
          (mode_tile "next_page_key" 0)
        )
    )


     (setq n (* (1- $_page) 8))
     (if (<= (+ n 8) (length tx_s))
         (setq m 8)
         (setq m (- (length tx_s) n))
     )
     (setq fx_lst1 (ntomth tx_s n m))
     (setq tx_lst1 (ntomth tx_s n m))


     (setq i 1)
     (foreach fx1 fx_lst1
       (progn
         (setq fx_k (strcat "image_lt" (itoa i )))
         (start_image fx_k)
           ;; 用背景色填充图像区域 (即清除上一个图像)
           (fill_image 0 0 (dimx_tile fx_k) (dimy_tile fx_k) 0)
         (end_image)
         (start_image fx_k)
           (slide_image  10 -45  (dimx_tile fx_k) (+ 100 (dimy_tile fx_k))
                 (strcat "abdac(" (nth (1- i) tx_lst1) ")")
           )
         (end_image)
         (setq i (1+ i))
         (mode_tile fx_k 0)
       )
     )

     (repeat (- 8 (length fx_lst1))
       (progn
         ;; 当前图像按钮无定义.
         (setq image_key (strcat "image_lt" (itoa i)))
         (progn
             (start_image image_key)
               ;; 用背景色填充图像区域 (即清除上一个图像)
               (fill_image 0 0 (dimx_tile image_key)
               (dimy_tile image_key) 0)
             (end_image)
             ;; 淡化图像按钮部件.
             (mode_tile image_key 1)
         )
         (setq i (1+ i))
       )
     )

     (setq i 1)
     (foreach tx1 tx_lst1
       (progn
         (set_tile (strcat "text" (itoa i)) tx1)
         (setq i (1+ i))
       )
     )

     (repeat (- 8 (length fx_lst1))
       (progn
         (set_tile (strcat "text" (itoa i)) "")
         (setq i (1+ i))
       )
     )
  )
  ;;; -------------------- End def $_last_func ----------------------



  ;;; =============================================================
  ;;; $_next_func 下一页按钮处理子程序
  ;;; =============================================================
  (defun $_next_func ( / n m fx_lst1 tx_lst1 i fx1 fx_k image_key tx1 )
    (setq $_page (+ $_page 1))
    (mode_tile "last_page_key" 0)
    (mode_tile "next_page_key" 0)
    (if (>= $_page pages)
        (progn
          (setq $_page pages)
          (mode_tile "last_page_key" 0)
          (mode_tile "next_page_key" 1)
        )
    )
     (setq n (* (1- $_page) 8))
     (if (<= (+ n 8) (length tx_s))
         (setq m 8)
         (setq m (- (length tx_s) n))
     )
     (setq fx_lst1 (ntomth tx_s n m))
     (setq tx_lst1 (ntomth tx_s n m))

     (setq i 1)
     (foreach fx1 fx_lst1
       (progn
         (setq fx_k (strcat "image_lt" (itoa i )))
         (start_image fx_k)
;; 用背景色填充图像区域 (即清除上一个图像)
           (fill_image 0 0 (dimx_tile fx_k) (dimy_tile fx_k) 0)
         (end_image)
         (start_image fx_k)
           (slide_image  10 -45  (dimx_tile fx_k) (+ (dimy_tile fx_k) 100)
                  (strcat "abdac(" (nth (1- i) tx_lst1) ")")
           )
          (end_image)
         (setq i (1+ i))
         (mode_tile fx_k 0)
       )
     )

     (repeat (- 8 (length fx_lst1))
       (progn
         ;; 当前图像按钮无定义.
         (setq image_key (strcat "image_lt" (itoa i)))
         (progn
             (start_image image_key)
               ;; 用背景色填充图像区域 (即清除上一个图像)
               (fill_image 0 0 (dimx_tile image_key)
               (dimy_tile image_key) 0)
             (end_image)
             ;; 淡化图像按钮部件.
             (mode_tile image_key 1)
         )
         (setq i (1+ i))
       )
     )

     (setq i 1)
     (foreach tx1 tx_lst1
       (progn
         (set_tile (strcat "text" (itoa i)) tx1)
         (setq i (1+ i))
       )
     )

     (repeat (- 8 (length fx_lst1))
       (progn
         (set_tile (strcat "text" (itoa i)) "")
         (setq i (1+ i))
       )
     )
  )
  ;;; -------------------- End def $_next_func ----------------------



  ;;; =============================================================
  ;;; r_file 读文件处理子程序
  ;;; =============================================================
  (defun r_file(/ file i str ch str1 pathname)
   ;(setq pathname (strcat (substr (getenv "lisp") 1 2)
        ;                  "\\abdac\\menu\\"))
   ;(setq file (open (strcat pathname "acad.lin") "r"))
   (setq pathname (findfile "acad.lin"))
        (setq file (open pathname "r"))

   (setq tx_s nil)

   (while (setq str (read-line file))
          (progn
            (setq ch (substr str 1 1))
            (if (= ch "*")
                (progn
                  (setq i 1)
                  (while (and (setq ch (substr str i 1))
                              (/= ch ",")
                              (<= i (strlen str))
                         )
                         (progn
                            (setq i (1+ i))
                         )
                  )
                  (setq str1 (substr str 2 (- i 2)))
                  (setq tx_s (cons str1 tx_s))
                ) ;end progn
            ) ; end if
          )
   )
   (setq $_old_ts tx_s)
   (setq $_old_ts (cons "CONTINUOUS" $_old_ts))

   (close file)
  )
  ;;; -------------------- End def r_file ----------------------


  ;;; =============================================================
  ;;; after_r 读文件后处理子程序
  ;;; =============================================================
  (defun after_r(/ file i old_str new_str )
    (setq i 0)
    (while (< i (length tx_s))
           (progn
              (setq old_str (nth i tx_s))
              (if (> (strlen old_str) 8)
                  (progn
                     (setq new_str (substr old_str 1 8))
                     (setq tx_s (subst new_str old_str tx_s))
                  )
              )
              (setq i (1+ i))
           ) ; end progn
    ) ;end while
    (setq tx_s (cons "CONTINUO" tx_s))

  )
  ;;; -------------------- End def after_r ----------------------



  ;;; =============================================================
  ;;; simu_func 模拟显示处理子程序
  ;;; =============================================================
  (defun simu_func(/ ltsc ename i ent_i old_lt new_lt cur_lt)

       (setq cur_lt (getvar "celtype"))

       (while (< (sslength dset) 1)

              (setq ename (entsel "\n请选择一个实体...\n"))

              (print)
              ;;; 判断当前所选的实体是否能够修改线型, 如: block 图块就没必要
              ;;; 修改.
              (setq ename (car ename))                            ; 取实体名
              (setq i (cdr (assoc 0 (entget ename)))) ; 取绘图命令类型,0 组码
              (if (or (= i "LINE")
                      (= i "PLINE")
                      (= i "ARC")
                      (= i "CIRCLE")
                      (= i "ELLIPSE")
                  )
                  (progn
                     (setq dset (ssadd ename dset)) ; 将实体加入到选择集s_set
;                      (redraw ename 3) ; 加亮选中的实体, 因 entsel 不能加亮实体
                  )
              )
       )

       (command "linetype" "s"  $_str_lt "")

                  (setq ename (ssname dset 0))
                  (setq ent_i  (entget ename))
                  (setq old_lt (assoc 6 ent_i) new_lt (cons 6 $_str_lt))
                  (if old_lt
                    (setq ent_i (subst new_lt old_lt ent_i))
                    (setq ent_i (cons new_lt ent_i))
                  )
                  (entmod ent_i)

       (setq ltsc (getvar "ltscale"))
       (command "ltscale" (atof $_ls_i))
       (getint "\n请输入回车返回...\n")
       (print)

       (command "ltscale" ltsc)
       (command "linetype" "s"  cur_lt "")
                  (if old_lt
                    (setq ent_i (subst old_lt new_lt ent_i))
                    (setq ent_i (cons new_lt ent_i))
                  )
                  (entmod ent_i)
       (princ "\n")
       (princ "模拟显示完毕!\n")


  )
  ;;; -------------------- End def simu_func ----------------------



   ;;; *************************************************************

   ;;;                               主    程    序         开            始
   ;;; *************************************************************


  ;;; 1. 初始化系统环境
  (setq ob(getvar "blipmode"))
  (setq oc(getvar "cmdecho"))
  (setvar "blipmode" 0)
  (setvar "cmdecho" 0)


  (r_file)
  (after_r)

  (setq $_ls_i (rtos (getvar "ltscale")))
  (setq $_ls_i (if (< (atof $_ls_i) 10) "400.0" $_ls_i))
  (setq $_str_lt "continuous")
  (setq $_str_lt (getvar "celtype"))
  (setq $_lt_i (ss_pst tx_s $_str_lt))
  (setq $_lt_i (1+ $_lt_i))

  (setq ok_tip 0)
  (setq sel_tip 0)
  (setq conv_tip 0)


  ;;; set dset a nil variable
  (setq dset (ssadd))

  (if (> (/ (length tx_s) 8.0) (/ (length tx_s) 8))
      (setq pages (+ (/ (length tx_s) 8) 1))
      (setq pages (/ (length tx_s) 8))

  )

  (setq $_page 1)

  ;;; 2. 调入对话框资源文件 "main.dcl"
  (setq dcl_id (read (getvar "users5")))
  (setq dcl_id (load_dialog "l_type.dcl"))
  (mode_tile "last_page_key" 1)
  (mode_tile "next_page_key" 0)

  (setq old_sel "1")
  (setq old_sca "2000.0")

  (setq do_wht 10)
  (while (> do_wht 1)
    ;;; 3. 显示对话框 "lt"
    (if (new_dialog "l_type" dcl_id "" (dcl_coor 352 402))
      (progn

        ;;; 4. 初始化对话框各部件
        (fx)


        ;;; 5. * * * * * * 将事件函数挂在部件上 * * * * * * *
        ;;; 5.1 将事件函数挂在各个按纽上
        (action_tile "cancel"             "(done_dialog 0)")
        (action_tile "accept"             "($_ok_func)(done_dialog 1)")
        (action_tile "help" "($_do_help \"ltype,__________线型\")")
        (action_tile "select_button_key"  "($_sel_func)")
        (action_tile "convert_button_key" "($_conv_func)")
        (action_tile "simulate_button_key"
         "(setq $_ls_i (get_tile \"edit_scale_key\"))
          (setq $_str_lt (nth (1- $_lt_i) $_old_ts)) (done_dialog 4)")
        (action_tile "last_page_key"      "($_last_func )")
        (action_tile "next_page_key"      "($_next_func )")
        (action_tile "edit_select_key"    "($_esel_func)")
        (action_tile "edit_scale_key"     "($_escal_func)")

        ;;; 5.2 将事件函数挂在各个图像按纽上
        (action_tile "image_lt1" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 1))))")
        (action_tile "image_lt2" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 2))))")
        (action_tile "image_lt3" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 3))))")
        (action_tile "image_lt4" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 4))))")
        (action_tile "image_lt5" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 5))))")
        (action_tile "image_lt6" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 6))))")
        (action_tile "image_lt7" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 7))))")
        (action_tile "image_lt8" "($_list_func \"edit_select_key\"
                      (itoa  (setq $_lt_i (+ (* (1- $_page) 8) 8))))")
        (setq do_wht (start_dialog))

        (cond
          (
             (= do_wht 1)  ($_ok_func)
          )
          (
             (= do_wht 4)  (simu_func)
          )
        ) ; end cond
      ) ;end progn
    ) ; end if
  ) ;end while

   ;;; 恢复系统设置
   (setvar "blipmode" ob)
   (setvar "cmdecho" oc)
   (if (= ok_tip 1)
     (progn
       (command "ltscale" $_ls_i)
       (if (= sel_tip 1)
           (progn
             (set_variables)
             (command "linetype" "s" $_str_lt "")
           )
       )
       (if (or (= conv_tip 1) (/= sel_tip 1))
           (progn
             (set_variables)
             (c_sel)
             (command "linetype" "s" $_str_lt "")
             (setq i 0)
             (repeat (sslength s_set)
               (progn
                  (setq ename (ssname s_set i))
                  (setq ent_i  (entget ename))
                  (setq old_lt (assoc 6 ent_i) new_lt (cons 6 $_str_lt))
                  (if old_lt
                    (setq ent_i (subst new_lt old_lt ent_i))
                    (setq ent_i (cons new_lt ent_i))
                  )
                  (entmod ent_i)
                  (setq i (1+ i))
               )     ;end progn
             )                ;end repeat
           )  ;end progn
       )  ;end if
     )                ;end progn
   )   ;end if

   (princ)
)

;;;----------------主  程  序  定  义  结  束----------------------



l_type:dialog
{
  label = "线型操作";
     :column
     {
       label = "请选择线型...";
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt1";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "CONTINUOU";
          key        = "text1";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt2";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "BORDER";
          key        = "text2";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt3";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "BORDER2";
          key        = "text3";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt4";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "BORDERX2";
          key        = "text4";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt5";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          label = "CENTER";
          key        = "text5";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt6";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "CENTER2";
          key        = "text6";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt7";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "CENTERX2";
          key        = "text7";
        }
       }
       :row
       {
        :image_button
        {
          is_tab_stop = false;
          key = "image_lt8";
          height = 1;
          width = 30;
          fixed_width = true;
          color = 0;
        }
        :text
        {
          width = 10;
          value = "DASHDOT";
          key        = "text8";
        }
       }
       tabs = "10";
     }
     :row
     {
       : spacer
       {
         width = 0.5;
       }
       : button
       {
          width      = 6;
          label      = "上一页";
          is_tab_stop = false;
          key             = "last_page_key";
       }
       : spacer
       {
         width = 0.5;
       }
       : button
       {
          width      = 6;
          label      = "下一页";
          is_tab_stop = false;
          key             = "next_page_key";
       }
       : spacer
       {
         width = 0.5;
       }
     }
     :column
     {
       :row
       {
        :edit_box
        {
          key = "edit_select_key";
          label = "线型选择";
          value = "1";
          edit_limit = 12;
         }
        :edit_box
        {
          key = "edit_scale_key";
          label = "线型比例";
          value = "1.0";
          edit_limit = 12;
         }
        }
      :row
      {
       : boxed_radio_row
       {
        label = "请进行功能选择...";
        :radio_button
        {
          key = "select_button_key";
          label = "线型设置";
        }
        :radio_button
        {
          key = "convert_button_key";
          label = "线型替换";
        }
       }
      :column
      {
        :spacer
        {
         width = 0.5;
        }
        :button
        {
          key = "simulate_button_key";
          label = "模拟显示<";
        }
      }
    }
    }
   : row
   {
      alignment = centered;
      fixed_width = true;
      : button
      {
        width           = 8;
        label           = "   OK   ";
        key           = "accept";
        is_default = true;
      }
     : spacer
     {
        width = 0.5;
     }
     : button
     {
        width          = 6;
        label          = "  取消  ";
        key          = "cancel";
        is_cancel = true;
     }
     : spacer
     {
        width = 0.5;
     }
     : spacer
     {
        width = 0.5;
     }
     : button
     {
        width          = 6;
        label          = "帮助H...";
        key          = "help";
        mnemonic = "H";
     }
   }
   :text
   {
      height = 2;
     label = "";
     key = "error_text";
   }
}
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2004-12-1 20:18:09 | 显示全部楼层
替换线型这么麻烦?强化格式刷!刷!刷!刷!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-12-1 21:09:33 | 显示全部楼层
没有必要单独编写一个程序吧。如果只是变线性的话,只要象楼上说的那样,用格式刷就行了。如果需要用户选择没有加载的线性。那么用autocad的命令一样能实现,而且不见得很繁琐。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-27 17:33 , Processed in 0.388314 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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