- 积分
- 154
- 明经币
- 个
- 注册时间
- 2003-5-19
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Compiling...
entity.cpp
C:\Program Files\ACAD2000\adsrx\sample\entity\entity.cpp(93) : error C2660: 'createNewGroup' : function does not take 3 parameters
一定要救我啊
我只有一天时间了
程序如下:AcDbObjectId createNewLine();
AcDbObjectId createNewCircle();
AcDbObjectId createNewLayer();
void createNewGroup();
Acad::ErrorStatus changeColor(AcDbObjectId,Adesk::UInt16);
AcDbObjectId
createNewLine()
{
AcGePoint3d startPoint(5.0,4.0,0.0);
AcGePoint3d endPoint(15.0,10.0,0.0);
AcDbLine *pLine=new AcDbLine(startPoint,endPoint);
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;
}
AcDbObjectId
createNewCircle()
{
AcGePoint3d center(10.0,7.0,0.0);
AcGeVector3d normal(0.0,0.0,1.0);
AcDbCircle *pCirc=new AcDbCircle(center,normal,4.5);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);
pBlockTable->close();
AcDbObjectId circleId;
pBlockTableRecord->appendAcDbEntity(circleId,pCirc);
pBlockTableRecord->close();
pCirc->close();
return circleId;
}
AcDbObjectId
createNewLayer()
{
AcDbLayerTable *pLayerTable;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pLayerTable,AcDb::kForWrite);
AcDbLayerTableRecord *pLayerTableRecord=new AcDbLayerTableRecord;
pLayerTableRecord->setName("MYNewLayer");
AcDbObjectId pLayerId;
pLayerTable->add(pLayerId,pLayerTableRecord);
pLayerTable->close();
pLayerTableRecord->close();
return pLayerId;
}
void
creatNewGroup(AcDbObjectIdArray & objIds,char *pGroupName,AcDbObjectId pLayerId)
{
AcDbGroup *pGroup=new AcDbGroup(pGroupName);
for(int i=0;i<objIds.length();i++){
pGroup->append(objIds);
}
AcDbDictionary *pGroupDict;
acdbHostApplicationServices()->workingDatabase()->getGroupDictionary(pGroupDict,AcDb::kForWrite);
AcDbObjectId pGroupId;
pGroupDict->setAt(pGroupName,pGroup,pGroupId);
pGroup->setLayer(pLayerId);
pGroupDict->close();
pGroup->close();
}
Acad::ErrorStatus
changeColor(AcDbObjectId entId,Adesk::UInt16 newColor)
{
AcDbEntity *pEntity;
acdbOpenObject(pEntity,entId,AcDb::kForWrite);
pEntity->setColorIndex(newColor);
pEntity->close();
return Acad::eOk;
}
void
runIt()
{
AcDbObjectId newLayerId=createNewLayer();
AcDbObjectIdArray idArray;
idArray.append(createNewLine());
idArray.append(createNewCircle());
changeColor(idArray.first(),1);
changeColor(idArray.last(),3);
createNewGroup(& idArray,"MyNewGroup",newLayerId);
}
void
initApp()
{
acedRegCmds->addCommand("ASDK_MAKE_ENTITIES","MSDK_MakeNewEnts","MakeNewEnts",ACRX_CMD_MODAL,runIt);
}
void
unloadApp()
{
acedRegCmds->removeGroup("ASDK_MAKE_ENTITIES");
}
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg,void* appId)
{
switch (msg){
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(appId);
acrxDynamicLinker->registerAppMDIAware(appId);
initApp();
break;
case AcRx::kUnloadAppMsg:
unloadApp();
}
return AcRx::kRetOK;
} |
|