Hi there
I've made a function in a thread that move an entity, but the drawing is
refreshed only when i move the mouse or type on the keyboard, apparently
screen is freezed if i dont use it, so here is my question :
How can i redraw the workspace in Arx, i've used acedRedraw but dont seem to
work the way i need
here is my code :
DWORD WINAPI ThreadFunc( LPVOID lpParam )
{
::Sleep(iTime);
int x,y;
x = 0;
y = 0;
while(hThread != NULL)
{
int es;
AcGePoint3d startPt(x, y, 0.0);
AcGePoint3d endPt(x+10, y+10, 0.0);
AcDbLine *pLine = new AcDbLine(startPt, endPt);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite);
pBlockTable->close();
AcDbObjectId lineId;
pBlockTableRecord->appendAcDbEntity(lineId, pLine);
pBlockTableRecord->close();
pLine->close();
::Sleep(iTime);
AcDbObject *lineObj;
es = acdbOpenObject(lineObj, lineId,
AcDb::kForWrite, Adesk::kFalse);
if (es == Acad::eOk)
{
lineObj->erase();
lineObj->close();
}
acedRedraw(NULL, 1);
x = x+1;
y = y+1;
}
return 0;
}
I know i could just move the line, but actually it is just a test, just that
the entity dont refresh if i dont move the mouse