hosannabizarre 发表于 2022-7-6 09:39:31

不带en的打印当前布局

我想在具有多个布局的图形中绘制一个特定布局。
 
我想使用lisp设置一系列命令来打印当前/打开的布局。
 
下面是我正在使用的当前字符串:
 

(defun c:plot40_B1 nil
(vl-load-com)
(command "_.-plot" "yes" "" "\\\\Kwifs1\\KWIN_40" "B1" "Millimeters" "LANDSCAPE" "NO" "Extents" "FIT" "CENTER" "YES" "KWIN39_BW.ctb" "YES" "W" "NO" "NO" "yes" )
(princ)
)

 
 
这不起作用-以下是AutoCAD处理命令时的F2回音:
 
plot40_KWIN39_BW _.-plot Detailed plot configuration? <No>:
yes
Enter a layout name or [?] <K-17831>: Enter an output device name or [?]
\\KWIFS1\KWIN_40>: \\Kwifs1\KWIN_40 Enter paper size or [?] <A3>: A3 Enter
paper units <Millimeters>: Millimeters Enter drawing
orientation <Landscape>: LANDSCAPE Plot upside down?
<No>: NO Enter plot area
<Extents>: Extents Enter plot scale (Plotted Millimeters=Drawing Units) or
<Fit>: FIT Enter plot offset (x,y) or <Center>: CENTER Plot with
plot styles? <Yes>: YES Enter plot style table name or [?] (enter .
for none) <KWIN39_BW.ctb>: KWIN39_BW.ctb Plot with lineweights? <Yes>:
YES Scale lineweights with plot scale? <Yes>: W
 
 
问题是:输入布局名称或[?]:
 
目前,lisp中与这个问题相反的部分是“”。
 
我尝试了“当前”和“布局”,因为我只想打印我打开的布局,而不输入特定的布局名称,因为这显然是我想要反复使用的打印例程。
 
不确定“输入布局名称或[?]”的>部分是什么:是
 
我不确定“打印当前布局”的有效答案是什么。
 
我试图关闭对话框,以便在命令提示符下找到我的选项,但无法解决这个问题。旧的CmdDia=0不起作用。
 
非常感谢您的建议!!!

Lt Dan's l 发表于 2022-7-6 09:55:39

您所在的任何空间都将被自动选择,因此您可以只使用“”。
 
如果您在模型空间中,则应显示“输入布局名称或[?]:”
 
如果你输入?它将生成可用选项的列表。
 
无需(vl load com)
只有在使用Visual LISP时才需要此选项
 
如果您试图打印而不是打印到文件,则会错过一个问题

(defun c:plot40_B1 nil
(setvar "cmdecho" 0)
(command "_.-plot" "yes" "" "\\\\Kwifs1\\KWIN_40" "B1" "Millimeters" "LANDSCAPE" "NO" "Extents" "FIT" "CENTER" "YES" "KWIN39_BW.ctb" "YES" "W" "NO" "NO" "NO" "yes" )
(setvar "cmdecho" 1)
(princ)
)

ahmed_proff 发表于 2022-7-6 10:20:09

 
;lisp for plot
;you can change your device and paper size
;Created by Ahmed Abdel Ghany "Ahmed_proff@yahoo.com"
;With my best regards
(defun
ERR (X)
(if (= "Function Cancelled" X)
(setq X "Ctrl+C or Esc key pressed.")
) ;_ end of if
(setq *ERROR* OLDERR)
(princ (strcat "\nError: " X))
(princ)
) ;_ end of defun
;;ERR
;;;********** Main Program **********
(defun c:B1 ()
(setq oecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setvar "filedia" 0)
(vl-load-com)
(command "zoom" "e")
(initget "YES NO")
(setq pl (getkword "\nDo you want to plot? (Y)es/(N)o <Y>:"))
(if (= nil pl)(setq pl "Y"))
(cond
((= pl "Y")
;;;;Paper space;
(if (/= (getvar "tilemode") 1)
(progn
(command
"-PLOT"
"y" ;Detailed plot configuration? <No>:;
"" ;Enter a layout name or [?] <Layout1>:
"\\\\Kwifs1\\KWIN_40" ;Enter an output device name or [?] <None>:
"B1" ;Enter paper size or [?] <A3>:
"m" ;Enter paper units <Inches>: m
"l" ;Enter drawing orientation <Landscape>:
"no" ;Plot upside down? <No>:
"e" ;Enter plot area <Layout>: e
"f" ;Enter plot scale (Plotted Millimeters=Drawing Units) or <1:1>: f
"0,0" ;Enter plot offset (x,y) or <0.00,0.00>:
"yes" ;Plot with plot styles? <Yes>:
"KWIN39_BW.ctb" ;Enter plot style table name or [?] (enter . for none) <>:
"yes" ;Plot with lineweights? <Yes>:
"" ;Scale lineweights with plot scale? <No>:
"" ;Plot paper space first? <No>:
"" ;Hide paperspace objects? <No>:
"" ;Write the plot to a file <N>:
"" ;Save changes to page setup ? <N>
"y" ;Proceed with plot <Y>:
);command
(prompt "\nSuccessfully Plot.....")
(princ)
);progn
;model space
(progn
(command
"-plot"
"y" ;Detailed plot configuration? <No>:;
"" ;Enter a layout name or [?] <Model>:
"\\\\Kwifs1\\KWIN_40" ;Enter an output device name or [?] <None>:
"B1" ;Enter paper size or [?] <A3>:
"m" ;Enter paper units <Inches>: m
"l" ;Enter drawing orientation <Landscape>:
"no" ;Plot upside down? <No>:
"e" ;Enter plot area <Layout>: e
"f" ;Enter plot scale (Plotted Millimeters=Drawing Units) or <1:1>: f
"0,0" ;Enter plot offset (x,y) or <0.00,0.00>:
"yes" ;Plot with plot styles? <Yes>:
"KWIN39_BW.ctb" ;Enter plot style table name or [?] (enter . for none) <>:
"" ;Plot with lineweights? <Yes>:
"" ;Enter shade plot setting <As displayed>:
"" ;Write the plot to a file <N>:
"" ;Save changes to page setup ? <N>
"y" ;Proceed with plot <Y>:
);command
(prompt "\nSuccessfully Plot.....")
(princ)
);progn
);if
);Yes
((= pl "N")(prompt "\nYou canceled plotting"));No
);cond
(terpri)
(setvar "filedia" 1)
(setvar "cmdecho" oecho)
);DEFUN
;;;;***********End of program*************

BIGAL 发表于 2022-7-6 10:35:28

如果您想绘制另一个选项卡v,即您在check setvar“Ctab”中的选项卡,这将为您跳转选项卡。
 
例如,在布局3(setq newtab“layout1”)(setq oldtab(getvar“ctab”)(setvar“ctab”newtab)绘图中,然后(setvar“ctab”oldtab)跳回布局3

Ohnoto 发表于 2022-7-6 10:52:41

最终,问题似乎出现在代码中,您将值“W”放在它想要“是/否”的地方。
 
这里有一个选项,您可以使用DCL代码生成页面选项卡列表,并从中选择所需内容。以下是我使用的is:
 
然后对于函数:
 
然后复制功能代码并修改打印样式表和其他打印机或打印样式的输出设备。
页: [1]
查看完整版本: 不带en的打印当前布局