乐筑天下

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

[编程交流] 不带en的打印当前布局

[复制链接]

10

主题

26

帖子

16

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
50
发表于 2022-7-6 09:39:31 | 显示全部楼层 |阅读模式
我想在具有多个布局的图形中绘制一个特定布局。
 
我想使用lisp设置一系列命令来打印当前/打开的布局。
 
下面是我正在使用的当前字符串:
 
  1. (defun c:plot40_B1 nil
  2. (vl-load-com)
  3. (command "_.-plot" "yes" "" "\\\\Kwifs1\\KWIN_40" "B1" "Millimeters" "LANDSCAPE" "NO" "Extents" "FIT" "CENTER" "YES" "KWIN39_BW.ctb" "YES" "W" "NO" "NO" "yes" )
  4. (princ)
  5. )

 
 
这不起作用-以下是AutoCAD处理命令时的F2回音:
 
  1. plot40_KWIN39_BW _.-plot Detailed plot configuration? [Yes/No] <No>:
  2. yes
  3. Enter a layout name or [?] <K-17831>: Enter an output device name or [?]
  4. [url="file://kwifs1/KWIN_40"]\\KWIFS1\KWIN_40[/url]>: [url="file://kwifs1/KWIN_40"]\\Kwifs1\KWIN_40[/url] Enter paper size or [?] <A3>: A3 Enter
  5. paper units [inches/Millimeters] <Millimeters>: Millimeters Enter drawing
  6. orientation [Portrait/Landscape] <Landscape>: LANDSCAPE Plot upside down?
  7. [Yes/No] <No>: NO Enter plot area [Display/Extents/Layout/View/Window]
  8. <Extents>: Extents Enter plot scale (Plotted Millimeters=Drawing Units) or
  9. [Fit] <Fit>: FIT Enter plot offset (x,y) or [Center] <Center>: CENTER Plot with
  10. plot styles? [Yes/No] <Yes>: YES Enter plot style table name or [?] (enter .
  11. for none) <KWIN39_BW.ctb>: KWIN39_BW.ctb Plot with lineweights? [Yes/No] <Yes>:
  12. YES Scale lineweights with plot scale? [Yes/No] <Yes>: W

 
 
问题是:输入布局名称或[?]:
 
目前,lisp中与这个问题相反的部分是“”。
 
我尝试了“当前”和“布局”,因为我只想打印我打开的布局,而不输入特定的布局名称,因为这显然是我想要反复使用的打印例程。
 
不确定“输入布局名称或[?]”的>部分是什么:是
 
我不确定“打印当前布局”的有效答案是什么。
 
我试图关闭对话框,以便在命令提示符下找到我的选项,但无法解决这个问题。旧的CmdDia=0不起作用。
 
非常感谢您的建议!!!
回复

使用道具 举报

62

主题

466

帖子

404

银币

后起之秀

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

铜币
310
发表于 2022-7-6 09:55:39 | 显示全部楼层
您所在的任何空间都将被自动选择,因此您可以只使用“”。
 
如果您在模型空间中,则应显示“输入布局名称或[?]:”
 
如果你输入?它将生成可用选项的列表。
 
无需(vl load com)
只有在使用Visual LISP时才需要此选项
 
如果您试图打印而不是打印到文件,则会错过一个问题
  1. (defun c:plot40_B1 nil
  2. [color=#ff0000](setvar "cmdecho" 0)[/color]
  3. (command "_.-plot" "yes" "" "\\\\Kwifs1\\KWIN_40" "B1" "Millimeters" "LANDSCAPE" "NO" "Extents" "FIT" "CENTER" "YES" "KWIN39_BW.ctb" "YES" "W" "NO" "NO" "NO" "yes" )
  4. [color=#ff0000](setvar "cmdecho" 1)[/color]
  5. (princ)
  6. )
回复

使用道具 举报

0

主题

2

帖子

2

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 10:20:09 | 显示全部楼层
 
  1. ;lisp for plot
  2. ;you can change your device and paper size
  3. ;Created by Ahmed Abdel Ghany "[email="Ahmed_proff@yahoo.com"]Ahmed_proff@yahoo.com[/email]"
  4. ;With my best regards
  5. (defun
  6. ERR (X)
  7. (if (= "Function Cancelled" X)
  8. (setq X "Ctrl+C or Esc key pressed.")
  9. ) ;_ end of if
  10. (setq *ERROR* OLDERR)
  11. (princ (strcat "\nError: " X))
  12. (princ)
  13. ) ;_ end of defun
  14. ;;ERR
  15. ;;;********** Main Program **********
  16. (defun c:B1 ()
  17. (setq oecho (getvar "cmdecho"))
  18. (setvar "cmdecho" 0)
  19. (setvar "filedia" 0)
  20. (vl-load-com)
  21. (command "zoom" "e")
  22. (initget "YES NO")
  23. (setq pl (getkword "\nDo you want to plot? (Y)es/(N)o <Y>:"))
  24. (if (= nil pl)(setq pl "Y"))
  25. (cond
  26. ((= pl "Y")
  27. ;;;;Paper space;
  28. (if (/= (getvar "tilemode") 1)
  29. (progn
  30. (command
  31. "-PLOT"
  32. "y" ;Detailed plot configuration? [Yes/No] <No>:;
  33. "" ;Enter a layout name or [?] <Layout1>:
  34. "\\\\Kwifs1\\KWIN_40" ;Enter an output device name or [?] <None>:
  35. "B1" ;Enter paper size or [?] <A3>:
  36. "m" ;Enter paper units [inches/Millimeters] <Inches>: m
  37. "l" ;Enter drawing orientation [Portrait/Landscape] <Landscape>:
  38. "no" ;Plot upside down? [Yes/No] <No>:
  39. "e" ;Enter plot area [Display/Extents/Limits/View/Window] <Layout>: e
  40. "f" ;Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>: f
  41. "0,0" ;Enter plot offset (x,y) or [Center] <0.00,0.00>:
  42. "yes" ;Plot with plot styles? [Yes/No] <Yes>:
  43. "KWIN39_BW.ctb" ;Enter plot style table name or [?] (enter . for none) <>:
  44. "yes" ;Plot with lineweights? [Yes/No] <Yes>:
  45. "" ;Scale lineweights with plot scale? [Yes/No] <No>:
  46. "" ;Plot paper space first? [Yes/No] <No>:
  47. "" ;Hide paperspace objects? [Yes/No] <No>:
  48. "" ;Write the plot to a file [Yes/No] <N>:
  49. "" ;Save changes to page setup [Yes/No]? <N>
  50. "y" ;Proceed with plot [Yes/No] <Y>:
  51. );command
  52. (prompt "\nSuccessfully Plot.....")
  53. (princ)
  54. );progn
  55. ;model space
  56. (progn
  57. (command
  58. "-plot"
  59. "y" ;Detailed plot configuration? [Yes/No] <No>:;
  60. "" ;Enter a layout name or [?] <Model>:
  61. "\\\\Kwifs1\\KWIN_40" ;Enter an output device name or [?] <None>:
  62. "B1" ;Enter paper size or [?] <A3>:
  63. "m" ;Enter paper units [inches/Millimeters] <Inches>: m
  64. "l" ;Enter drawing orientation [Portrait/Landscape] <Landscape>:
  65. "no" ;Plot upside down? [Yes/No] <No>:
  66. "e" ;Enter plot area [Display/Extents/Limits/View/Window] <Layout>: e
  67. "f" ;Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>: f
  68. "0,0" ;Enter plot offset (x,y) or [Center] <0.00,0.00>:
  69. "yes" ;Plot with plot styles? [Yes/No] <Yes>:
  70. "KWIN39_BW.ctb" ;Enter plot style table name or [?] (enter . for none) <>:
  71. "" ;Plot with lineweights? [Yes/No] <Yes>:
  72. "" ;Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] <As displayed>:
  73. "" ;Write the plot to a file [Yes/No] <N>:
  74. "" ;Save changes to page setup [Yes/No]? <N>
  75. "y" ;Proceed with plot [Yes/No] <Y>:
  76. );command
  77. (prompt "\nSuccessfully Plot.....")
  78. (princ)
  79. );progn
  80. );if
  81. );Yes
  82. ((= pl "N")(prompt "\nYou canceled plotting"));No
  83. );cond
  84. (terpri)
  85. (setvar "filedia" 1)
  86. (setvar "cmdecho" oecho)
  87. );DEFUN
  88. ;;;;***********End of program*************
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 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
回复

使用道具 举报

27

主题

126

帖子

99

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
135
发表于 2022-7-6 10:52:41 | 显示全部楼层
最终,问题似乎出现在代码中,您将值“W”放在它想要“是/否”的地方。
 
这里有一个选项,您可以使用DCL代码生成页面选项卡列表,并从中选择所需内容。以下是我使用的is:
 
然后对于函数:
 
然后复制功能代码并修改打印样式表和其他打印机或打印样式的输出设备。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-6 05:14 , Processed in 0.943542 second(s), 62 queries .

© 2020-2025 乐筑天下

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