How can ACAD be invisible? I can see it!!

How can ACAD be invisible? I can see it!!

Anonymous
Not applicable
201 Views
2 Replies
Message 1 of 3

How can ACAD be invisible? I can see it!!

Anonymous
Not applicable
Like most of us who have been thrust into the world of Vb/VBA, I know enough to be dangerous. I have a program that will hopefully do a bunch of things but for now all it does is crash. If I apply a brake to the suspect area, and then step through the code it works fine. BUT when I take the brake out I get an error "AutoCAD's main window is invisible" here's the suspect code....
Private Sub Do_it()
'ThisDrawing.Application.Visible = True
With ThisDrawing.Utility 'This is where I carsh unless I step through it.
.InitializeUserInput 1
VarInspt = .GetPoint(, vbCr & "Select insertion point: ")
End With
ThisDrawing.ModelSpace.InsertBlock VarInspt, "C:\NEWGDOORPROG.DWG", 1, 1, 1, 0
End Sub

Any ideas??
PLEASE keep it simple so I can understand the answer.
THANKS!!
0 Likes
202 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Hi,

 

This message is displayed because you have a modal
dialog displayed. You need to hide it and then get access to AutoCAD's
screen

so that you can pick a point.

 

So just before you make a call for GetPoint do
something similar to the following:

UserForm1.Hide

 

Cheers,

Thilak

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Like
most of us who have been thrust into the world of Vb/VBA, I know enough to be
dangerous. I have a program that will hopefully do a bunch of things but for
now all it does is crash. If I apply a brake to the suspect area, and then
step through the code it works fine. BUT when I take the brake out I get an
error "AutoCAD's main window is invisible" here's the suspect code....

Private Sub Do_it()
'ThisDrawing.Application.Visible = True
With
ThisDrawing.Utility 'This is where I carsh unless I step through it.

    .InitializeUserInput 1

        VarInspt = .GetPoint(,
vbCr & "Select insertion point: ")
End With

ThisDrawing.ModelSpace.InsertBlock VarInspt, "C:\NEWGDOORPROG.DWG", 1, 1,
1, 0
End Sub

Any ideas??
PLEASE keep it simple so I can understand the answer.

THANKS!!

0 Likes
Message 3 of 3

Anonymous
Not applicable
Fantastic - It looks like that's what I needed. DUH!! It even makes sense now.

THANKS AGAIN!
0 Likes