乐筑天下

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

[编程交流] question about batch, lisp, sc

[复制链接]

8

主题

80

帖子

72

银币

初来乍到

Rank: 1

铜币
40
发表于 2022-7-6 12:26:53 | 显示全部楼层
swapping of responses??  what have you highlighted several times?  I posted what I am using for all the files, I have tried it with different SDI modes , I'll try it with the resume workaround and give it a go.  Thanks DBroada!
回复

使用道具 举报

48

主题

1073

帖子

1043

银币

后起之秀

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

铜币
238
发表于 2022-7-6 12:29:54 | 显示全部楼层
the swapping of "do you want to save changes" bit. Sorry, too much rum to make sense.
回复

使用道具 举报

20

主题

344

帖子

325

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 12:32:51 | 显示全部楼层
I wrote a LISP for batch processes, it'll take just about all comers and won't require a batch file, plus it writes its own scripts. Check my signature for the link.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 12:35:32 | 显示全部楼层
The problem guys is your overlooking the simple answer it being run by a batch file !
 
A batch file runs outside autocad from the operating system command line once you start the loop the batch file opens a session of autocad and it expects you to close it as well, hence why quit works and not close.
 
The easier way is to stay inside autocad and use a script to loop through the drawings and yes use close not quit. We have done for 100+ drawings no problems.
 
A couple of extra real help full tips after you create your dir *.dwg >mydwgs.txt file use WORD to edit it, remove the junk till you get just filenames only use "hold alt key" and use mouse for vertical selection then delete, an unknown fact is that you can find/replace the end of line with something new uselly my script commands.
 
eg
mydwg1.dwg
mydwg2.dwg etc
 
find replace g^p   with g zoom e domylisp^p
 
ie   
mydwg1.dwg zoom e domylisp
mydwg2.dwg zoom e domylisp
also add blank line at top ^p  replace ^oopen            (space after n)
 
open mydwg1.dwg zoom e domylisp
open mydwg2.dwg zoom e domylisp
 
delete blank line
save as a script
 
Hope this helps. it only takes a couple of minutes to edit the dwg txt file.
回复

使用道具 举报

8

主题

80

帖子

72

银币

初来乍到

Rank: 1

铜币
40
发表于 2022-7-6 12:39:21 | 显示全部楼层
You are correct that I would like to run this outside of autocad well as I stated before I have it open Autocad but as you say with the batch file it runs externally and in the program it quits and then restarts with the next drawing in the folder.  I posted the code in this thread, maybe it would be helpful if I commented it as to what I was attempting to do?  and bid al thanks for your help here but I guess I got a lil lost as to what you were explaining with your script file.
回复

使用道具 举报

8

主题

80

帖子

72

银币

初来乍到

Rank: 1

铜币
40
发表于 2022-7-6 12:39:44 | 显示全部楼层
is it a portion of the final blitz package?
回复

使用道具 举报

48

主题

1073

帖子

1043

银币

后起之秀

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

铜币
238
发表于 2022-7-6 12:45:06 | 显示全部楼层
pretty much what I was trying to say but I prefer to construct my script using excel 
just one note, if you use dir *.dwg > mydwgs.txt /b you will NOT get any of the junk, just the filenames.
回复

使用道具 举报

8

主题

80

帖子

72

银币

初来乍到

Rank: 1

铜币
40
发表于 2022-7-6 12:46:35 | 显示全部楼层
I write all my scripts in notepad?  what are the benefits in doing it in excel?  ..ssearching google now...
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:50:49 | 显示全部楼层
I would agree with BigAl on this one - is it mandatory that you run the script from outside of AutoCAD?
 
Why not just create a script file and run it from within ACAD?
 
You could even use a LISP to write the script for you
回复

使用道具 举报

8

主题

80

帖子

72

银币

初来乍到

Rank: 1

铜币
40
发表于 2022-7-6 12:52:20 | 显示全部楼层
No its not mandatory at all I guess I was just playing around with what I knew the most.  Basically what I want to do is be able to process multiple drawings by purging them to minimize file size before transmittal or even just to reduce the file size.  The way that I have it it opens autocad, opens the drawing , runs the script to purge and then the lisp to save it with the same name in an "updated" folder.  The problem is that it opens autocad for every drawing in the folder performs the task shuts down and goes on to the next.  I am more than interested in doing a lisp for this and I am eager to learn.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 10:28 , Processed in 0.637127 second(s), 70 queries .

© 2020-2025 乐筑天下

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