.NET

.NET

Reply
Valued Mentor
jeff
Posts: 338
Registered: ‎05-12-2009
Message 21 of 29 (358 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-06-2012 11:10 PM in reply to: Balaji_Ram

Thanks,

 

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 can also find your answers @ TheSwamp
Valued Contributor
mindofcat
Posts: 55
Registered: ‎05-14-2012
Message 22 of 29 (346 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-07-2012 09:40 AM in reply to: jeff

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...

Valued Contributor
mindofcat
Posts: 55
Registered: ‎05-14-2012
Message 23 of 29 (345 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-07-2012 10:36 AM in reply to: Balaji_Ram

Balaji,

 

I just implemented your solution, and it worked! I am truly grateful for the help. I do have a question though: the macro command

 

"$M=$(if,$(and,$(>,$(getvar,blockeditlock),0)),^C^C_properties,^C^C_mybedit)";

 

seems to be configured fro blocks; how do I configure it for attribute blocks? I already tried doing this:

 

"$M=$(if,$(and,$(>,$(getvar,blockeditlock),0)),^C^C_eattedit,^C^C_mybedit)";

 

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.

 

Any ideas?

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 24 of 29 (320 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-10-2012 06:32 AM in reply to: mindofcat

Hello,

 

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^C_properties,^C^C_mybedit)";"

 

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.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Contributor
mindofcat
Posts: 55
Registered: ‎05-14-2012
Message 25 of 29 (314 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-10-2012 11:03 AM in reply to: Balaji_Ram

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.

 

Cat

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 26 of 29 (303 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-11-2012 01:11 AM in reply to: mindofcat

Hello,

 

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.

 

 

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Contributor
mindofcat
Posts: 55
Registered: ‎05-14-2012
Message 27 of 29 (294 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-11-2012 11:12 AM in reply to: Balaji_Ram

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!

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 28 of 29 (279 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-12-2012 04:28 AM in reply to: mindofcat

I am glad you have resolved the issue.

Good luck.



Balaji
Developer Technical Services
Autodesk Developer Network

Active Contributor
cadheinz
Posts: 37
Registered: ‎02-14-2008
Message 29 of 29 (276 Views)

Re: How to capture double click event in AutoCAD using VB.NET

12-12-2012 05:10 AM in reply to: jeff

Hello mindofcat

Would you ask me about the program disposal.
Thank you

 

Hallo mindofcat

Würden Sie das Programm mir zu verfügung stellen.
Danke

 

DH
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.