乐筑天下

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

[编程交流] zoom extend and save - PLEASE

[复制链接]

9

主题

23

帖子

14

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-5 16:23:40 | 显示全部楼层 |阅读模式
Hello everyone,
 
This lisp might be very usefull:
 
I need help with lisp that asking for Current drawing \ All tabs
 
the default should be current drawing.
 
when pressing Enter (for current drawing) the drawing will do Zoom Extend - save the drawing - and close the drawing.
when pressing A (for all tabs) all the drawings in the tabs will be Zoom Extend - save the drawing - and close the drawing.
 
The purpose of this lisp is to save time by saving and closing the drawing but only after zoom extend it for better preview.
 
Thank you very much in advance.
 
Eyal
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 16:33:19 | 显示全部楼层
Here is a good zoom extents
 
  1. ;; Zoom extents in All Layouts (excluding Model) ;; Alan J. Thompson (or *Acad* (setq *Acad* (vlax-get-acad-object))) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument *Acad*))) ((lambda (ctab)    (foreach layout (layoutlist)      (setvar 'ctab layout)      (vla-put-mspace *AcadDoc* :vlax-false)      (vla-zoomextents *Acad*)    )    (setvar 'ctab ctab)  )   (getvar 'ctab) ) (princ)
回复

使用道具 举报

9

主题

23

帖子

14

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-5 16:38:33 | 显示全部楼层
How do you operate it?
 
What should I type in the command prompt?
 
is it ask if I want to save only the current or all the tabs?
 
Thank you.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 16:40:42 | 显示全部楼层
 
If you have a menu or toolbar or macro it then just loads the lisp file and zooms all. If you save it to a Autocad support file directory that you have set like c:\mylisps then its just a case of issuing the commnad to run it. Save it as say zoomalltabs.lsp
 
menu/toolbar ^c^c^p(load "zoomalltabs")
command line just type (load "zoomalltabs")
make it a defun C:zoomall and autoload then type zoomall at any time.
 
Current Z E you can not get much simpler
回复

使用道具 举报

48

主题

657

帖子

33

银币

限制会员

铜币
-1
发表于 2022-7-5 16:50:09 | 显示全部楼层
I might be looking at this a bit simply, but I use
 
 
  1. (defun c:closer() (command "zoom" "all" "zoom" ".95x")) ;;Zooms to 95% of full screen (command "qsave")) ;;saves the drawing (command "close" "y") ;;Closes the drawing)
回复

使用道具 举报

5

主题

1074

帖子

1088

银币

初来乍到

Rank: 1

铜币
9
发表于 2022-7-5 16:54:32 | 显示全部楼层
 
This is great for a single layout, but the OP needs to do that for either multiple layouts, or different drawing tabs, I am not sure which.
回复

使用道具 举报

48

主题

657

帖子

33

银币

限制会员

铜币
-1
发表于 2022-7-5 16:56:55 | 显示全部楼层
Its a simple start though, add in a few lines to switch between tabs and it should be good to go (I don't have a routine that does that handy at the moment, but there should be one that's easy to find)
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 17:02:01 | 显示全部楼层
A bit more
 
  1. (defun c:closer( / ans)(setq ans (getstring "All press A or just  for current "))(if (= ans "") (command "zoom" "all" "zoom" ".95x") ;;Zooms to 95% of full screen (load "zoomalltabs") ) (command "qsave") ;;saves the drawing (command "close" "y") ;;Closes the drawing)
回复

使用道具 举报

66

主题

1552

帖子

1514

银币

后起之秀

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

铜币
325
发表于 2022-7-5 17:11:10 | 显示全部楼层
BIGAL:
  1. _$ (getstring "All press A or just  for current ") ; enter was pressed""
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 17:13:47 | 显示全部楼层
Grr your right thanks, changed to "" sometimes just write without testing properly as I used getstring a  is not a nil answer. Changed code above, I cheated also press any key but left it as "A" in message.
 
  1. (setq ans (getstring "All press A or just  for current "))(if (= ans "")(alert " pressed")(alert "non nil"))
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-14 21:08 , Processed in 0.722035 second(s), 72 queries .

© 2020-2025 乐筑天下

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