明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1284|回复: 8

[提问] action_tile不能用command来实现insert哇???

[复制链接]
发表于 2015-6-2 12:24:34 | 显示全部楼层 |阅读模式
autolisp想实现点击DCL的button,实现插入块INSERT的命令,然后插入的块随着鼠标,点击左键及插入块完成     ,但是好像action_tile 不能用command命令来实现Insert,有没程序实现类似的功能呢?   插入的块的是另外一个DWG文件!
发表于 2015-6-2 13:19:50 | 显示全部楼层
退出对话框就能用command了。
发表于 2015-6-2 14:18:39 来自手机 | 显示全部楼层
vla-insertblock
 楼主| 发表于 2015-6-2 21:56:41 来自手机 | 显示全部楼层
ZZXXQQ 发表于 2015-6-2 13:19
退出对话框就能用command了。

没懂什么意思呢?有类似的程序吗?
发表于 2015-6-3 08:11:15 | 显示全部楼层
bingshuier 发表于 2015-6-2 21:56
没懂什么意思呢?有类似的程序吗?

论坛有许多。找找看。
发表于 2015-6-4 11:03:32 | 显示全部楼层
本帖最后由 llsheng_73 于 2015-6-4 11:06 编辑

  1. (action_tile "burron" "(command \"insert\" ......)")


把command里边的"全部改为\",另外不能进行交互,也就是说COMMAND命令后边的所有选项需要写完整并且正确
如果需要在屏幕上指定插入点,比例,旋转等,刚需要在COMMAND之前加上(done_dialog 0)先退出对话框
发表于 2015-6-4 11:30:55 | 显示全部楼层
Help
A user cannot make an interactive selection while a dialog box is active. If you want the user to make a selection from the graphics screen, you must hide your dialog box and then restore it. Hiding the box is the same as ending it with done_dialog, except your callback function must use the done_dialog status argument to indicate that the dialog box is hidden—as opposed to ended or canceled. Set status to an application-defined value.

在线翻译

一个对话框处于活动状态时,用户就不能互动的选择。如果您希望用户从图形屏幕中进行选择,你必须隐藏您的对话框,然后恢复它。隐藏框结束与 done_dialog 相同,除了您的回调函数必须使用 done_dialog status 参数指示对话框隐藏 — — 相对于结束或取消。将状态设置为应用程序定义的值。
 楼主| 发表于 2015-6-11 00:33:04 | 显示全部楼层
本帖最后由 bingshuier 于 2015-6-11 00:42 编辑
llsheng_73 发表于 2015-6-4 11:03
把command里边的"全部改为\",另外不能进行交互,也就是说COMMAND命令后边的所有选项需要写完整并且正确 ...
  1. (defun c:abc()
  2.   (setq pt (getpoint "插入点"))
  3.   (setq dcl_id (load_dialog "C:\\Users\\Administrator\\Desktop\\lisp\\练习用\\练习.dcl"))
  4.   (new_dialog "abc" dcl_id)
  5.   (action_tile "accept" "(done_dialog 1)")
  6.   (action_tile "cancel" "(done_dialog 0)")
  7.   (action_tile "h100" "(done_dialog 0)(h100)")
  8.   (start_dialog)
  9.   )
  10. (defun h100()
  11.   (command "insert" "h100" pt 1 1 1 0)
  12.   )
  13. 这个是一部分的,但是就是不行呢,不晓得那里有问题呢?
 楼主| 发表于 2015-6-11 00:48:12 | 显示全部楼层
本帖最后由 bingshuier 于 2015-6-11 00:51 编辑
ivde 发表于 2015-6-2 14:18
vla-insertblock
  1. (defun c:abc()
  2.   (setq pt (getpoint "插入点:"))
  3.   (setq dcl_id (load_dialog "C:\\Users\\Administrator\\Desktop\\lisp\\练习用\\练习.dcl"))
  4.   (new_dialog "abc" dcl_id)
  5.   (action_tile "accept" "(done_dialog 1)")
  6.   (action_tile "cancel" "(done_dialog 0)")
  7.   (action_tile "h10" "(done_dialog 0)(h100)")
  8.   (start_dialog)
  9.   )
  10. (defun h100()
  11.   (vl-load-com)
  12.   (setq aa (vlax-get-acad-object)
  13.         bb (vla-get-ActiveDocument aa)
  14.         cc (vla-get-ModelSpace bb))
  15.   (vla-insertblock cc pt "h100" 1 1 1 0)
  16.   (vla-ZoomExtents AcadObject)
  17.   )
  18. 就是不知道那里没对呢 ,没有反映!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-21 21:14 , Processed in 0.260951 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表