Autodesk ObjectARX
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
when I create three million AcDbText and add them to model space, in this process, AutoCAD show fatal error warning, then AutoCAD collapse.
why?, what can i do for this?
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
put your code here. It can be your bug.
#define QUESTION(b) (2*b)||(!(2*b)) © William Shakespeare
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
BOOL AddToModelSpace(AcDbEntity *pEnt)
{
if(pEnt == NULL)
return FALSE;
AcDbBlockTable *pTable = NULL;
Acad::ErrorStatus es = acdbHostApplicationServices()->workingDatabase()->
AcDbBlockTableRecord *pRecd = NULL;
es = pTable->getAt(ACDB_MODEL_SPACE, pRecd, AcDb::kForWrite);
es = pRecd->appendAcDbEntity(pEnt);
pTable->close();
pRecd->close();
pEnt->close();
return TRUE;
}
void cmdTest()
{
for(long m=0L; m<1500L; m++){
for(long j=0L; j<2000L; j++){
AcDbText *pText = new AcDbText(AcGePoint3d(m*100,j*100,0), _T("abc"));
pText->setColorIndex(1);
if(AddToModelSpace(pText)==FALSE){
if(pText != NULL)
delete pText;
}
}
}
}
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
your code works fine, BUT...
when it was done 86%, I got a message, that I have not enough memory to complete task.
So, I think that your computer is not good enough for this task such as my
PS: I didn't got a fatal error at all
AcApDocument * pDoc = acDocManager->mdiActiveDocument();
acDocManager->lockDocument(pDoc);
acedSetStatusBarProgressMeter(_T("Press ESC to abort: "), 0, 1500);
for(long m=0L; m<1500L; m++)
{
for(long j=0L; j<2000L; j++)
{
AcDbText *pText = new AcDbText(AcGePoint3d(m*100,j*100,0), _T("abc"));
pText->setColorIndex(1);
if(AddToModelSpace(pText)==FALSE)
{
if(pText != NULL)
delete pText;
}
}
acedSetStatusBarProgressMeterPos( m );
if(acad_abortCycle(_T("\nINFO: aborted...")) == 1)
break;
}
acedRestoreStatusBar();
acDocManager->unlockDocument(pDoc);
int acad_abortCycle(const ACHAR * abortString)
{
int res = 0;
CWinApp *app = acedGetAcadWinApp();
CWnd *wnd = app->GetMainWnd ();
MSG msg;
while (:: PeekMessage (&msg, wnd->m_hWnd, 0, 0, PM_NOREMOVE))
{
if (!app->PumpMessage())
{
:: PostQuitMessage(0);
break;
}
}
LONG lIdle = 0;
while (app->OnIdle (lIdle++));
res = acedUsrBrk();
if(res == 1 && abortString != NULL) acutPrintf(abortString);
return res;
}
#define QUESTION(b) (2*b)||(!(2*b)) © William Shakespeare
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
How much capacity in your computer memory?
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
2GB.
But free memory, that can be used is little more then 1.2GB (Windows, antivirus, e.t.c eat 800MB)
#define QUESTION(b) (2*b)||(!(2*b)) © William Shakespeare
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
try to turn off UNDO-recording, that will save a lot of memory as AutoCAD does not need to save every single add-task.
_UNDO _AUTO _OFF
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
when it was done 59%, I got a fatal error message .
if I stop at 58%, then all AcDbText are created in model space, But if click "ZOOM" or "REGEN" in command line, AutoCAD show fatal error and collapse. It looks like refresh graphics display make it.
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
did you test this in pure autocad? if no, try to unload everything additional (arx-files, lisp and so on) and leave just pure acad, like after installation. I didn't get fatal error. It was a messagebox with Ok|Cancel buttons for aborting the task. So, the problem can be in other arx file
, if it has, db reactor, for example.
And what about Alfred's advice? It will reduce the memory usage.
PS: try to do the same with, for example, points or lines (to check is this text bug or just lack of memory)
PS: if it was a pure autocad, may be it's time to reinstall it ![]()
#define QUESTION(b) (2*b)||(!(2*b)) © William Shakespeare
Re: Generate large amounts of AcDbText, then AutoCAD show fatal error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
in pure autocad, it outputs more AcDbText, but cmmand "zoom" and "regen" still lead to error or enough memory .
turn off UNDO-recording, not solve the problem.
points or lines has no problem.
It looks like lack of memory, I'm not sure.


