PDA

View Full Version : ACAD: GetPoint is driving me nuts



stigma
02-10-2006, 05:40 PM
I'm starting with ACAD VBA, and made a small proggram to get images from a web server (map server) and place them in my drawing.

I'm having some probnlems with the GetPoint function, It isn't working as expected and sends me a nice error message "Error in method GetPoint in object IAcadUtility2" :bug:

Here's the code:


Dim basePntX as Variant

basePntX = ThisDrawing.Utility.GetPoint(, "Select lower left corner")
Me.txtX = basePntX(0)
Me.txtY = basePntX(1)


Curiously, if I Debug the error and re-run that GetPoint line, It works as expected. :motz2:

What I'm doing wrong ?? :doh:

PS: If needed I can send the complete code by e.mail

Tommy
02-11-2006, 02:34 PM
Hi stigma,
you have to hide the form before doing a getpoint. The revised code below should fix your problem :)


Dim basePntX As Variant
Me.hide
basePntX = ThisDrawing.Utility.GetPoint(, "Select lower left corner")
Me.txtX = basePntX(0)
Me.txtY = basePntX(1)
Me.Show

stigma
02-11-2006, 05:59 PM
Hey ! Thanks a lot !

:banghead: My forehead thanks you too