PDA

View Full Version : Set Focus To The Drawing Area After Click



Coolmo
2009-10-01, 12:44 PM
What's the code to set focus to the drawing area of AutoCAD after a button click event? After I click a button (or an image) from my form, I always have to click into AutoCAD's drawing area first before I can continue with my PromptPointOptions, etc. I did a search from this Forum and it came up with "Sorry, no matches..."

I'm sure this is a one-liner code snipit. Any suggestions?

n8wex
2009-10-01, 03:23 PM
What's the code to set focus to the drawing area of AutoCAD after a button click event? After I click a button (or an image) from my form, I always have to click into AutoCAD's drawing area first before I can continue with my PromptPointOptions, etc. I did a search from this Forum and it came up with "Sorry, no matches..."

I'm sure this is a one-liner code snipit. Any suggestions?

1liner is:
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView();

Coolmo
2009-10-01, 03:37 PM
1liner is:
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView();

I found something like this yesterday and it didn't work. Is there a reference that I'm missing? The error states that "Internal..." is not a part of "Autodesk.AutoCAD..."

I'm writing this DLL for AutoCAD 2007. Does this make a difference?

Thanks for the quick reply BTW

RobertB
2009-10-01, 04:08 PM
I'm writing this DLL for AutoCAD 2007. Does this make a difference?It could. The .NET API was pretty limited in those early releases of the API. 2008 was probably the first really useful version of the API.

n8wex
2009-10-02, 02:04 PM
I'm writing this DLL for AutoCAD 2007. Does this make a difference?


Autodesk.AutoCAD.Internal.Utils
Try it in the latest version
I just started testing my app in 2007 and 2009 and certain things dont work so I guess its going to be a 2010 min app for this.

Coolmo
2009-10-02, 08:22 PM
Autodesk.AutoCAD.Internal.Utils
Try it in the latest version
I just started testing my app in 2007 and 2009 and certain things dont work so I guess its going to be a 2010 min app for this.

That being said, is there a way in earlier versions to do it? I can't believe there wouldn't be a way to simply set focus to the drawing area. Seems like it would be a 1 liner in any language or version of a language.

n8wex
2009-10-03, 05:14 AM
Not sure mate just learning the ropes myself. Good luck.