Hello Everyone
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!
Solved! Go to Solution.
Solved by Shneuph. Go to Solution.
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" ))
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" ))