明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 6910|回复: 23

在autocad2002中能取消鼠标双击弹出的缺省属性框吗?

  [复制链接]
发表于 2004-9-17 00:29:00 | 显示全部楼层 |阅读模式
我用lsp语句,可以把自己的函数加入到鼠标双击的事件中了,但是运行完自己的函数后,总是自动弹出原来缺省的属性框,不知道怎么取消,我只想运行自己的函数,不想再弹出缺省的属性对话框,请指教,谢谢!
发表于 2024-2-10 13:55:05 | 显示全部楼层
雪山飞狐_lzh 发表于 2004-9-17 09:00
把acdblclkedit.arx卸载掉

高版本已经没有这个arx了。用sendkey 发送ESC也还是会闪烁退掉默认对话框,不是最优解,用voto,这个在文档锁定模式下,C#才有。lisp没法调用,目前都没有好的办法来解决这个问题。
发表于 2024-2-12 11:59:55 | 显示全部楼层
masterlong 发表于 2004-9-17 11:08
这是论坛里的一个范例文件,找不到原贴,拷贝在这里了

高版本不适用了,这写个arx都不存在,若不屏蔽原有的双击,双击对象时就会调用原有的命令,最好的办法是10#楼的重定义原有命令。
发表于 2004-9-17 01:47:00 | 显示全部楼层
你应该是装了扩展工具后将双击属性开关打开了


dcprops                 off
 楼主| 发表于 2004-9-17 07:36:00 | 显示全部楼层
那我怎么关闭呢?扩展工具是需要的,肯定不能卸载的啊
发表于 2004-9-17 08:21:00 | 显示全部楼层
这个应该跟et工具无关,关不掉的
发表于 2004-9-17 09:00:00 | 显示全部楼层
把acdblclkedit.arx卸载掉
发表于 2004-9-17 10:09:00 | 显示全部楼层
厉害,这你也知道.


请问如何用lsp语句,可以把自己的函数加入到鼠标双击的事件中
发表于 2004-9-17 11:06:00 | 显示全部楼层
如果跟et有关,怎么关闭,我的帖子不是已经有了吗?


如果无关,那就在你的程序里加(arxunload "acdblclkedit.arx" nil)
发表于 2004-9-17 11:08:00 | 显示全部楼层
这是论坛里的一个范例文件,找不到原贴,拷贝在这里了 (defun jb:beginDoubleClick (reactorObject Listofsomething / point obj owner ownerobj command-list cmd gripset)
;;; added for error in 2004 - point returned from outside a
;;; paperspace viewport throws an error.
(if (vl-catch-all-error-p (vl-catch-all-apply 'trans (list (car Listofsomething) 0 1)))
(princ "PaperSpace")
(progn
(setq cmd "_.PROPERTIES" ; command default
point Listofsomething
obj (car (nentselp (trans (car point) 0 1)))
owner (car (cadddr (nentselp (trans (car point) 0 1))))
gripset (cadr (ssgetfirst))
doc (vlax-get (vlax-get-acad-object) "activedocument")
) (if obj
(progn
; this statement will determine if the object
; clicked over is an insert or not
(cond
(owner (setq ownerobj (strcase (vlax-get (vlax-ename->vla-object owner) "objectname"))))
(T (setq ownerobj (strcase (vlax-get (vlax-ename->vla-object obj) "objectname"))))
) ;Now set up your commands for the appropriate object
; Object Command
;(cons "ACDBBLOCKREFERENCE" "_.REFEDIT ")
(setq command-list
(list (cons "ACDBBLOCKREFERENCE" "_.REFEDIT")
(cons "ACDBATTRIBUTE" "_.ATTEDIT")
(cons "ACDBMTEXT" "_.DDEDIT")
(cons "ACDBTEXT" "_.DDEDIT")
(cons "ACDBROTATEDDIMENSION" "_.DDEDIT")
(cons "ACDBALIGNEDDIMENSION" "_.DDEDIT")
(cons "ACDBORDINATEDIMENSION" "_.DDEDIT")
(cons "ACDBDIAMETRICDIMENSION" "_.DDEDIT")
(cons "ACDBRADIALDIMENSION" "_.DDEDIT")
(cons "ACDB2LINEANGULARDIMENSION" "_.DDEDIT")
(cons "ACDBMLINE" "_.MLEDIT")
(cons "ACDBATTRIBUTEDEFINITION" "_.DDEDIT")
(cons "ACDBHATCH" "_.HATCHEDIT")
(cons "ACDBRASTERIMAGE" "_.IMAGEADJUST")
(cons "AECDBWALL" "_.PROPERTIES")
(cons "AECDBDOOR" "_.PROPERTYDATAEDIT")
(cons "AECDBWINDOW" "_.PROPERTIES")
(cons "AECDBWINDOWASSEMBLY" "_.PROPERTIES")
(cons "AECDBCURTAINWALLLAYOUT" "_.PROPERTIES")
(cons "AECDBSPACE" "_.PROPERTYDATAEDIT")
(cons "AECDBSTAIR" "_.PROPERTIES")
(cons "AECDBRAILING" "_.PROPERTIES")
(cons "AECDBMVBLOCKREF" "_.PROPERTIES")
(cons "AECDBOPENING" "_.PROPERTIES")
(cons "AECDBCEILINGGRID" "_.PROPERTIES")
(cons "AECDBCOLUMNGRID" "_.PROPERTIES")
(cons "AECDBSLAB" "_.PROPERTIES")
(cons "AECSDBMEMBER" "_.PROPERTIES")
(cons "AECDBMASSELEM" "_.PROPERTIES")
(cons "AECDBROOF" "_.PROPERTIES")
(cons "AECDBROOFSLAB" "_.PROPERTIES")
(cons "AECDBCAMERA" "_.PROPERTIES")
(cons "AECDBSCHEDULETABLE" "_.PROPERTIES")
)
) ;;; get the command
(foreach x command-list
(if (= (car x) ownerobj) (setq cmd(cdr x)))
) ;;; make adjustment to command
(cond
((= cmd "_.REFEDIT") (setq cmd "_.refedit (princ (cdr (nentselp (trans(car point)0 1)))) "))
((= cmd "_.ATTEDIT") (setq cmd "_.attedit (princ obj) "))
((= cmd "_.EATTEDIT") (setq cmd "_.eattedit (princ obj) "))
(t (setq cmd(strcat cmd " ")))
)
(vla-sendcommand doc cmd)
);;progn
);;if
);;progn
);;if
(princ)
);;_ end of jb:beginDoubleClick _ ;; ;
;
; (defun jboadDoublClickReactor (/)
;=;(if (/= (type jbDoubleClickReactor) 'VLR-MOUSE-REACTOR)
;=; (setq jbDoubleClickReactor
;=; (VLR-Mouse-Reactor nil '((:VLR-beginDoubleClick . jb:beginDoubleClick))) ;_ end of vlr-editor-reactor
;=; )
;=;) (setq jbDoubleClickReactor
(VLR-Mouse-Reactor nil '((:VLR-beginDoubleClick . jb:beginDoubleClick))) ;_ end of vlr-editor-reactor
) (if (not (vlr-added-p jbDoubleClickReactor)) (vlr-add jbDoubleClickReactor))
;;; Unload acdblclkedit.arx in favor of jb's Expanded Double Click editing!
(if (member "acdblclkedit.arx" (arx)) (arxunload "acdblclkedit.arx" nil))
(princ)
);;_ end of jboadDoublClickReactor _ ;; (progn (jboadDoublClickReactor) (princ))
发表于 2004-9-17 12:29:00 | 显示全部楼层
发表于 2004-9-17 19:05:00 | 显示全部楼层
这里还有一个范例,因为我没有什么用,不知你有没有用?
  1. ;;来源:INTERNET
  2. ;;作者:ZOLTAN
  3. ;;
  4. ;;适用于mtext
  5. (Command "_.UNDEFINE" "MTEDIT" )
  6. (Defun C:MTEDIT ( / enPick )
  7.   (If (Cadr (SSGetFirst)) ;is MText already selected
  8.    (SetQ enPick (SSName (SSGet ":S") 0) ) ;user double-clicked
  9.    (SetQ enPick (Car (EntSel "\nSelect an MTEXT object: ")) ) ;user started MTEDIT command
  10.   )
  11.   (If enPick
  12.    (If (And (= (Cdr (Assoc 0 (EntGet enPick))) "MTEXT") ;validate my object
  13.                      (GetXData enPick "QuickBag_Note")
  14.            )
  15.      (QB_EditNote enPick ) ;my own editor
  16.      (MTEDIT enPick ) ;normal MTEXT editor
  17.    )
  18.   )
  19.   (TerPri )
  20.   (Prin1 )
  21. )
  22. ;
  23. ;;适用于属性块
  24. (Command "_.UNDEFINE" "EATTEDIT" )
  25. (Defun C:EATTEDIT ( / enPick bLoop )
  26.   (SetQ bLoop T )
  27.   (While bLoop
  28.    (If (SetQ enPick (Car (EntSel "\nSelect a Block: ")) )
  29.      (If (= (Cdr (Assoc 0 (EntGet enPick))) "INSERT") ;validate that object is a block
  30.        (If (= (Cdr (Assoc 66 (EntGet enPick))) 1) ;validate that the block has attributes
  31.          (ProgN
  32.            (If (GetXData enPick "QuickBag_KeyNote") ;validate that the block is mine.
  33.              (QB_EditKeyNote enPick ) ;my own editor
  34.              (Command ".ACAD_EAttedit.EATTEDIT" enPick ) ;normal EATTEDIT editor
  35.            )
  36.            (SetQ bLoop nil) ;get out of the loop
  37.          )
  38.          (PrinC "\nThe selected block has no editable attributes." )
  39.        )
  40.      )
  41.      (PrinC "\nError selecting entity." )
  42.    )
  43.   )
  44.   (TerPri )
  45.   (Prin1 )
  46. )
  47. ;
  48. ;;一般图元对象
  49. (Command "_.UNDEFINE" "PROPERTIES" )
  50. (Defun C:PROPERTIES ( / psPick enPick )
  51.   (If (SetQ psPick (Cadr (SSGetFirst))) ;is object already selected
  52.    (ProgN
  53.      (SetQ enPick (SSName psPick 0) )
  54.      (If (GetXData enPick "QuickBag") ;validate my object
  55.        (QB_Edit enPick ) ;my own editor
  56.        (Command ".ACAD_OPM.PROPERTIES" ) ;open properties window
  57.      )
  58.    )
  59.    (Command ".ACAD_OPM.PROPERTIES" ) ;user started PROPERTIES command
  60.   )
  61.   
  62.   (TerPri )
  63.   (Prin1 )
  64. )
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 22:34 , Processed in 0.192854 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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