马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
[sell](defun c:XDTB_TABLECOPYL (/ col dataRow e h i j key l pt ss styl txtl txtl1
width x
)
(defun _keyword (key)
(cond
((= key "LE")
(if (setq l (getint (xdrx_prompt "\n输入复制的列数<"
#table_copy_numcols ">:" t
)
)
)
(setq #table_copy_numcols l)
)
)
)
(_prompt)
)
(defun _prompt ()
(xdrx_prompt "\n当前设置: 复制列数(" #table_copy_numcols ")")
)
(xdrx_begin)
(xdrx_sysvar_push '("osmode" 0))
(if (not #table_copy_numcols)
(setq #table_copy_numcols 1)
)
(xdrx_initssget "\n拾取表格实体[列数(LE)]<退出>:" "LE" "" "_keyword")
(_prompt)
(if (and
(setq ss (xdrx_ssget ":E:S" '((0 . "ACAD_TABLE"))))
(setq e (ssname ss 0))
(setq pt (getpoint "\n点取要复制的列<退出>:"))
(setq pt (xdrx_table_hittest e pt '(0 0 1.0) 1.0 1.0))
)
(progn
(setq col (cadr pt)
txtl (xdrx_table_textstring e -1 col t)
dataRow (xdrx_table_numdatarows e)
styl (car (xdrx_table_textstyle e (cadr datarow) col))
width (xdrx_table_columnwidth e col)
h (xdrx_table_textheight e (cadr datarow) col)
)
(xdrx_table_insertColumns e col width #table_copy_numcols)
(setq j 0)
(repeat #table_copy_numcols
(setq i -1
txtl1 (mapcar
'(lambda (x)
(list (setq i (1+ i))
(+ col j) x
)
)
txtl
)
j (1+ j)
)
(xdrx_setpropertyvalue e "textstyle" styl "alignment" 5 "textstring"
txtl1 "textheight" h
)
)
(xdrx_prompt "\n在列 " (1+ col) " 前复制了 " #table_copy_numcols
" 列."
)
)
)
(xdrx_sysvar_pop)
(xdrx_end)
(princ)
)
[/sell] |