如何把CAD中图片形式的表格转换为EXCL格式?
全部评论
好像没有这种功能吧。
(defun c:c2e ( / hangdau)(defun sosanh (e1 e2 / p1 p2)(setq p1 (car e1)p2 (car e2))
(if (equal (cadr p1) (cadr p2) fuzz)(< (car p1) (car p2))(< (cadr p2) (cadr p1))))
(setq ss (ssget '((0 . "TEXT"))) lst (ss2ent ss) lst (mapcar '(lambda (e) (cons (cdr (assoc 10 (entget e))) (cdr (assoc 1 (entget e))))) lst)
lst (mapcar '(lambda (e) (if (= (cdr e) "*") (cons (car e) "") e)) lst) caotext (cdr (assoc 40 (entget (ssname ss 0))))
fuzz (* caotext 1.0) lst (vl-sort lst 'sosanh) index 1 oldy nil
fid (open "d:\\xls数据文件.csv" "w"))
(command "start" "d:\\xls数据文件.csv")
(foreach e lst(if (equal oldy (cadr (car e)) fuzz)(progn(princ "," fid)(setq index (1+ index)))
(progn(if hangdau(progn(setq index 1)(princ "\n" fid))(setq hangdau t))))
(princ (cdr e) fid)(setq oldy (cadr (car e))))(close fid))
(defun ss2ent (ss / sodt index lstent)(setq sodt (if ss(sslength ss)0)index 0)
(repeat sodt(setq ent (ssname ss index)index (1+ index)lstent (cons ent lstent)))(reverse lstent))
以上内容用记事本保存为lsp文件,cad内appload加载,然后输入c2e命令执行插件,框选图面内表格,即可导出为csv文件。
或者参照这个帖子
http://o.southgis.com/education/resource/detail/1322
距离打开宝箱还剩7天
全部评论