AcDbObjectId Additional_Class::Draw_Line( AcGePoint3d stPoint, AcGePoint3d enPoint, CString LineType, double TypeScale ) { AcDbObjectId tempID, LtCenter, LtByLayer; Add_LineType(LineType); AcDbLine *pLineTemp = new AcDbLine(); pLineTemp->setLinetype(LineType); pLineTemp->setStartPoint(stPoint); pLineTemp->setEndPoint(enPoint); AcDbBlockTable *pBlockTable = NULL; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_BlockTable(pBlockTable, NREADMODE); AcDbBlockTableRecord *pBlockTableRecord = NULL; pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); //acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead); //this->Open_ModelTableRecord(pBlockTableRecord, pBlockTable, NWRITEMODE); AcDbObjectId TempLineID; pBlockTableRecord->appendAcDbEntity(TempLineID, pLineTemp); pLineTemp->close(); pBlockTable->close(); pBlockTableRecord->close(); return TempLineID; }