VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sendcommand randomly shows the dialog box

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
dennis
438 Views, 2 Replies

Sendcommand randomly shows the dialog box

My code looks similar to:

 

myform.hide

SendCommand "DWGPROPS" & vbCr

myform.show

 

The problem is it will only randomly show the Drawing Properties dialog box, which in and of itself is odd to me.  Seems it would either show always or never.  When it doesn't show, myform 'appears' to never close, though it may be that it is quick and I can't see it.  The Drawing Properties dialog then will show up...but only after I close myform completely.

 

Then sometimes, it works just as I want, giving the user the Drawing Properties dialog and letting them make changes, and then they hit OK and right back into myform.

 

Am I going to always have this problem, going in the wrong direction, or what?

 

THanks for any help.

2 REPLIES 2
Message 2 of 3
doglips
in reply to: dennis

If I remember right your vb code will process before it will run the Sendommand so it will do all of it's vb stuff first and then process the SendCommand

Message 3 of 3
dennis
in reply to: doglips

Here is what I have discovered and my "workaround".  "Yes" the VBA code will continue to run all code below the SendCommand.  Much how AutoCAD will accept keyboard entry and cue them up, the SendCommand works similarly.  So, as a workaround, I added to my code another command that would pick up where I needed it.  Then Sub that I am calling, I cue up two SendCommands, the first being a regular AutoCAD call to the Drawing Properties, then a second SendCommand call that re-enters my VBA code.  Following the two SendCommands, I exit the VBA routine.  It still will act funny when running it from the VBA Editor, but from AutoCAD it is consistent to the workflow I wanted.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost