Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm absolutely new to this, trying to learn.
I'm getting the above error when trying to create new command calling the createLine() function from the Object ARX help webpage. What am I doing wrong here?
This is how I'm creating new commands.
void initApp()
{
//Register a command with AutoCAD command mechanics.
acedRegCmds->addCommand(_T("HelloWorld_Commands"),
_T("Hello"),
_T("SayHello"),
ACRX_CMD_TRANSPARENT,
helloworld);
acedRegCmds->addCommand(_T("HelloWorld_Commands"),
_T("FAPLCreateLine"),
_T("FAPLCreateLine"),
ACRX_CMD_TRANSPARENT,
createLine);
}This is the createLine( ) function from the help webpage.
AcDbObjectId createLine()
//void createLine()
{
AcGePoint3d startPt(4.0, 2.0, 0.0);
AcGePoint3d endPt(10.0, 7.0, 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();
return lineId;
}Thanks in advance for any help!
Solved! Go to Solution.

