I have a modeless dialog, in the dialog, there is a button, in the button click event function , I created a polyline sucessfuly, but the entity do not display well. Please look the picture I have uploaded.
the entity look darker than the normal. in the fuction, I have called fuctions like
"actrTransactionManager->flushGraphics();
acedUpdateDisplay();"
" acedGetAcadDwgView()->SetFocus();
acedGetAcadDwgView()->SendMessage(WM_MOUSEMOVE); "
but it dosen't work.
the only way that makes it work is to call the "regen" command. but, usually, the dwg is very large. and the 'regen' command takes too much time.
Solved! Go to Solution.
Solved by Alexander.Rivilis. Go to Solution.
In order to other's can check this behaviour you have to post sample code and clarify AutoCAD version.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
sorry, too busy these days. i have made an example, and the ARX version is AutoCAD 2008.
and I have found something.
void CModelessDlg::OnDraw()
{
acDocManager->lockDocument(curDoc(), AcAp::kWrite, NULL, NULL, TRUE);
ads_point pt;
pt[X] = pt[Y] = pt[Z] = 0.0;
AcDbObjectId idEnt = DrawCircle(pt,4,NULL,NULL,_T("new"));// here , if the last param is NULL(not _T("new")). then the new entity displays well.
ZoomEnt(idEnt,4);
actrTransactionManager->flushGraphics();
acedUpdateDisplay();
acDocManager->unlockDocument(curDoc());
}
Replace function InsureLayerExist with:
AcDbObjectId InsureLayerExist(const TCHAR* szLayer) { if (NULL == szLayer || 0 == _tcscmp(szLayer,_T("")) ) return AcDbObjectId::kNull; AcDbLayerTable *pLayerTbl; AcDbObjectId idLayer = acdbSymUtil()->layerZeroId(curDoc()->database()); curDoc()->database()->getSymbolTable(pLayerTbl, AcDb::kForRead); if ( Acad::eOk != pLayerTbl->getAt(szLayer,idLayer)) { AcDbLayerTableRecord *pLayerTblRcd = new AcDbLayerTableRecord; pLayerTblRcd->setName(szLayer); if (pLayerTbl->upgradeOpen() == Acad::eOk) { pLayerTbl->add(idLayer,pLayerTblRcd); pLayerTbl->downgradeOpen(); } pLayerTblRcd->close(); pLayerTbl->close(); applyCurDwgLayerTableChanges(); // Main difference with your code } else { pLayerTbl->close(); } return idLayer; }
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
thanks a lot, it works as expected. it is really kind of you to help me a lot.