pojxcc 发表于 2014-6-9 23:46:14

批量插入光栅图像(仅供参考,有待改进)

;;配合使用doslib取得文件名
;;使用foreach循环插图
(defun c:insdwgs()
(princ "\n 归档文件合并\n")
(setvar "cmdecho" 0)
(setq dwgpath (dos_getdir "选择要操作的文件夹:"
(if dwgpath dwgpath "F:\\work归档") "归档文件后处理"))
(if dwgpath
(progn
(setq fff (dos_dir (strcat dwgpath "*.dwg") 1))
(setq ini (open "c:\\QGY_temp\\目录列表.ini" "w"))
(foreach x fff (write-line (strcat dwgpath x) ini) )
(setq ini (open "c:\\QGY_temp\\目录列表.ini" "r"))
(insdwgs_main)
)
)
(princ)
)
(defun insdwgs_main ()
(while
(setq dwg (read-line ini))
(setq dwg_list(cons dwg dwg_list))
)
(setq dwg_list(reverse dwg_list))
(close ini)
(setvar "sdi" 1)
(setvar "lispinit" 0)
(foreach x dwg_list

(command "open" x)
(lll_chatu)

)
   (setvar "sdi" 0)
(setvar "lispinit" 1)
(command "qsave")
(command "close")
)
(defun lll_chatu()
(setq a x)
(setq x1 (substr a 9 4))
(setq x2 (atof x1))
(setq xx (* 1000 x2))
(setq y1 (substr a 14 3))
(setq y2 (atof y1))
(setq yy (* 1000 y2))
(setq pt (list yy xx))
(setq yx (substr a 1 16))
(setq yxlj (strcat yx ".tif"))
(command "image" "a" yxlj pt 500 "0")
(command "zoom" "e")
)
(princ "\n批量插入影像程序已装载, 键入 insdwgs 自动批量插入;edit by pojxcc。")
(princ)

spp_wall 发表于 2014-6-10 08:11:49

本帖最后由 spp_wall 于 2014-6-10 09:30 编辑

试试看!!!!!!!!!
; 错误: *error* 函数中出错no function definition: ACET-UI-PROGRESS

pojxcc 发表于 2014-6-12 14:55:13

先要加载doslib1.6,网上可以下

pojxcc 发表于 2014-6-12 14:55:57

spp_wall 发表于 2014-6-10 08:11 static/image/common/back.gif
试试看!!!!!!!!!
; 错误: *error* 函数中出错no function definition: ACET-UI-PROGRESS

先加载doslib1.6
页: [1]
查看完整版本: 批量插入光栅图像(仅供参考,有待改进)