ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with acedRedraw()

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
254 Views, 0 Replies

Problem with acedRedraw()

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
0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report

”Boost