Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Double Click Action on specific dynamic block only

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
JCprog
550 Views, 5 Replies

Double Click Action on specific dynamic block only

Hello Everyone Smiley Happy

I'm trying to customize a partial cuix to double click action on a specific block only. Whereas when double clicked this dynamic block will show "Attribute Editor" and not the Enhanced Editor. Tried ^C^C_attedit which works but will also trigger on other blocks.

Found this in a blog but doesn't work. Please help!

 

^C^C(if (= (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) "blk01") (command "_attedit")(command "_ddatte" ))

 "blk01" is the name of the block.

 

Thanks in advance! Smiley Happy

 

5 REPLIES 5
Message 2 of 6
Shneuph
in reply to: JCprog

Dynamic block names become ambiguous (not the actual term I can't remember right now) once any dynamic property is changed.

 

Try getting the effective name w/ vlisp...  You will have to load it if it is not already loaded in each drawing with the function (vl-load-com).

 

^C^C(if (= (vla-get-effectivename (vlax-ename->vla-object (ssname (ssget "P") 0))) "blk01")(command "_attedit")(command "_ddatte" ))

Message 3 of 6
JCprog
in reply to: Shneuph

Hello Shneuph,
Thanks for the reply, this didn't work even with the function loaded.
Message 4 of 6
Shneuph
in reply to: JCprog

I just tested this and got it to work with a couple of my blocks.  This does issue different commands based on if I picked the correct dynamic block or not:

 

^C^C(if (= (vla-get-effectivename (vlax-ename->vla-object (ssname (ssget "P") 0))) "DETAIL CALLOUT")(command "_attedit")(command "line" ))

 

If I double-click the "DETAIL CALLOUT" block it runs _attedit and if I double-clock a different dynamic block it starts the line command.

 

Keep in mind that the block name you are specifying in ""'s is case sensitive so you may want to use "BLK01" and the following:

 

^C^C(if (= (strcase (vla-get-effectivename (vlax-ename->vla-object (ssname (ssget "P") 0)))) "BLK01")(command "_attedit")(command "_ddatte" ))

Message 5 of 6
JCprog
in reply to: Shneuph

Hello Shneuph,

That works perfect! Very much appreciate your help Smiley Very Happy

Message 6 of 6
JCprog
in reply to: Shneuph

Hello Shneuph,
You've helped me with this before which led me to ask if I could get the same effect on two blocks?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost