.NET

Reply
Active Contributor
raulpa
Posts: 49
Registered: ‎10-12-2006
Message 1 of 1 (660 Views)

GetAcadState.IsQuiescent appears to be stuck to False

660 Views, 0 Replies
10-22-2006 09:33 AM
It seems that I have a synchronization problem with the SendCommand in the example below. The two SendCommands are not executed until after the file has been saved. I tried waiting until the IsQuiescent state is True, but that never happens. Can somebody give me any ideas as to why the IsQuiescent state appears to be stuck to False? Is there another way to solve this synchronization problem with the SendCommand?

Thank you very much in advance for your help,

Raul


Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Imports System.IO

Public Class ClsTest

_
Public Sub Test()
Dim OutputPath As String = "c:\Test\dwg"
Dim ObjAcad As AcadApplication
Dim ThisDrawing As AcadDocument
Dim ZeroOrgin() As Double = {0, 0, 0}
Dim Obj As Acad3DSolid

Directory.Delete(OutputPath, True)
Directory.CreateDirectory(OutputPath)

ObjAcad = DirectCast(GetObject(, "AutoCAD.Application.17"), AcadApplication)
ObjAcad.Visible = True
ThisDrawing = ObjAcad.ActiveDocument

Obj = ThisDrawing.ModelSpace.AddBox(ZeroOrgin, 2, 4, 8)
ThisDrawing.SendCommand("VPOINT r 225 8 ")
ThisDrawing.SendCommand("SHADEMODE Realistic ")
' It appears that IsQuiescent is never True and as a result,
' this loop never exits. Any ideas why? Is there another way to
' know when the SendCommand is finished?
Do Until ObjAcad.GetAcadState.IsQuiescent = True
Loop
ThisDrawing.SaveAs(OutputPath & "\Test.dwg")

End Sub
End Class
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.