明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1226|回复: 1

[提问] 怎么把DCL合并到LISP中

[复制链接]
发表于 2015-2-3 14:34:41 | 显示全部楼层 |阅读模式
怎么把DCL合并到LISP中 那位高手帮个忙
;;dcl对话框
cmm:dialog {
    height = 20 ;
    label = "选择物体改变其图层" ;
    :list_box {
        fixed_width_font = true ;
        height = 20 ;
        key = "lism" ;
        label = "图层名称选单:" ;
    }
    ok_cancel;
}

;;;LISP程序

(DEFUN C:test (/ os ce bm ss se la )
(setvar "cmdecho" 0)
(setq ss (ssget))
(if (not (null ss))
  (mpcm)
)
       (princ)
)
;;;;;;
(defun mpcm (/ w lay sslay dcl_id do_what value tbl lism selm
  lenth layer clayer num a b no tem_list cood)
(SETQ W (TBLNEXT "LAYER" T))
(WHILE (/= NIL W)
  (SETQ LAY (CDR (ASSOC 2 W)))
  (if (/= (STRCASE lay) "DEFPOINTS")
  (SETQ SSLAY (append SSLAY (list LAY)))
  )
  (SETQ W (TBLNEXT "LAYER"))
)

      (setq dcl_id (load_dialog "cmm.dcl"))
(setq do_what 3)
    (while (> do_what 1)
(if (not (new_dialog "cmm" dcl_id)) (exit))
(mode_tile "lism" 2)
(start_list "lism" 2)
(mapcar 'add_list SSLAY)
(end_list)
(action_tile "selm" "(done_dialog 2)")
(action_tile "lism" "(setq value $value)")
(action_tile "accept" "(setq value (get_tile \"lism\"))(done_dialog 1)")
(setq do_what (start_dialog))
(if (= 2 do_what)
     (setq ss (ssget))
)
    )

(unload_dialog dcl_id)
(if (= 1 do_what)
  (progn
   (setq lenth (read value)
    clayer (nth lenth sslay)
   )
   (setq tbl (tblsearch "layer" clayer))
   (if (not (null tbl))
                  (command "_chprop" ss "" "la" clayer "")
   )
  )
)
(princ))

点评

Kye
多搜搜再提问,参考以下链接 bbs.mjtd.com/thread-92336-1-1.html  发表于 2015-2-4 13:07
发表于 2015-2-6 16:12:19 | 显示全部楼层
把dcl变成字符串。
然后使用创建临时文件的方法创建dcl文件
然后在呼出。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-23 10:09 , Processed in 0.181525 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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