重载函数时报错
//创建坐标标注AcDbObjectId CDimensionUtil::AddDimOrdinate(Adesk::Boolean xAxis, AcGePoint3d &ptStart,const AcGePoint3d &ptEnd,const TCHAR *dimText,AcDbObjectId dimStyle)
{
AcDbOrdinateDimension *pDim = new AcDbOrdinateDimension(xAxis,ptStart,ptEnd,dimText,dimStyle);
return CDwgDatabaseUtil::PostToModelSpace(pDim);
}
//重载函数,创建坐标xy标注
AcDbObjectIdArray CDimensionUtil::AddDimOrdinate(const AcGePoint3d &ptDef,const AcGePoint3d &ptTextX,const AcGePoint3d &ptTextY)
{
AcDbObjectId dimId;
AcDbObjectIdArray dimIds;
dimId = AddDimOrdinate(Adesk::kTrue,ptDef,ptTextX); //编译时报错none of the 3 overloads could convert all the argument types
dimIds.append(dimId);
dimId = AddDimOrdinate(Adesk::kFalse,ptDef,ptTextY);//编译时报错none of the 3 overloads could convert all the argument types
dimIds.append(dimId);
return dimIds;
}
CDimensionUtil::AddDimOrdinate 53 可能是参数不对
dimId = AddDimOrdinate(Adesk::kTrue,ptDef,ptTextX,dimText,dimStyle); 应该是刚学吧,上面提示的意思就是没有3个参数的重载,估计是抄代码时,没有注意到缺省参数
页:
[1]