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

new entity created from modeless dialog do not display well

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
693 Views, 4 Replies

new entity created from modeless dialog do not display well

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. 11.jpg

  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.

4 REPLIES 4
Message 2 of 5
Alexander.Rivilis
in reply to: Anonymous

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
Expert Elite Member

Message 3 of 5
Anonymous
in reply to: Alexander.Rivilis

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());

}

Message 4 of 5
Alexander.Rivilis
in reply to: Anonymous

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
Expert Elite Member

Message 5 of 5
Anonymous
in reply to: Alexander.Rivilis

thanks a lot, it works as expected. it is really kind of you to help me a lot.

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

Post to forums  

Autodesk Design & Make Report

”Boost