设置当前层
我用的是vs2010+cad2013,新建图层并设置为当前层,为什么不行呢? AcDbLayerTable *pLayer;acdbHostApplicationServices()->workingDatabase()->getLayerTable(pLayer,AcDb::kForWrite);
if(pLayer->has(AA))
{
pLayer->close();
return;
}
AcDbLayerTableRecord *pLayerRec=new AcDbLayerTableRecord;
pLayerRec->setName(AA);
AcDbObjectId layerTblRcdId;
pLayer->add(layerTblRcdId,pLayerRec);
acdbHostApplicationServices()->workingDatabase()->setClayer(layerTblRcdId);
pLayerRec->close();
pLayer->close();
应该行关闭图层指针,再设置图层
就是先pLayerRec->close();
pLayer->close();
再
acdbHostApplicationServices()->workingDatabase()->setClayer(layerTblRcdId);
你可以用Acad::ErrorStatus es = acdbHostApplicationServices()->workingDatabase()->setClayer(layerTblRcdId);
看看es就知道为什么不行了 谢谢指点。
页:
[1]