I have a block with attributes and on double click I would like to suppress the autocad attribute editor opening and instead have my own customized dialog box open for input. Is this possible and where would I begin. I have the dcl and lisp for the custom dialog running fine, but rather than invoke this with a command I would like to try if I can get this running by double cliking this block object.
Just Undefine EATTEDIT and change your lisp command to be activated as EATTEDIT
Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator | Layer Apps | List on Steroids | VP Zoom Scales
Exchange App Store
Hi leo, pli,
You can do what pli is advising.
But on that way, your not going to be able to use eattedit command.
If You still need this command, I think there is a way that you change double click action in CUI for attributes.
This is going to activate your command, but I'm not sure how it is going to work with it. There might be a problem with selecting entity.
Pli,
That did not work,
When I undefine the eattedit command and then activate the lisp as eattedit, it gives me "unknown command"
Leo,
That is probably because your command defined in your program is something other than eattedit. You could either defun your command as c:eattedit or add eattedit in the pgp file as an alias for your command.
But, if the CUI allows you to assign the double click to your command as mentioned, that may be a better approach.
Define your function(s) like this:
(defun c:editblock ( / ss e) (if (setq ss (ssget ":E:S:L" '((0 . "INSERT")))) (MyEditCommand (ssname ss 0)) ) ) (defun MyEditCommand (e)
;your code here (foreach x (vlax-invoke (vlax-ename->vla-object e) 'GetAttributes) (print (vla-get-TagString x)) ) (princ) )
Then edit CUI and change EATTEDIT command under DoubleClickAction with your function.
Thanks,
I see that this will work, but I am not sure if this is the way I should go as it will prevent the use of eattedit on other attribute blocks.
For the double click I was looking for something like: if this is "myblock" use my dialog box, if not "myblock" use eattedit.
@leothebuilder wrote:Thanks,
I see that this will work, but I am not sure if this is the way I should go as it will prevent the use of eattedit on other attribute blocks.
For the double click I was looking for something like: if this is "myblock" use my dialog box, if not "myblock" use eattedit.
Try something like this
(defun c:editblock ( / ss e o) (if (setq ss (ssget ":E:S:L" '((0 . "INSERT")))) (if (member (vlax-get (setq o (vlax-ename->vla-object (setq e (ssname ss 0)))) (if (vlax-property-available-p o 'EffectiveName) 'EffectiveName 'Name ) ) '("BlockName1" "BlockName2");<- Your block name list here ) (MyEditCommand e) (command "_eattedit" e) ) ) (princ) ) (defun MyEditCommand (e) ;your code here (foreach x (vlax-invoke (vlax-ename->vla-object e) 'GetAttributes) (print (vla-get-TagString x)) ) (princ) )