乐筑天下

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

对多个文件进行批处理操作

[复制链接]

61

主题

792

帖子

35

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1015
发表于 2020-4-16 10:19:10 | 显示全部楼层
我使用的批次名称不同,但这是在一个setup.bat文件中:
PDF例程绘制到桌面\PDF文件夹:
回复

使用道具 举报

4

主题

38

帖子

8

银币

初来乍到

Rank: 1

铜币
49
发表于 2020-4-16 10:23:10 | 显示全部楼层
不错。
想法(为了将来的维护):您可以在脚本中的PLOT命令中添加一些留档选项。
  1. ...
  2.         (command
  3.                 "-plot"
  4.                 "yes"                   ; Detailed plot configuration? [Yes/No] :
  5.                 (getvar 'CTAB)          ; Enter a layout name or [?] :
  6.                 "Ghostscript.pc3"       ; Enter an output device name or [?] :
  7.                 "ARCH E1 (30x42)"       ; Enter paper size or [?] :
  8.                 "inches"                ; Enter paper units [Inches/Millimeters] [I]:
  9.                 "landscape"             ; Enter drawing orientation [Portrait/Landscape] :
  10.                 "no"                    ; Plot upside down? [Yes/No] :
  11.                 "limits"                ; Enter plot area [Display/Extents/Limits/View/Window] :
  12.                 "1:1"                   ; Enter plot scale (Plotted Inches=Drawing Units) or [Fit] :
  13.                 "center"                ; Enter plot offset (x,y) or [Center] :
  14.                 "yes"                   ; Plot with plot styles? [Yes/No] :
  15.                 "Ghostscript.ctb"       ; Enter plot style table name or [?] (enter . for none) :
  16.                 "yes"                   ; Plot with lineweights? [Yes/No] :
  17.                 "no"                    ; Scale lineweights with plot scale? [Yes/No] :
  18.                 "no"                    ; Plot paper space first? [Yes/No] :
  19.                 "no"                    ; Hide paperspace objects? [Yes/No] :
  20.                 "yes"                   ; Write the plot to a file [Yes/No] :
  21.                 (strcat
  22.                         "C:\\\\\"
  23.                         (vl-filename-base
  24.                              (getvar "dwgname"))
  25. ;;                             "-FULL-SIZE.plt"
  26.                              )          ; FILE NAME
  27.                 "yes"                   ; Save changes to page setup [Yes/No]?
  28.                 "yes"                   ; Proceed with plot [Yes/No] :
  29.                 )
  30. ...
回复

使用道具 举报

61

主题

792

帖子

35

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1015
发表于 2020-4-16 10:56:48 | 显示全部楼层

  1. @echo off
  2. :: process files given as argument to this batch script.
  3. ::
  4. :: Last Updated: 04.14.20 9:41:00 AM
  5. ::
  6. :: BY: John Kaul
  7. ::  
  8. set script="LEFT BLANK"
  9. set script=%script:\\=\%
  10. :processArgs
  11.         if [%1]==[] goto endmark
  12. [color=red]title "%~f1"[/color]
  13.         call "C:\Program Files\Autodesk\AutoCAD 2021\accoreconsole.exe" /i "%~f1" /s %script% /l en-US >"C:\temp\cleanup.log"
  14.         if errorlevel 1 goto errormark
  15.         SHIFT
  16.         goto processArgs
  17. :errormark
  18.         echo.
  19.         echo.
  20.         echo ERROR processing %~f1
  21.         pause
  22.         echo.
  23. :endmark
  24. rem
  25. rem     finished
  26. rem

我在上面添加了红色部分,以显示它正在处理的文件
是否有什么可以显示当前的数字,例如100中的21?
回复

使用道具 举报

61

主题

792

帖子

35

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1015
发表于 2020-9-24 19:47:16 | 显示全部楼层
以下应该能给你想要的,-即" Processing[21/100]:c:\ temp \ my drawing . DWG "     @ echo off 。
::处理作为该批处理脚本的参数给出的文件,。
::。
::最后更新时间:上午09 . 25 . 20 7:51:30 。
::。
作者:约翰·考尔。

set script = " % ~ dp0 \ batch drawings _ accoreconsole . SCR " 。
设置脚本=%script:\\=\%。
:: -创建用于提示的参数计数器,。
设置argc=0。
设置count=1。
找出我们有多少个参数,。
for % % x in(% *)do set/A argc+= 1 。

:processArgs。
if [%1]==[]转到结束标记。
title "%~f1"。
调用" C:\ Program Files \ Autodesk \ AutoCAD 2021 \ accoreconsole . exe "/I " % ~ f1 "/s % script %/l en-US > " C:\ temp \ clean up . log " 。
回显处理[%count%/%argc%]: %~f1 。
设置/A count +=1。
如果错误级别1转到错误标记。
SHIFT。
转到processArgs。
:errormark。
回声,。
回声,。
回显错误处理%~f1。
暂停。
回声,。
:结束标记。
快速移动。
rem完成。
快速移动。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 10:40 , Processed in 0.548037 second(s), 58 queries .

© 2020-2025 乐筑天下

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