乐筑天下

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

[编程交流] DCL without halting AutoCAD (e

[复制链接]

3

主题

8

帖子

5

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 19:55:56 | 显示全部楼层 |阅读模式
Hi all,
 
I've been confidently programming in AutoLISP for a few years, but just  now started dipping my toes into DCL. I have a quick question, because I think I've misunderstood what DCL can do for me.
 
Is it possible to have a DCL dialog displayed, and still be interacting  with the drawing? What I mean is, after I issue the (start_dialog)  command my lisp function freezes until you close the DCL window. Is it  not possible to have that DCL dialog displayed and still have lisp code  running?
 
An example of what I'd thought was possible:
1. User starts command MYCMD
2. Dialog box appears, with the text "you haven't clicked yet"
3. User clicks a point on the drawing
4. Dialog box text changes to "you clicked on (X,Y)"
5. Loop back to #3, until user exits MYCMD
6. Close dialog box
 
PS Yes, I understand the above is more easily done with (princ)'s or (grtext)'s, I'm just wanting to learn DCL capabilities.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 20:10:57 | 显示全部楼层
Welcome to CADTutor
 
Standard DCL does not support modeless dialogs (only modal), and so unfortunately this is not possible.
 
If you wish to continue using AutoLISP for this task, you would need to look into using third-party software, such as OpenDCL or ObjectDCL.
 
Lee
回复

使用道具 举报

3

主题

8

帖子

5

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-5 20:28:42 | 显示全部楼层
Cheers Lee - disappointing, but at least I have confirmation of it.
 
Actually, for my simple project, I think I'm just going to bail out of using a DCL-like interface altogether, and just use (grread) coupled with your neat (LM:grtext) code (which is far better suited to what I need than the built-in (grtext) i mentioned earlier)
 
So, double-cheers then
回复

使用道具 举报

7

主题

80

帖子

73

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-5 20:43:07 | 显示全部楼层
IMO, dcl will be unloaded once the routine is finish.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 20:45:31 | 显示全部楼层
KISS keep it simple s.....
  1. (setq pt (getpoint "pick point"))(setq x (car pt)Y (cadr pt)Z (caddr pt))(alert (strcat "you have picked " (rtos X 2 2) "," (rtos Y 2 2)))
回复

使用道具 举报

2

主题

389

帖子

387

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 21:00:32 | 显示全部楼层
Well, yes, you can do what you are talking about with DCL, though it may not be a truly modeless way.  And note that, in general, you don't want dialog boxes blocking the screen while the user is trying to pick a point anyway.   Here is the link to a quick tutorial on "hiding" the dialog box: http://www.afralisp.net/dialog-control-language/tutorials/hiding-dialog-boxes.php.  You can even nest dialogs.  There's a link to that on the above webpage.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-12 01:13 , Processed in 0.613550 second(s), 64 queries .

© 2020-2025 乐筑天下

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