马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
CAD2008版本以上提供了表格打断分栏功能,但是操作起来很不方便,这个插件就是解放你的,可以设置分栏数量,分栏的间距,及是否分栏时候复制标题和表头栏。
CAD的表格功能其实很强的。
用本插件请下载安装XDRX_API 2016.1108以上版本API。
[sell](defun c:XDTB_TABLEDIV (/ h h1 h2 h3 jo keyword num numRows option ss x)
(defun _prompt ()
(xdrx_prompt "\n当前设置:分栏数(" #hatch_fenlan_num ") | 栏见距("
#hatch_fenlan_gap ") | 复制头(" #hatch_fenlan_copyhead ")"
)
)
(defun _keyword (keyword)
(cond
((= keyword "FL")
(initget 6)
(if (setq num (getint (xdrx_prompt "\n请输入分栏个数<"
#hatch_fenlan_num ">:" t
)
)
)
(setq #hatch_fenlan_num num)
)
)
((= keyword "GA")
(if (setq num (getreal (xdrx_prompt "\n请输入栏间距离<"
#hatch_fenlan_gap ">:" t
)
)
)
(setq #hatch_fenlan_gap num)
)
)
((= keyword "HE")
(setq num (xdrx_yesorno "\n是否复制表头" 1))
(if (= num 1)
(setq #hatch_fenlan_copyhead "是")
(setq #hatch_fenlan_copyhead "否")
)
)
)
(_prompt)
)
(XD::Doc:CheckVersion '>= "17.1" "")
(xdrx_begin)
(if (not #hatch_fenlan_num)
(setq #hatch_fenlan_num 2)
)
(if (not #hatch_fenlan_copyhead)
(setq #hatch_fenlan_copyhead "是")
)
(if (not #hatch_fenlan_gap)
(setq #hatch_fenlan_gap 10.0)
)
(_prompt)
(xdrx_initssget "\n选取要分栏的表格[分栏数(FL)/栏间距(GA)/复制表头(HE)]<退出>:"
"FL GA HE" "移除不分栏的填充[添加(A)]<退出>:" "_keyword"
""
)
(if (setq ss (xdrx_ssget '((0 . "ACAD_TABLE"))))
(progn
(if (= #hatch_fenlan_copyhead "是")
(setq option 3)
(setq option 1)
)
(mapcar
'(lambda (x)
(setq numRows (xdrx_table_numrows x)
h (xdrx_table_height x)
h2 (xdrx_table_rowheight x 0)
)
(if (= option 3)
(setq jo (rem (- numRows 2) #hatch_fenlan_num)
h3 (- h (* 2 h2))
)
(setq jo (rem numRows #hatch_fenlan_num)
h3 h
)
)
(setq h1 (/ h3 #hatch_fenlan_num))
(if (/= jo 0)
(setq h1 (+ h1 h2))
)
(setq h1 (+ h1 (if (= option 3)
(* 2 h2)
0.0
)
)
)
(xdrx_setpropertyvalue x "breakoption" option)
(xdrx_table_setbreakheight x 0 h1)
(xdrx_table_setbreakspacing x #hatch_fenlan_gap)
(if (= 1 #hatch_fenlan_num 1)
(xdrx_setpropertyvalue x "breakoption" 0)
)
)
(xdrx_pickset->ents ss)
)
)
)
(xdrx_end)
(princ)
)
[/sell] |