明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 406|回复: 3

重载函数时报错

[复制链接]
发表于 2023-8-11 07:11 | 显示全部楼层 |阅读模式
//创建坐标标注
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;

}

发表于 2023-8-18 16:47 来自手机 | 显示全部楼层
CDimensionUtil::AddDimOrdinate 53
发表于 2023-8-21 09:48 | 显示全部楼层
可能是参数不对
dimId = AddDimOrdinate(Adesk::kTrue,ptDef,ptTextX,dimText,dimStyle);
发表于 2023-8-23 15:40 | 显示全部楼层
应该是刚学吧,上面提示的意思就是没有3个参数的重载,估计是抄代码时,没有注意到缺省参数
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-17 11:22 , Processed in 0.163007 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表