解密后的一部分代码:
- ;表格调整程序.
- (defun c:bgad(/ ss)
- (setvar "cmdecho" 0)
- (defun *error* (msg)
- (princ "Good Luck!")
- (prin1)
- )
- (prompt "\n****** Designer: WenQingDong ******\n本程序用于调整简单横竖表格,注:表格内文字必须是居中对齐的多行文本,用于调整由"bg"和"bg1"命令生成的表格效果最好.")
- (setq ss nil)
- (princ "\n请框选表格和表格的标题,请勿选中表格以外的水平和竖直线条:")
- (setq ss (ssget)) ;选取对象加入选择集.
- (if (/= ss nil) (bgad_fc))
- (prin1)
- )
- (defun bgad_fc(/ n n_line n_line_h en endata os_mode)
- (setq line_list '())
- (setq text_list '())
- (setq line_list_h '())
- (setq n 0 n_line 0 n_line_h 0) ;定义计数器变量.
- (repeat (sslength ss) ;以选择集中的对象个数建立循环.
- (setq en (ssname ss n)) ;获取第n个对象的图元名.
- (setq endata (entget en)) ;获取第n个对象的联合属性列表.
- (cond ((= (cdr (assoc 0 endata)) "LINE")
- (progn
- (if (< (abs (- (cadr (assoc 10 endata)) (cadr (assoc 11 endata)))) 0.0001)
- (progn
- (setq line_list (cons (list n_line en) line_list))
- (setq n_line (1+ n_line))
- )
- )
- (if (< (abs (- (caddr (assoc 10 endata)) (caddr (assoc 11 endata)))) 0.0001)
- (progn
- (setq line_list_h (cons (list n_line_h en) line_list_h))
- (setq n_line_h (1+ n_line_h))
- )
- )
- )
- )
- ((= (cdr (assoc 0 endata)) "MTEXT")
- (setq text_list (cons en text_list))
- )
- )
- (setq n (1+ n))
- )
- (setq os_mode (getvar "osmode"))
- (setvar "osmode" 0)
- (if (and (/= line_list nil) (/= line_list_h nil) (/= text_list nil))
- (progn
- (setq line_list (reverse line_list))
- (setq line_list_h (reverse line_list_h))
- (bgad_line)
- (bgad_line1)
- (bgad_text_class)
- (setq text_height (cdr (assoc 40 (entget (nth 0 text_list)))))
- )
- )
- (if (and (/= line_list nil) (/= line_list_h nil) (/= text_list nil))
- (progn
- (bgad_tl)
- (bgad_hline)
- (biaoti_txt)
- (bgad_tl1)
- (bgad_hline1)
- )
- )
- (setvar "osmode" os_mode)
- )
: |