乐筑天下

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

[综合讨论] Macro - after dialog box, can&

[复制链接]

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 23:54:57 | 显示全部楼层 |阅读模式
Yo folks,
 
trying to automate a bunch of commands with a macro but can't get the last UNDO to run and can't figure out why.
 
the macro is as follows:
 
The macro stops after I return back from the dialoge box where I choose where to put the PartContent, then it should end with Undo/Back but it doesn't! Anyone know why?
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-7 00:09:53 | 显示全部楼层
So I got it working, I had too many enters and slashes. But I can add another question. The first Erase is there for me to remove 2 lines. It works fine if I hit both lines with one klick each. But if I miss the lines and start a crossing box instead, the command doesn't care. I get to clicks and that is it. Can I make this more user-friendly somehow?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-7 00:10:54 | 显示全部楼层
 
Use the SELECT command with a single pause (since for the SELECT command, AutoCAD will pause until the selection is completed), and then call the Previous selection set to be erased.
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-7 00:22:08 | 显示全部楼层
Ahhh, smrt
 
 
...........
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-7 00:26:47 | 显示全部楼层
...  ....
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-7 00:39:05 | 显示全部楼层
I have one more question. More a pondering really. A musing if you will.
 
If I run the commands in the macro by hand, the last thing I see is : Undo Mark encountered. Must enter UNDO END to go back further.
If I run the button though, I get: Start of Group encountered. Must enter UNDO END to go back further.
 
Why is that? It does the same thing, it goes back to the same place. Just weird.
 
BTw - UNDO Mark is a marvoulousousloussu thing. Why didn't I know about it sooner?!
回复

使用道具 举报

5

主题

224

帖子

219

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-7 00:43:47 | 显示全部楼层
It could be because you already have the things your working on selected maybe. No clue. As long as it works I guess.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-7 00:49:29 | 显示全部楼层
 
Sounds like you are starting a new Undo Group without first closing any Undo Groups which are already open - or, in other words, not closing an open Undo Group before opening another.
 
I would suggest adding an Undo End before starting the new Undo Mark.
 
In LISP, I use the following functions for this purpose:
  1. ;; Start Undo  -  Lee Mac;; Opens an Undo Group.(defun LM:startundo ( doc )   (LM:endundo doc)   (vla-startundomark doc));; End Undo  -  Lee Mac;; Closes an Undo Group.(defun LM:endundo ( doc )   (while (= 8 (logand 8 (getvar 'undoctl)))       (vla-endundomark doc)   ))
回复

使用道具 举报

14

主题

719

帖子

706

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-7 01:02:03 | 显示全部楼层
Hm. So let's say I keep this going, creating undo group within undo group withing undo group ... that has to eventually become Inception? Right? Right.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-9 22:11 , Processed in 0.439726 second(s), 70 queries .

© 2020-2025 乐筑天下

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