Jump to content
VincentG

VBA "GetPoint" freezes AutoCAD 2013 when debugging

Recommended Posts

VincentG

I'm running AutoCad Architecture 2013 on Win7 64bit. Installed VBA enabler for Acad2013 64bit version. When start the simple code below:

 

Sub Example_GetPoint()

Dim retPnt As Variant

retPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")

... ... ... ...

End Sub

 

It hangs up at "GetPoint". I can't switch to the AutoCAD window to select anything. The only way to get control back is to go to taskbar, right-click the AutoCAD icon and try to close it, then click cancel, I will get control back in VBA Editor. The same thing happens with "SelectOnSc​reen". But if I run this macro from Autocad directly, everything is fine.

 

Does anyone have same experience or any advice? Thanks a lot.

Share this post


Link to post
Share on other sites
lisp56

Hello,

 

same prob in 2011. Do not run the code from VBA-window !

Use ALT+F8 (run macro) in ACAD window, or use a user defined button.

 

Hope i can help you ..

 

greetings from Hamburg/Germany

Share this post


Link to post
Share on other sites
VincentG

Thanks a lot, lisp56. Your advice works like a charm.

Share this post


Link to post
Share on other sites
btraemoore

why are you using vba at all?? .net is far more superior. There is open source .net development software. #Develop.

Share this post


Link to post
Share on other sites
VincentG

We can start another thread to talk about using .net instead of vba, but in this case, we want to keep using vba because:

 

1. Over the years, we've got a lot of apps written in VBA.

2. It's easier just to change a few references in order for the old vba apps to run on a newer version of AutoCAD, than to modify the code to VB.net, or even C#.

3. Like Lisp, VBA is more "native" to AutoCAD, although it's losing this close relationship since Autodesk stopped packaging it with AutoCAD.

 

For new projects, we have no problem to choose far more superior .net languages. I've never used #Develop, though. Thanks for pointing it out. It looks quite similar to Visual Studio, I'll take a deeper look.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...