工作起来很有魅力。
谢谢你rlx。 欢迎你和我的thanx来到BigAl和Lee gr.Rlx 一个小建议是,不需要住在视图代码中。
(if (not LM:listbox)(load "listboxV1-2"))
(foreach view (LM:listbox "Select views to plot" view_list 1)
Rlx,
有没有办法修改这个例程,让用户可以选择保存文件的位置而不是源文件夹?
谢谢
布瑞恩
未经测试
;; created by Stefan BMR
(defun c:plotview ( / acobj acdoc views view_list listbox folder)
(vl-load-com)
(setq acobj (vlax-get-acad-object) acdoc (vla-get-activedocument acobj)views (vla-get-views acdoc))
(vlax-for view views (setq view_list (cons (vla-get-name view) view_list)))
(if (not (setq folder (getfolder "Select folder to save views")))
(setq folder (getvar 'dwgprefix))(setq folder (strcat folder "\\")))
(foreach view (LM:listbox "Select views to plot" view_list 1)
(command "_plot" "_y""Model" "DWG To PDF.pc3" "ARCH C (24.00 x 18.00 Inches)" "Inches" "Landscape" "No" "View" view
"Fit" "Center" "Yes" "ICP.ctb" "Yes" "A"
(strcat folder (vl-filename-base (getvar 'dwgname)) " - " view ".pdf")
"No" "Yes"))(princ))
;;Created by Lee Mac
;; bit - 1=allow multiple; 2=return indexes
;; Returns: List of selected items/indexes, else nil
(defun LM:listbox ( msg lst bit / dch des tmp rtn )
(cond
((not (and (setq tmp (vl-filename-mktemp nil nil ".dcl"))(setq des (open tmp "w"))
(write-line (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
(if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}" ) des)
(not (close des))(< 0 (setq dch (load_dialog tmp)))(new_dialog "listbox" dch)))
(prompt "\nError Loading List Box Dialog."))
(t (start_list "list") (foreach itm lst (add_list itm)) (end_list)(setq rtn (set_tile "list" "0"))
(action_tile "list" "(setq rtn $value)")
(setq rtn (if (= 1 (start_dialog)) (if (= 2 (logand 2 bit))(read (strcat "(" rtn ")"))
(mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")"))))))))
(if (< 0 dch)(unload_dialog dch))(if (and tmp (setq tmp (findfile tmp))) (vl-file-delete tmp))rtn )
(defun getfolder(msg / fl sh)
(if (and (setq sh (vlax-create-object "Shell.Application"))(setq fl (vlax-invoke sh 'browseforfolder 0 msg 0 "")))
(setq fl (vlax-get-property (vlax-get-property fl 'self) 'path))(setq fl nil))(release_me (list sh)) fl)
(defun release_me(lst)
(mapcar '(lambda (x)(if (and (= 'vla-object (type x))(not (vlax-object-released-p x)))(vlax-release-object x))(set (quote x) nil)) lst))
gr.Rlx RLX,
很好,谢谢!!!!!!
布瑞恩 我们的pdf被硬编码为低于dwg位置一级,因此每个人都知道在哪里查找这是检查目录,如果不存在,请制作它。
; check that pdf directory exists
(setq dwgpre (strcat (getvar "dwgprefix") "\pdf"))
(if (= (vl-file-directory-p dwgpre) nil)
(vl-mkdir dwgpre)
)
Rlx,
有没有一种方法可以将此lisp中的PDF合并到一个文档中,而无需像Publish那样使用第三方程序?
谢谢
布瑞恩
现在我想起来了,好问题,我自己可以用这个。尚未签出,但将在周一尝试:
http://www.cadtutor.net/forum/showthread.php?97827-打印为PDF并合并为一个文件
http://www.cadtutor.net/forum/showthread.php?96713-PDF合并软件
虽然Roy_043谈到了ghostscript,但我不确定我是否可以使用它,因为在我的工作中,它有一个可以阻止大多数选项的竞争对手。
gr.Rlx 下面是通过adobe acrobat合并pdf文件的子文件夹。
页:
1
[2]