乐筑天下

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

[编程交流] Open file and run lisp - macro

[复制链接]

22

主题

272

帖子

254

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
111
发表于 2022-7-6 11:07:06 | 显示全部楼层 |阅读模式
Never did it before:
Need button macro that will open file (dwg) and execute one lisp command in it.
It is possible just something very simple?
Thank you in advance.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:14:49 | 显示全部楼层
How about putting the LISP file in the ACADDOC.lsp to run when loaded, and click open
回复

使用道具 举报

22

主题

272

帖子

254

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
111
发表于 2022-7-6 11:21:16 | 显示全部楼层
Lee I will need it only for one dwg. I don't need it to load with every start up. That is the problem. Start file execute lisp and that it for few weeks and start over again. It must be done in same way always but I think I or somebody will not remember it after time.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 11:29:46 | 显示全部楼层
You could load a script from the button to open a specific file and execute commands.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 11:36:26 | 显示全部楼层
Not exactly what you want, but in your program shortcut, you can add
and it will open autocad with that file.
回复

使用道具 举报

22

主题

272

帖子

254

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
111
发表于 2022-7-6 11:38:21 | 显示全部楼层
Thing is: somebody with 0.0000001% knowledge of AutoCAD will use it most of the time to update dwg. Need it foul proof. just one click and done.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 11:44:36 | 显示全部楼层
Sounds like a script is the answer or put it in the acaddoc file that if a filename matches the specific file, run the lisp on it.
回复

使用道具 举报

22

主题

272

帖子

254

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
111
发表于 2022-7-6 11:54:10 | 显示全部楼层
Or just change
to 1% will work. It is possible.
回复

使用道具 举报

59

主题

327

帖子

268

银币

后起之秀

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

铜币
295
发表于 2022-7-6 11:55:57 | 显示全部楼层
If you have made yourself a button, then add a macro in there like this:
 
  1. ^C^C^Pmylisp;
 
Of course "mylisp" is an example function in the lisp file itself.
Thats for the button...
 
Create and save the lisp in one of the autocad support file search paths. You can see where they are or add the folder where your lisp is stored: options>first tab>support file search paths>add>browse to your location.
 
Now in this same folder create a file called acaddoc.lsp. In this file you put 1 line:'
 
  1. (autoload "FILENAME" '("mylisp" "mylispifIhad2namesforit")
 
Well all this should do what you need.
 
Much credit to Alanjt and others who have helped me a lot with this.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 12:04:49 | 显示全部楼层
Load/AutoLoad Usage
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 11:27 , Processed in 0.863730 second(s), 83 queries .

© 2020-2025 乐筑天下

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