hosyn 发表于 2022-7-5 18:52:06

非常奇怪的错误!!!!

该代码运行正常:

(command "-plot" "Y" "" "DWG TO PDF.PC3" "Iso full bleed A3 (420.00 x 297.00 MM)" "" "L" "" "Window" pt1 pt2 "F" "C" "" "" "" "" "" "" "" )

但当我刚更换打印机时,显示以下错误:

(command "-plot" "Y" "" "HP Deskjet 1280 series.PC3" "Iso full bleed A3 (420.00 x 297.00 MM)" "" "L" "" "Window" pt1 pt2 "F" "C" "" "" "" "" "" "" "" )

错误::

Command: Plot1
Select Lower Left Hand Corner
               of Plotting Area:
Thanks.......Unknown command "Plot1".Press F1 for help.
Unknown command "L".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "WINDOW".Press F1 for help.
Unknown command "F".Press F1 for help.
Unknown command "C".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "PP".Press F1 for help.
Unknown command "PP".Press F1 for help.

David Bethel 发表于 2022-7-5 18:59:41

尝试将CMDECHO设置为1,将CMDDIA设置为1,以便调试这些。
 
通过(命令)打印时,必须具有特定设备所需的精确序列。它们并不都一样。
 
有时使用完整的参数值也可以帮助代替简单的“”。

Commandobill 发表于 2022-7-5 19:04:44

当使用plot命令时,尝试手动遍历以查找问题,或者如David所说,确保打开了命令echo,以便可以看到错误发生的位置。

Commandobill 发表于 2022-7-5 19:07:20

你也可以查看这个线程。

hosyn 发表于 2022-7-5 19:15:11

这是完整代码:

(defun c:XSX ( )
(setvar 'CMDECHO 1)
(setvar 'CMDDIA 1)
    (setq pt1 (getpoint "\nSelect Lower Left Hand Corner
               of Plotting Area: "))
        (setq pt2 (list (+ 40 (car pt1)) (+ 27.8 (cadr pt1)) 0.))
   (prompt "\nThanks.......")
   (command "-plot" "Y" "" "HP Deskjet 1280 series.PC3" "Iso full bleed A3 (420.00 x 297.00 MM)" "" "L" "" "Window" pt1 pt2 "F" "C" "" "" "" "" "" "" "" )
    ;(command "-plot" "Y" "" "DWG TO PDF.PC3" "Iso full bleed A3 (420.00 x 297.00 MM)" "" "L" "" "Window" pt1 pt2 "F" "C" "" "" "" "" "" "" "" )
   (princ)
)

这是compltet erorr:

Command: XSX
Select Lower Left Hand Corner
               of Plotting Area:
Thanks.......-plot Detailed plot configuration? <No>: Y
Enter a layout name or [?] <Model>: Enter an output device name or [?] <EPSON Stylus Photo 1410 Series>: HP Deskjet 1280 series.PC3 Enter paper size or [?] <Letter>: Iso full bleed A3 (420.00 x 297.00 MM)
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: L Unknown command "L".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: Window Unknown command "WINDOW".Press F1 for help.
Command:
Command:
Command: F Unknown command "F".Press F1 for help.
Command: C Unknown command "C".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command: XSX
Unknown command "XSX".Press F1 for help.
Command:


:o:o:o:o:o:o:o:o:o:o:o:o:o:o

rlx 发表于 2022-7-5 19:18:30

“手动”尝试时,请确保打印机的字符串和纸张大小完全相同。使用-plot逐步完成此过程,可能会复制并粘贴这些字符串。有时,一台打印机的尺寸为“A3”,而另一台打印机的尺寸为“A3”(420 x 297毫米),那么您的代码就会失败
 
Gr.Rlx

hosyn 发表于 2022-7-5 19:24:39

谢谢你的帮助David Bethel&Commandobill&rlx
有了你的帮助,一切都好了:):):)
 
在上面的代码中,有没有一种在绘图之前观看预览的方法?????

rlx 发表于 2022-7-5 19:27:37

是的,有:http://knowledge.autodesk.com/support/autocad-utility-design/troubleshooting/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-ActiveX/files/GUID-6126F7B4-B02D-4EDA-B297-BCCAF6D92ADF-htm.html
 
gr.Rlx

hosyn 发表于 2022-7-5 19:32:56

如果我想画矩形并绘图,我添加了矩形代码:

(setq pt1 (getpoint "\nSelect Lower Left Hand Corner of Plotting Area: "))
(setq pt2 (list (-(car pt1) 27. (+ 40 (cadr pt1)) 0.))
(command "._rectang" pt1 pt2 pause)
(command "-plot" "Y" "" "DWG TO PDF.PC3" "Iso full bleed A3 (420.00 x 297.00 MM)" "" "P" "" "Window" pt1 pt2 "F" "C" "" "" "" "" "" "" "" )

只是绘图,没有画矩形???为什么?

rlx 发表于 2022-7-5 19:42:06

为什么在矩形中暂停?认为你是一个男人(回车)
 
Gr.Rlx
页: [1] 2
查看完整版本: 非常奇怪的错误!!!!