自动生成程序
本帖最后由 s678z 于 2015-11-29 10:52 编辑程序待修改
;03/12/31改
(alert "这个程序用于路桥,图形是1:1,图框放大;\n03/12/31")
(setvar "cmdecho" 0)
(setq no 1)
(if (SETQ TEMFILE (OPEN "D:/INFIEL" "r"))
(progn (SETQ INF (READ-LINE TEMFILE))
(CLOSE TEMFILE)
)
(setq inf "d:/")
)
(setq infile (getfiled "input file name" INF "*" 0))
(command "sh" "del d:/infile")
(SETQ TEMFILE (OPEN "D:/INFIEL" "w"))
(princ infile temfile)
(CLOSE TEMFILE) ;(setq f1 (open infile "r"))
(setq path1 (vl-filename-directory infile))
(setq path2 (strcat path1 "\\"))
(setq namelist (vl-directory-files path1 "*.dwg" 1))
(setq xls_name (vl-directory-files path1 "*.xls" 1))
(setq doc_name (vl-directory-files path1 "*.doc" 1))
;(print f1)
(if (SETQ TEMdate (OPEN "D:/date" "r"))
(progn (SETQ INF (READ-LINE TEMdate))
(CLOSE TEMdate)
)
(setq inf "d:/")
)
(setq oufile (getfiled "input file name" inf "*" 1))
(command "sh" "del d:/date")
(SETQ TEMdate (OPEN "D:/date" "w"))
(princ oufile TEMdate)
(CLOSE TEMdate)
;;
(setq ou_list (strcat oufile "li"))
(setq f_list (open ou_list "w"))
(setq li_no 0)
(while (nth li_no namelist)
(princ (+ li_no 1) f_list)
(prin1 (nth li_no namelist) f_list)
(princ "\n" f_list)
(setq li_no (1+ li_no))
)
(close f_list)
;;
;; ;(princ "序号 图形文件名 图号 零部件名 材料 图纸尺寸 " f)
;(princ "11gfdfg jkfds" f)
(setq pathlen1 (strlen infile))
(setq pathlen pathlen1)
;;;;;;;;;;;;;;
(while (/= "\\"
(substr infile pathlen 1)
)
(setq pathlen (- pathlen 1))
)
;;
;(setq len (- pathlen1 pathlen))
(setq path (substr infile 1 pathlen))
(setq file_len (length namelist))
(setq file_num 0)
;;;begin per dwg file;
(while (setq name1 (nth file_num namelist))
(setq name (strcat path2 name1))
(setq file_num (1+ file_num))
(print name)
(setq f (open oufile "a"))
(if (findfile name)
(progn
(princ "1111111111111111111111111111111111")
(command "erase" "all" "")
(command "purge" "all" "*" "n")
(command "purge" "all" "*" "n")
(command "zoom" "e")
(command "insert"
(strcat (itoa (+ 500 no)) "=" name)
'(0 0)
1
1
0
)
(command "explode" "all")
(command "purge" "all" "*" "n")
(command "layer" "on" "*" "t" "*" "u" "*" "")
;(princ no f)
(princ "2222222222222222222222222222222222")
;(princ " " f)
(princ "no")
;(princ no)
;(princ name1 f)
;(a1 name1 f)
(princ "")
(princ name1)
(fram name1 f)
(princ "nnnnnnnnn")
(princ name1)
(setq xls_len (strlen name1))
(setq xls_dg (substr name1 1 (- xls_len 4)))
(setq xlsname (strcat xls_dg ".xls"))
(setq docname (strcat xls_dg ".doc"))
(cond ((member xlsname xls_name) (princ " 有明细表" f)(princ "\n" f))
((member docname doc_name) (princ " 有明细表" f)(princ "\n" f))
(t (princ "\n" f))
)
)
)
(close f)
)
;(close f1)
(alert "finish")
)
;;;;;
(defun nn ()
(setq no (1+ no))
(princ "in to")
(setq size_x (- (nth 0 (getvar "extmax"))
(nth 0 (getvar "extmin"))
)
)
(setq size_y (- (nth 1 (getvar "extmax"))
(nth 1 (getvar "extmin"))
)
)
(princ size_x)
(princ "\n")
(princ size_y)
(princ "\n")
;;;;;
(COND ((ssget "x" '((0 . "INSERT") (2 . "GB-A1")))
(
)
)
路桥公司图框.rar无法下载了!!!! 感谢分享。 收藏学习。 感谢分享。 收藏学习。 顶一下,随便坐沙发 感谢分享。 收藏学习。 不是很明,请楼主做个动画地看下。 这个程序的思路,用dbx速度要快些。 LLXXZZ 发表于 2012-5-30 12:39 static/image/common/back.gif
这个程序的思路,用dbx速度要快些。
大哥,你的那个批量改页码很好用,但我的图框都是横排的,图框有大有小,改页码时都是先改小的图框再改大的图框,我想它改页码时都是从左到右,按顺序改写,而不是先改小的再改大的图框页码,也不用一个个去点选,我想这样会快好多。请大师帮我改下。。。。http://bbs.mjtd.com/thread-89140-1-1.html LLXXZZ 发表于 2012-5-30 12:39 static/image/common/back.gif
这个程序的思路,用dbx速度要快些。
什么是DBX? 看样子,大家都喜欢回水贴,都不解决问题,只有顶到老大出手才行
我的建议,cad本身就有属性萃取器,本身就是通用的,不用改这个了!! 感谢分享。 收藏学习。
页:
[1]
2