I was wondering about that and have not had time to test but setting it pick first selection then sending the command will work.
I was unsure about the 3 clicks but just guessing was sending the command without a active pickset and was getting a prompt to select an entity.
You are so right! The 3 clicks are as a result of sending the command without a active pickset and thereby getting a prompt to select an entity. I tried using the 'L' for last pickset in the eattedit command, but I didn't like what it was doing, it seemed to be malfunctioning in the context it was being used, always retaining the id of last picked object no matter what.
I strive for perfection, so ideally, I really don't want those 3 clicks, as I am sure it would eventually become a nuisance for the end user...
I just implemented your solution, and it worked! I am truly grateful for the help. I do have a question though: the macro command
seems to be configured fro blocks; how do I configure it for attribute blocks? I already tried doing this:
but when I test the double click on an attribute block (not one that show show my form), the block properties editor pops up instead of the attributes editor.
The double click action for an attribute block is different from the double click action for a block.
You can see these two actions using the CUI dialog as seen in the attachment.
To customize the double click for an attribute block, here are some changes to the code snippet that I posted earlier
1) Check for "dca.Name.Equals("Attribute Block"))" instead of "dca.Name.Equals("Block"))"
2) Change the double click macro to "^C^C_mybedit" instead of "$M=$(if,$(and,$(>,$(getvar,blockeditlock),0)),^C^
3) Change the "SendStringToExecute" inside the "MyBedit" command to send the "eattedit" command if it not a block reference that you are interested in.
Please let me know if you have any issues in getting this to work.
Wow! That worked wonders! Thanks a million!
However, even after implementation, I'm still having 3 clicks for attribute blocks other than those being edited by my form. So I'm guessing the ed.SetImpliedSelection(ids) called before sendStringToExecute still is empty; if I double click on an attribute block not being edited by my form, the AutoCAD prompt says "select a block: " and then I have to click on the block once more in order for the eattedit editor to be displayed.
Any ideas on how to get that implied selection set to work so I don't have to click three times?
Thanks again for all the help.
I could reproduce the same behavior. It seems that AutoCAD was clearing the pickfirst selection before the eattedit command was executed.
Using "CommandFlags.UsePickSet | CommandFlags.Redraw" for the "mybedit" command resolves the issue.
Thanks to my colleague, Viru for suggesting this fix.
Worked like a charm! Now I can successfully double-click on an attribute block, and either display my form, or go straight to AutoCAD's eattedit command. The combined command flags successfully resolved the triple clicks issue as well. I am truly grateful for all the help accorded me in the successful resolution of this problem.
Thanks Balaji, thanks Jeff, thanks Viru, thanks Autodesk NET forum!
Would you ask me about the program disposal.
Würden Sie das Programm mir zu verfügung stellen.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!