乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 81|回复: 5

[编程交流] Error: Commands may not be nes

[复制链接]

33

主题

77

帖子

44

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
165
发表于 2022-7-5 22:57:31 | 显示全部楼层 |阅读模式
Hello,
We just installed our first seat of AutoCAD15 and are in the process of testing everything and our plot routine gets this error:
 
 
"Error: Commands may not be nested more than 4 deep"
 
 
Has anyone ever heard of this?
 
 
Thanks
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:17:24 | 显示全部楼层
Just shut in the dark : If you have a command call within your routine , try to replace it  with vl-cmdf and let me know .
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-5 23:23:14 | 显示全部楼层
I would guess that there are some command calls that occurs not on command prompt, but rather on the prompt of a previous, un-finished command. This may come from a command that had its prompt dialog modificatioed in release 2015 (less queries).
May track that down by listing the CMDACTIVE system variable in your code.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:44:54 | 显示全部楼层
I have seen a post sometime a go ( can't remember where that was ) by replacing a command with command-s would work in CAD 2015 , but also still a guess as long as the OP did not post any codes .
回复

使用道具 举报

33

主题

77

帖子

44

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
165
发表于 2022-7-5 23:47:09 | 显示全部楼层
Sorry for the delay guys, thanks for your input, it worked for the plotroutine, but not the plotfolder subroutine within.  Here's the code, it's lengthy so It's a zip.  Thank you.
PlotRoutine.lsp
PlotRoutine.dcl
回复

使用道具 举报

33

主题

77

帖子

44

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
165
发表于 2022-7-6 00:00:47 | 显示全部楼层
Can someone help me with this please?  This problem has arisen with our upgrade to 2015.  I've searched many forums and they all say to seek help on defining external commands.  This code was inherited from Terry Miller, and I'm not sure how external commands apply to it...  Thanks
 
  1. (defun PlotRoutine ( );  (fixlayers) (vl-load-com) (if (= (strcase (getvar "CLAYER")) "0-VIEW-1")   (LayerOn "0") );if (savevars (list "CTAB" "CLAYER" "OSMODE")) (setvar "OSMODE" 0) (if P-R   (UserInfo)   (progn     (UserInfo)     (if (not (or (= (nth 1 *UserInfo@) "All Layouts")(= (nth 1 *UserInfo@) "Model")(= (nth 1 *UserInfo@) "E-Sheets")))       (setq *UserInfo@ (Change_nth 1 "All Layouts" *UserInfo@))     );if   );progn );if (setq Layouts$ (nth 1 *UserInfo@)       Copies#  (atoi (nth 2 *UserInfo@))       P-Size$  (nth 3 *UserInfo@)       PlotStyle$ (nth 4 *UserInfo@) );setq (if (and P-R (= Layouts$ "Model")(= P-Size$ "Varies"))   (progn     (setq Ctab (getvar "CTAB"))     (vl-cmdf "LAYOUT" "S" "Model")     (setq P-Size$ (GetBorderSize))   );progn );if (if (= (getvar "CTAB") "Model")   (vl-cmdf "LAYOUT" "S" (nth 0 (LayoutList))) );if (setq PlotStyle$   (cond     ( (= PlotStyle$ "PDF") "Adobe PDF")     ( (= PlotStyle$ "Draft") "GEN2000i.ctb")     ( (= PlotStyle$ "Final") "FWT2000i.ctb")   );cond );setq (setq PaperSize$   (if (= PlotStyle$ "Adobe PDF")     (cond       ( (= P-Size$ "A-Size") "Letter")       ( (= P-Size$ "B-Size") "11 x 17")       ( (= P-Size$ "C-Size") "ARCH C")       ( (= P-Size$ "D-Size") "ARCH D")       ( (= P-Size$ "E-Size") "ARCH E")       ( (= P-Size$ "BOM")    "11 x 17")     );cond     (cond       ( (= P-Size$ "A-Size") "Letter (8.5" x 11")")       ( (= P-Size$ "B-Size") "11" x 17"")       ( (= P-Size$ "C-Size") "18" x 24"")       ( (= P-Size$ "D-Size") "24" x 36"")       ( (= P-Size$ "E-Size") "36" x 48"")       ( (= P-Size$ "BOM")    "11" x 17"")     );cond   );if );setq (setq Printer$ "RICOH_Aficio_SP_8200DN_PCL6 - DFTL");default printer (foreach Item *UserNames@   (if (= (getvar "LOGINNAME") (nth 1 Item))     (setq Printer$ (nth 4 Item))   );if );foreach (cond   ( (or (= P-Size$ "A-Size")(= P-Size$ "B-Size")(= P-Size$ "BOM"))     (setq LayoutOrder@ (LayoutList))     (if (= (getvar "Loginname") "Bmills")       (if (= P-Size$ "A-Size")           (setq Plotter$ "HP LaserJet 6MP")           (setq Plotter$ "\\\\KENPRINT01\\HP_5Si_MX_Engineering")       );if       (setq Plotter$ Printer$)     );if   );case   ( (or (= P-Size$ "C-Size")(= P-Size$ "D-Size")(= P-Size$ "E-Size"))     ;BKW 2010-02-24  New plotter does not need list reversed     ;(setq LayoutOrder@ (reverse (LayoutList)))     (setq LayoutOrder@ (LayoutList))     (setq Plotter$ "RICOH_Aficio_W5100")   );case );cond;(Test "Plotter$" Plotter$) ;Print to autocad windows for debug (setq Offset$   (cond     ( (= P-Size$ "C-Size") "0.09375,0.0625")     ( (= P-Size$ "D-Size") "0.1875,-0.03125");was 0.1875,0     ( (= P-Size$ "E-Size") "0,0")     (t "0,0")   );cond );setq ;----------------------------------------------------------------------------- ; Plot Layouts ;----------------------------------------------------------------------------- (if (not (tblsearch "layer" "Defpoints"))   (LayerOn "Defpoints") );if (if (tblsearch "layer" "O-VIEW-1")   (LayerOn "O-VIEW-1") );if (cond   ( (= P-Size$ "Varies")     (PlotVaries)   );case   ( (= P-Size$ "Up to B")     (PlotUptoB)   );case   ( (and (= P-Size$ "BOM")(= Layouts$ "All Layouts"))     (repeat Copies#       (foreach Layout$ LayoutOrder@         (if (/= (strcase (substr Layout$ 1 1)) "F")           (progn             (vl-cmdf "LAYOUT" "S" Layout$)             (if (= (GetBorderSize) "C-Size") (setq LL-Pt "12.3583,0.3749"          UR-Pt "23.3761,17.6258")               (setq LL-Pt "20.241,0.0"          UR-Pt "35.25,23.5"));if(if (> (sslength (ssget "x" (list (cons 410 Layout$)))) 1)               (progn                 (c:UPDTB)(Defpoints)                 (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))                 (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))                 (if (= PlotStyle$ "Adobe PDF")                   (progn                     (vl-cmdf "-PLOT" "Y" Layout$ PlotStyle$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "N" "N" "Y")                     (MovePdf)                   );progn                   (vl-cmdf "-PLOT" "Y" Layout$ Plotter$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "N" "Y")     ;(vl-cmdf "-PLOT" "Y" Plotter$ Layout$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "N" "Y")                 );if                 (if P-R                   (vl-cmdf "ZOOM" "W" Pt1 Pt2)                 );if               );progn             );if           );foreach         );progn       );if     );repeat   );case   ( (and (= P-Size$ "BOM")(= Layouts$ "E-Sheets"))     (repeat Copies#       (foreach Layout$ LayoutOrder@         (if (= (strcase (substr Layout$ 1 1)) "E")           (progn             (vl-cmdf "LAYOUT" "S" Layout$)             (if (= (GetBorderSize) "C-Size") (setq LL-Pt "12.3583,0.3749"          UR-Pt "23.3761,17.6258")               (setq LL-Pt "20.241,0.0"          UR-Pt "35.25,23.5"));if             (if (> (sslength (ssget "x" (list (cons 410 Layout$)))) 1)               (progn                 (c:UPDTB)(Defpoints)                 (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))                 (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))                 (if (= PlotStyle$ "Adobe PDF")                   (progn                     (vl-cmdf "-PLOT" "Y" Layout$ PlotStyle$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "N" "N" "Y")                     (MovePdf)                   );progn                   (vl-cmdf "-PLOT" "Y" Layout$ Plotter$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "N" "Y")                 );if                 (if P-R                   (vl-cmdf "ZOOM" "W" Pt1 Pt2)                 );if               );progn             );if           );foreach         );progn       );if     );repeat   );case   ( (= P-Size$ "BOM")     (vl-cmdf "LAYOUT" "S" Layouts$)     (repeat Copies#             (if (= (GetBorderSize) "C-Size") (setq LL-Pt "12.3583,0.3749"          UR-Pt "23.3761,17.6258")               (setq LL-Pt "20.241,0.0"          UR-Pt "35.25,23.5"));if       (if (> (sslength (ssget "x" (list (cons 410 Layouts$)))) 1)         (progn           (c:UPDTB)(Defpoints)           (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))           (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))           (if (= PlotStyle$ "Adobe PDF")             (progn               (vl-cmdf "-PLOT" "Y" Layouts$ PlotStyle$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "N" "N" "Y")               (MovePdf)             );progn             (vl-cmdf "-PLOT" "Y" Layouts$ Plotter$ PaperSize$ "I" "P" "N" "W" LL-Pt UR-Pt "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "N" "Y")           );if           (if P-R             (vl-cmdf "ZOOM" "W" Pt1 Pt2)           );if         );progn       );if     );repeat   );case   ( (= Layouts$ "All Layouts")     (repeat Copies#       (foreach Layout$ LayoutOrder@         (vl-cmdf "LAYOUT" "SET" Layout$)         (setq Orientation$ (GetOrientation))         (setq DotList@ (cons 410 Layout$))         (if (> (sslength (ssget "x" (list (cons 410 Layout$)))) 1)           (progn             (c:UPDTB)(Defpoints)             (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))             (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))             (if (= PlotStyle$ "Adobe PDF")               (progn                 (vl-cmdf "-PLOT" "Y" Layout$ PlotStyle$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "N" "Y" "Y")                 (MovePdf)               );progn               (vl-cmdf "-PLOT" "Y" Layout$ Plotter$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "Y" "Y")             );if             (if P-R               (vl-cmdf "ZOOM" "W" Pt1 Pt2)             );if           );progn         );if       );foreach     );repeat   );case  (= Layouts$ "All Layouts")   ( (= Layouts$ "E-Sheets")     (repeat Copies#       (foreach Layout$ LayoutOrder@         (vl-cmdf "LAYOUT" "SET" Layout$)         (if (or (= (substr (getvar "CTAB") 1 1) "E") (= (substr (getvar "CTAB") 5 1) "E"))           (progn             (setq Orientation$ (GetOrientation))             (setq DotList@ (cons 410 Layout$))             (if (> (sslength (ssget "x" (list (cons 410 Layout$)))) 1)               (progn                 (c:UPDTB)(Defpoints)                 (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))                 (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))                 (if (= PlotStyle$ "Adobe PDF")                   (progn                     (vl-cmdf "-PLOT" "Y" Layout$ PlotStyle$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "N" "Y" "Y")                     (MovePdf)                   );progn                   (vl-cmdf "-PLOT" "Y" Layout$ Plotter$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "Y" "Y")                 );if                 (if P-R                   (vl-cmdf "ZOOM" "W" Pt1 Pt2)                 );if               );progn             );if           );progn         );if       );foreach     );repeat   );case  (= Layouts$ "E-Sheets")   ( (= Layouts$ "Model")     (vl-cmdf "LAYOUT" "SET" "Model")     (setq Orientation$ (GetOrientation))     (c:UPDTB)(Defpoints)     (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))     (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))     (repeat Copies#       (if (= PlotStyle$ "Adobe PDF")         (progn           (vl-cmdf "-PLOT" "Y" Layouts$ PlotStyle$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "Y")           (MovePdf)         );progn         (vl-cmdf "-PLOT" "Y" Layouts$ Plotter$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "Y")       );if     );repeat     (if P-R       (vl-cmdf "ZOOM" "W" Pt1 Pt2)     );if   );case   (t     (vl-cmdf "LAYOUT" "SET" Layouts$)     (setq Orientation$ (GetOrientation))     (if (> (sslength (ssget "x" (list (cons 410 Layouts$)))) 1)       (repeat Copies#         (c:UPDTB)(Defpoints)         (setq Pt1 (polar (getvar "VIEWCTR") (* pi 0.5)(/ (getvar "VIEWSIZE") 2.0)))         (setq Pt2 (polar Pt1 (* pi 1.5) (getvar "VIEWSIZE")))         (if (= PlotStyle$ "Adobe PDF")           (progn             (vl-cmdf "-PLOT" "Y" Layouts$ PlotStyle$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" "GEN2000i.ctb" "Y" "N" "N" "N" "N" "Y" "Y")             (MovePdf)           );progn           (vl-cmdf "-PLOT" "Y" Layouts$ Plotter$ PaperSize$ "I" Orientation$ Flip$ "E" "F" Offset$ "Y" PlotStyle$ "Y" "N" "N" "N" "N" "Y" "Y")         );if         (if P-R           (vl-cmdf "ZOOM" "W" Pt1 Pt2)         );if       );repeat     );if   );case );cond (Defpoints) (ResetVars) (princ);  (vl-cmdf "qsave"));defun PlotRoutine
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 03:25 , Processed in 0.505820 second(s), 64 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表