从模式打印所选视图
你好我有一个LISP,在我切换到Acad2017之前一直工作得很好。
我为Acad2017安装了新的Dos\u lib,但仍然收到相同的错误:“错误:没有函数定义:Dos\u Multilist。
有没有一种方法可以在不使用Dos_lib或修复此代码以使用Acad2017的情况下实现相同的结果?
这是代码(由Stefan BMR创建):
(defun c:plotview ( / acobj acdoc views view_list)
(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))
)
(foreach view (dos_multilist "PLOT SELECTED VIEWS" "Select views to plot" view_list)
(command
"_plot"
"_y"
"Model"
"DWG To PDF.pc3"
"ANSI A (11.00 x 8.50 Inches)"
"Inches"
"Landscape"
"No"
"View"
view
"Fit"
"Center"
"Yes"
"ICP.ctb"
"Yes"
"A"
(strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf")
"No"
"Yes"
)
)
(princ)
)
非常感谢。 Dos_Mulitlist仍适用于Acad2017。
您需要检查两件事。doslib是否已加载?您使用的是正确的arx吗?
2017年,在64位机器上,它应该是DOSLib21x64。arx公司
我目前正在Acad 2017上使用DosLib21x64,它工作正常。
当做
Hippe013 加载了Dos_lib,我使用DOSLib21x64。64位机器上的arx。
也许这是Lisp程序的问题?
任何如何使这项工作的想法都将受到赞赏。
非常感谢。 删除错误想法 你有一个lisp(你可以分享)可以做同样的事情吗
-在模型空间中显示视图
-用于选择要打印的视图 我确实写了一个plot lisp,它也可以打印视图,但它相对比较旧,我不确定所有选项是否都有效。从来没有完全完成过,现在可能可以更好地编写代码的某些部分,只是一天没有足够的时间。。。
不管怎样,也许它是有用的,至少是我希望的景观部分。对话框启动后(希望如此),转到“高级选项”并在“打印范围”部分中选择“查看”。
gr.Rlx
RLPlot。dcl
RLPlot。LSP
Nice one RLX需要额外的“打印所有选项卡”“打印范围”
塔兹http://www.lee-mac.com/listbox.html这应该取代DOSLIB函数。
Thanx Bigal。。。我真的应该(有一天)完成它,但从好的方面来看,我现在工作的公司已经决定没有更多的空间给工程部门,所以今年年底我可能会有我需要的所有时间:-)
gr.R。 比加尔,rlx谢谢你的帖子。
由于我仍在学习LISP,此时我发现很难调用Lee的函数(并替换dos\u multilist)。
这些都是程序和我做的小改动:
;; created by Stefan BMR
(defun c:plotview ( / acobj acdoc views view_list LISTBOX)
(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))
)
(foreach view (LISTBOX "PLOT SELECTED VIEWS" "Select views to plot" view_list)
(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 (getvar 'dwgprefix) (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
)
希望有人能帮我完成这项任务
非常感谢。 试试这个:
;; created by Stefan BMR
(defun c:plotview ( / acobj acdoc views view_list LISTBOX)
(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))
)
(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 (getvar 'dwgprefix) (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
)
gr.Rlx
页:
[1]
2