zoukankan      html  css  js  c++  java
  • AutoLISP切换开关toggle设计设置系统变量

    AutoLISP切换开关toggle设计设置系统变量,DCL对话框代码如下。

    dia6a:dialog {
        label = "TOGGLE切换开关应用" ;
        :boxed_column {
            label = "开关设定" ;
            :toggle {
                key = "tg_attdia" ;
                label = "ATTDIA属性对话框输入" ;
            }
            :toggle {
                key = "tg_dispsilh" ;
                label = "DISPSILH仅显示轮廓线" ;
            }
            :toggle {
                key = "tg_textfill" ;
                label = "TEXTFILL文字填充控制" ;
            }
            :toggle {
                key = "tg_fillmode" ;
                label = "FILLMODE对象填充模式" ;
            }
        }
        :boxed_column {
            label = "命令记录" ;
            :toggle {
                key = "tg_logfilemode" ;
                label = "LOGFILMODE命令记录开关" ;
            }
            :edit_box {
                edit_width = 30 ;
                key = "logfilemode" ;
                label = "命令记录文件" ;
            }
        }
        spacer_1;
        ok_cancel;
    }

    LSP文件代码如下。

    (defun c:dia6a ()
        (setvar "cmdecho" 0)
        (dcl_dia6a)
        (prin1)
    )
    (defun dcl_dia6a ()
        (setq dcl_id (load_dialog "dia6a"))
        (new_dialog "dia6a" dcl_id)
        (set_tile "tg_attdia" (itoa (getvar "attdia")))
        (set_tile "tg_dispsilh" (itoa (getvar "dispsilh")))
        (set_tile "tg_textfill" (itoa (getvar "textfill")))
        (set_tile "tg_fillmode" (itoa (getvar "textfill")))
        (set_tile "tg_logfilemode" (itoa (getvar "logfilemode")))
        (set_tile "logfilename" (getvar "logfilename"))
        (action_tile "accept" "(ok_dia6a) (done_dialog 1)")
        (action_tile "cancel" "(cancel_dia6a) (done_dialog 1)")
        (setq dd (start_dialog))
    )
    (defun ok_dia6a    ()
        (setvar "attdia" (atoi (get_tile "tg_attdia")))
        (setvar "dispsilh" (atoi (get_tile "tg_dispsilh")))
        (setvar "textfill" (atoi (get_tile "tg_textfill")))
        (setvar "fillmode" (atoi (get_tile "tg_fillmode")))
        (setvar "logfilemode" (atoi (get_tile "tg_logfilemode")))
        (setvar "logfilename" (get_tile "logfilename"))
    )
    (defun cancel_dia6a ()
        (alert
        "取消\n返回【-1】给(start_dialog)函数\n所以【dd】=【-1】"
        )
    )

    代码完。

    作者:codee
    文章千古事,得失寸心知。


  • 相关阅读:
    usually study notebook
    (转)轻松掌握shell编程中数组的常见用法及示例
    (转)python学习链接
    (转)Python作业day2购物车
    (转)python 列表与元组的操作简介
    (转)总结Linux的chattr与lsattr命令详解
    mysql特殊语句学习
    PHP位操作符
    html5中script的async属性
    jquery资源
  • 原文地址:https://www.cnblogs.com/bimgoo/p/2503065.html
Copyright © 2011-2022 走看看