明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2023|回复: 8

qu:

[复制链接]
发表于 2002-11-24 16:07:00 | 显示全部楼层 |阅读模式
在R15中,控制LISP程序中的块属性(ATTE)显示是对话框还是命令行的系统变量到底有几个,分别是哪几个?
eg:为什么我的这段程序在R14中出的是对话框,在15中却是命令行了呢?问题出的我打"***"的一行的下面在'b_drawing_data'这个块中的属性值在R15中只出现命令行,不出现对话框.





这是一个基于AutoCAD 14.0下关于图框的插入的程序
;它可以插入A0-A4的图框;同时删除以前的图框
;本程序作者b.w
;本程序无偿使用
;如有更好建议,请联系b.w
;版本:1.1.00
;日期:27/12-2001

  (cond
     (  (and ai_dcl (listp ai_dcl)))          ; it's already loaded.

     (  (not (findfile "ai_utils.lsp"))                     ; find it
        (ai_abort "DDMODIFY"
                  (strcat "Can't locate file AI_UTILS.LSP."
                          "\n Check support directory.")))

     (  (eq "failed" (load "ai_utils" "failed"))            ; load it
        (ai_abort "DDMODIFY" "Can't load file AI_UTILS.LSP"))
  )

(defun B_DRAWING_HILITE
  (
  B_drawing_tile
  /
  )
  (if (/= B_drawing_last_slide B_drawing_tile)
     (progn
        (mode_tile B_drawing_tile 4)
        (if (/= B_drawing_last_slide nil)
           (mode_tile B_drawing_last_slide 4)
        );end-if
     );end-progn
  );end-if
  (setq B_drawing_last_slide B_drawing_tile)
);end-B_DRAWING_HILITE

(defun B_DRAWING_STAR;启动幻灯片
  (
  /
  )
  (foreach B_DRAWING '("B_DRAWING_A4" "B_DRAWING_A3" "B_DRAWING_A2" "B_DRAWING_A1" "B_DRAWING_A0" "B_DRAWING_A4_ZP" "B_DRAWING_A3_ZP" "B_DRAWING_A2_ZP" "B_DRAWING_A1_ZP" "B_DRAWING_A0_ZP"
    );对幻灯片库中的各幻灯片建立图象
    (start_image B_DRAWING)
    (slide_image 0 0 (dimx_tile B_DRAWING) (dimy_tile B_DRAWING) (strcat "B_DRAWING("B_DRAWING")")
    );end-silde_image从幻灯片库中调入幻灯片
    (end_image)
  );end-foreach
);end-B_DRAWING_STAR

(defun B_DRAWING_INIT;起动DCL,选择图框并分别赋值
  (
  /
  B_drawing_id
  B_drawing_old_cmd
  stat
  )
  (setq B_drawing_old_cmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq B_drawing_id (load_dialog "B_DRAWING"));装入B_DRAWING.DCL
  (if (not (new_dialog "B_DRAWING" B_drawing_id))
     (exit)
  );end-if
  (B_DRAWING_STAR)
  (setq stat 0)
  (set_tile "B_DRAWING_SCALE_DCL"  (ai_rtos (setq B_drawing_scale 1.0)))
  (set_tile "B_DRAWING_A4" (ai_rtos (setq stat 10104)))
  (action_tile "B_DRAWING_A4" "(B_DRAWING_HILITE B_DRAWING_A4) (setq stat 10104)")
  (action_tile "B_DRAWING_A3" "(B_DRAWING_HILITE B_DRAWING_A3) (setq stat 10103)")
  (action_tile "B_DRAWING_A2" "(B_DRAWING_HILITE B_DRAWING_A2) (setq stat 10102)")
  (action_tile "B_DRAWING_A1" "(B_DRAWING_HILITE B_DRAWING_A1) (setq stat 10101)")
  (action_tile "B_DRAWING_A0" "(B_DRAWING_HILITE B_DRAWING_A0) (setq stat 10100)")
  (action_tile "B_DRAWING_A4_ZP" "(B_DRAWING_HILITE B_DRAWING_A4_ZP) (setq stat 10114)")
  (action_tile "B_DRAWING_A3_ZP" "(B_DRAWING_HILITE B_DRAWING_A3_ZP) (setq stat 10113)")
  (action_tile "B_DRAWING_A2_ZP" "(B_DRAWING_HILITE B_DRAWING_A2_ZP) (setq stat 10112)")
  (action_tile "B_DRAWING_A1_ZP" "(B_DRAWING_HILITE B_DRAWING_A1_ZP) (setq stat 10111)")
  (action_tile "B_DRAWING_A0_ZP" "(B_DRAWING_HILITE B_DRAWING_A0_ZP) (setq stat 10110)")
  (action_tile "B_DRAWING_SCALE_DCL" "(setq B_drawing_scale (distof $value))")
  (action_tile "cancel" "(done_dialog)(exit)")
  (action_tile "accept" "(done_dialog stat)");初始化ACCDPT
  (setq B_drawing_what (start_dialog))
  (setvar "USERR1" B_drawing_scale)
  (cond
    ((= B_drawing_what 10100)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A0")
     (setq B_drawing_date_x (* B_drawing_scale 999.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 10.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10101)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A1")
      (setq B_drawing_date_x (* B_drawing_scale 651.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 10.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10102)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A2")
      (setq B_drawing_date_x (* B_drawing_scale 404.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 10.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10103)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A3")
      (setq B_drawing_date_x (* B_drawing_scale 235.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 5.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10104)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A4")
      (setq B_drawing_date_x (* B_drawing_scale 25.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 5.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10110)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A0_ZP")
      (setq B_drawing_date_x (* B_drawing_scale 999.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 10.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10111)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A1_ZP")
      (setq B_drawing_date_x (* B_drawing_scale 651.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 10.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10112)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A2_ZP")
      (setq B_drawing_date_x (* B_drawing_scale 404.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 10.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10113)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A3_ZP")
      (setq B_drawing_date_x (* B_drawing_scale 235.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 5.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
    ((= B_drawing_what 10114)
      (setvar "USERI1" 1)
      (setq B_drawing_name "*B_DRAWING_A4_ZP")
      (setq B_drawing_date_x (* B_drawing_scale 25.0))
      (setq B_drawing_date (list B_drawing_date_x (* B_drawing_scale 5.0) 0.0))
      (setq B_drawing_x_scale 1)
      (setq B_drawing_y_scale 1)
    )
);end-cond

);end-B_DRAWING_INIT

(defun B_DRAWING_INS;无图框时插入图框
  (
  /
  )
  (if (null B_INITVAR_SYS) (load "B_INITVAR_SYS"))
  (B_INITVAR_SYS)
  (setvar "OSMODE"        0)
  (command "insert" B_drawing_name "0,0,0" B_drawing_scale "0")
  (command "zoom" "e")
  (setvar "ATTDIA"        1)
  (setq B_drawing_date_layer (getvar "CLAYER"))
  (if (tblsearch "layer" "_TEMPLATE")
    (setvar "CLAYER" "_TEMPLATE")
  );end-if
;*****************************************************************
(setvar "ATTDIA"        1)
  (command "insert" "B_DRAWING_DATA" B_drawing_date B_drawing_date_scale_x0 B_drawing_date_scale_y0 "0")
  (setvar "CLAYER" B_drawing_date_layer)
  (setvar "OSMODE"        51)
);end-B_DRAWING_INS

(defun B_DRAWING_CHANGE;更改图框
  (
  /
  B_drawing_block_sset
  B_drawing_attrib_ent
  B_drawing_attrib_data
  B_drawing_attrib_list
  B_drawing_dwgset
  B_drawing_attrib_input
  )
  (if (ssget "x" (list (cons 0 "INSERT") (cons 2 "B_DRAWING_DATA")))
    (progn
      (setq B_drawing_block_sset (ssget "x" (list (cons 0 "INSERT") (cons 2 "B_DRAWING_DATA"))))
      (setq B_drawing_attrib_ent (entnext (ssname B_drawing_block_sset 0)))
      (while (/= (cdr (assoc 0 (entget B_drawing_attrib_ent))) "SEQEND")
        (setq B_drawing_attrib_data (cdr (assoc 1 (entget B_drawing_attrib_ent))))
        (setq B_drawing_attrib_list (append B_drawing_attrib_list (list B_drawing_attrib_data)))
        (setq B_drawing_attrib_ent (entnext B_drawing_attrib_ent))
      );end-while取B_DRAWING_DATA块的属性值
      (setq B_drawing_dwgset (ssget "x" (list (cons 8 "_TEMPLATE"))))
      (if B_drawing_dwgset
        (command "erase" B_drawing_dwgset B_drawing_block_sset "")
        (command "erase" B_drawing_block_sset "")
      );end-if
      (setvar "OSMODE"        0)
      (command "insert" B_drawing_name "0,0,0" B_drawing_scale "0")
      (command "zoom" "e")
      (setvar "attdia" 0)
      (setq B_drawing_date_layer (getvar "CLAYER"))
      (if (tblsearch "layer" "_TEMPLATE")
        (setvar "CLAYER" "_TEMPLATE")
      );end-if
      (command "insert" "B_DRAWING_DATA" B_drawing_date B_drawing_date_scale_x0 B_drawing_date_scale_y0 "0")
      (setvar "OSMODE"        51)
      (while B_drawing_attrib_list
        (setq B_drawing_attrib_input (car B_drawing_attrib_list))
        (setq B_drawing_attrib_list (cdr B_drawing_attrib_list))
        (command B_drawing_attrib_input)
      );end-while
    );end-progn
    (progn
      (setq B_drawing_dwgset (ssget "x" (list (cons 8 "_TEMPLATE"))))
      (if B_drawing_dwgset
      (command "erase" B_drawing_dwgset "")
      );end-if
      (setvar "OSMODE"        0)
      (command "insert" B_drawing_name "0,0,0" B_drawing_scale "0")
      (command "zoom" "e")
      (setvar "attdia" 1)
      (setq B_drawing_date_layer (getvar "CLAYER"))
      (if (tblsearch "layer" "_TEMPLATE")
        (setvar "CLAYER" "_TEMPLATE")
      );end-if
      (command "insert" "B_DRAWING_DATA" B_drawing_date B_drawing_date_scale_x0 B_drawing_date_scale_y0 "0")
      (setvar "OSMODE"        51)
    );end-progn
  );end-if
  (setvar "CLAYER" B_drawing_date_layer)
  (setvar "attdia" 1)
);end-B_DRAWING_CHANGE

(defun B_DIM_INS;无标注时插入标注
  (
  /
  )
  (B_INITVAR_DIM)
  (setvar "DIMTIH"        1)
  (setvar "DIMTOH"        1)
  (setvar "DIMFIT"        2)
  (command "dimstyle" "S" (strcat B_drawing_dim "$3"))
  (command "dimstyle" "S" (strcat B_drawing_dim "$4"))
  (setvar "DIMFIT"        3)
  (setvar "DIMTIH"        0)
  (setvar "DIMTOH"        0)
  (command "dimstyle" "S" B_drawing_dim)
);end-B_DIM_INS

(defun B_DIM_MAKE;循环更改标注
  (
  B_drawing_den_sset
  B_dim_before
  B_dim_after
  /
  B_drawing_dim_sset_list
  B_dim_repeat_i
  )
  (setq B_dim_repeat_i 0)
  (repeat (sslength B_drawing_den_sset)
    (setq B_drawing_dim_sset_list (entget (ssname B_drawing_den_sset B_dim_repeat_i)))
    (cond
      ((= (cdr (assoc 3 B_drawing_dim_sset_list)) B_dim_before)
        (setq B_drawing_dim_sset_list (subst (cons 3 B_dim_after) (assoc 3 B_drawing_dim_sset_list) B_drawing_dim_sset_list))
      )
      ((= (cdr (assoc 3 B_drawing_dim_sset_list)) (strcat B_dim_before "$3"))
        (setq B_drawing_dim_sset_list (subst (cons 3 (strcat B_dim_after "$3")) (assoc 3 B_drawing_dim_sset_list) B_drawing_dim_sset_list))
      )
      ((= (cdr (assoc 3 B_drawing_dim_sset_list)) (strcat B_dim_before "$4"))
        (setq B_drawing_dim_sset_list (subst (cons 3 (strcat B_dim_after "$4")) (assoc 3 B_drawing_dim_sset_list) B_drawing_dim_sset_list))
      )
    );end-cond
    (entmod B_drawing_dim_sset_list)
    (setq B_dim_repeat_i (1+ B_dim_repeat_i))
  );end-repeat
);end-B_DIM_MAKE

(defun B_DIM_CHANGE;更改标注
  (
  /
  B_drawing_dim_sset
  B_drawing_lea_sset
  B_drawing_tol_sset
  B_dim_repeat_i
  B_drawing_dim_t
  )
  (setq B_drawing_dim_sset (ssget "x" (list (cons 0 "DIMENSION") (cons 3 (strcat B_drawing_dim "*")))))
  (setq B_drawing_lea_sset (ssget "x" (list (cons 0 "LEADER") (cons 3 (strcat B_drawing_dim "*")))))
  (setq B_drawing_tol_sset (ssget "x" (list (cons 0 "TOLERANCE") (cons 3 (strcat B_drawing_dim "*")))))
  (setq B_drawing_dim_t (or B_drawing_dim_sset B_drawing_lea_sset B_drawing_tol_sset))
  (if B_drawing_dim_t
    (progn
      (command "dimstyle" "S" (strcat B_dim_temp "$3"))
      (command "dimstyle" "S" (strcat B_dim_temp "$4"))
      (command "dimstyle" "S" B_dim_temp)
      (if B_drawing_dim_sset
         (B_DIM_MAKE B_drawing_dim_sset B_drawing_dim B_dim_temp)
      );end-if
      (if B_drawing_lea_sset
         (B_DIM_MAKE B_drawing_lea_sset B_drawing_dim B_dim_temp)
      );end-if
      (if B_drawing_tol_sset
         (B_DIM_MAKE B_drawing_tol_sset B_drawing_dim B_dim_temp)
      );end-if
      (command "dimstyle" "r" "STANDARD")
      (command "purge" "d" (strcat B_drawing_dim "$3") "n")
      (command "purge" "d" (strcat B_drawing_dim "$4") "n")
      (command "purge" "d" B_drawing_dim "n")
      (B_INITVAR_DIM)
      (setvar "DIMTIH"        1)
      (setvar "DIMTOH"        1)
      (setvar "DIMFIT"        2)
      (command "dimstyle" "S" (strcat B_drawing_dim "$3"))
      (command "dimstyle" "S" (strcat B_drawing_dim "$4"))
      (setvar "DIMFIT"        3)
      (setvar "DIMTIH"        0)
      (setvar "DIMTOH"        0)
      (command "dimstyle" "S" B_drawing_dim)
      (if (/= B_drawing_lea_sset nil)
        (B_DIM_MAKE B_drawing_lea_sset B_dim_temp B_drawing_dim)
      );end-if
      (if (/= B_drawing_dim_sset nil)
        (B_DIM_MAKE B_drawing_dim_sset B_dim_temp B_drawing_dim)
      );end-if
      (if (/= B_drawing_tol_sset nil)
        (B_DIM_MAKE B_drawing_tol_sset B_dim_temp B_drawing_dim)
      );end-if
      (command "purge" "d" (strcat B_dim_temp "$3") "n")
      (command "purge" "d" (strcat B_dim_temp "$4") "n")
      (command "purge" "d" B_dim_temp "n")
    );end-progn
    (progn
      (command "dimstyle" "r" "STANDARD")
      (command "purge" "d" (strcat B_drawing_dim "$3") "n")
      (command "purge" "d" (strcat B_drawing_dim "$4") "n")
      (command "purge" "d" B_drawing_dim "n")
      (B_INITVAR_DIM)
      (setvar "DIMTIH"        1)
      (setvar "DIMTOH"        1)
      (setvar "DIMFIT"        2)
      (command "dimstyle" "S" (strcat B_drawing_dim "$3"))
      (command "dimstyle" "S" (strcat B_drawing_dim "$4"))
      (setvar "DIMFIT"        3)
      (setvar "DIMTIH"        0)
      (setvar "DIMTOH"        0)
      (command "dimstyle" "S" B_drawing_dim)
    );end-progn
  );end-if
);end-B_DIM_CHANGE


(defun B_DRAWING
  (
  /
  B_drawing_what
  B_drawing_name
  B_drawing_exist
  B_drawing_last_slide
  B_drawing_tile
  B_drawing_date
  B_drawing_scale
  B_drawing_date_x
  B_drawing_x_scale
  B_drawing_y_scale
  B_drawing_date_scale_x0
  B_drawing_date_scale_y0
  B_drawing_date_layer
  B_drawing_dim
  B_dim_temp
  )
  (setvar "ATTDIA"        1)
  (B_DRAWING_INIT)
  (if (null B_INITVAR_DIM) (load "B_INITVAR_DIM"))
  (setq B_drawing_dim "B_DRAWING_DIM")
  (setq B_dim_temp "B_DIM_TEMP")
  (if (= (tblsearch "DIMSTYLE" B_drawing_dim) nul)
     (B_DIM_INS)
     (B_DIM_CHANGE)
  );end-if
  (setq B_drawing_date_scale_x0 (* B_drawing_scale B_drawing_x_scale))
  (setq B_drawing_date_scale_y0 (* B_drawing_scale B_drawing_y_scale))
  (setq B_drawing_exist (tblsearch "BLOCK" "B_DRAWING_DATA"))
  (if B_drawing_exist
    (B_DRAWING_CHANGE)
    (B_DRAWING_INS)
  );end-if
  (setvar "ORTHOMODE"        1)
  (setvar "ATTDIA"        1)
  (princ)
);end-B_DRAWING
发表于 2002-11-24 17:52:00 | 显示全部楼层

tch和建筑之星什么的有一个title.lsp,好像一摸一样,不知谁抄谁,或者

都是抄的。这个lisp简单改一下就可以用。
 楼主| 发表于 2002-11-24 18:49:00 | 显示全部楼层

re:

什么意思?
说清楚一点!!!
发表于 2002-11-25 19:08:00 | 显示全部楼层

话没说清误会了。

是你的插图框lisp让我想起天正和建筑之星的插图框程序是一样的。sorry。
 楼主| 发表于 2002-11-26 12:43:00 | 显示全部楼层

是完全一样吗?

是完全一样吗?
它也可以换图框吗?
层一样吗?
标注的设计一样吗?
发表于 2002-11-27 14:22:00 | 显示全部楼层

后者抄前者。

tch 是从建筑之星里分出去的,你说谁抄谁?
不过,你还在用建筑之星这样的老古董吗?
发表于 2002-11-28 15:45:00 | 显示全部楼层

老古董

也没什么不好,要不是平台升了,各专业软件又为大家多提供了多少新功能?
:)
发表于 2002-12-2 13:14:00 | 显示全部楼层

看来你也是个老古董啊。(千万别误会)

能够用这么老的程序的人都不简单,骨灰级!

不过,正华的东西世面上没见有盗版,难道您用的是正版吗?
 楼主| 发表于 2002-12-7 22:50:00 | 显示全部楼层

re:

不好意思,我只是想看一下它的那个程序是怎么做的,在设计中用方不方便!
一个程序在设计中好用才是真的好啊@
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 23:18 , Processed in 0.200639 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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