找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 363|回复: 0

[求助]:帮忙看一下,下面代码错在哪里?

[复制链接]
发表于 2003-3-15 19:03:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
//本程序意图让操作者选定一个实体,接着判断实体类型,若是非AcDb3dSolid,设置为黄色,并点亮后恢复
若是AcDb3dSolid,设置为红色,整体点亮后恢复。
然后打开GS为2的第一个面,并点亮此面,最后想法向拉伸此面60个单位。

构建编译时出现错误为:
cdcd.cpp
f:\cdcd\cdcd.cpp(76) : error C2664: 'extrudeFaces' : cannot convert parameter 1 from 'class AcDbSubentId *' to 'const class AcArray<class AcDbSubentId *,class AcArrayMemCopyReallocator<class AcDbSubentId *> > &'
        Reason: cannot convert from 'class AcDbSubentId *' to 'const class AcArray<class AcDbSubentId *,class AcArrayMemCopyReallocator<class AcDbSubentId *> >'
        No constructor could take the source type, or constructor overload resolution was ambiguous
Error executing cl.exe.

CDCD.ARX - 1 error(s), 0 warning(s)
我对此不是很了解
cyb恳请大家帮忙解决,最好有具体的修正后的代码.
非常感谢!

void
cybobj()
{
    ads_name en;
    ads_point pt;
    if (acedEntSel("\n选取一实体: ", en,pt) != RTNORM)
    {
        acutPrintf("\n没有选取");
        return;
    }
            AcDbObjectId eId;
            acdbGetObjectId(eId, en);
        AcDbEntity *pEnt;
        acdbOpenAcDbEntity(pEnt, eId, AcDb::kForWrite);
    if (pEnt->isKindOf(AcDb3dSolid::desc())) {
            pEnt->close();
        AcDb3dSolid *box;
            acdbOpenObject(box, eId, AcDb::kForWrite);
        box->setColorIndex(1);
        box->highlight();
        pressEnterToContinue();
        box->unhighlight();
        AcGePoint3d pickpnt;
            AcGeMatrix3d xform;
            int numIds;
            AcDbFullSubentPath *subentIds;
        box->getSubentPathsAtGsMarker(AcDb::kFaceSubentType,
      2, pickpnt, xform, numIds, subentIds);
        box->highlight(subentIds[0]);//显亮此面
        pressEnterToContinue();//回车键继续
        box->unhighlight(subentIds[0]);//不显亮
        box->extrudeFaces(&subentIds[0].subentId(),60,0);
        //想沿法向拉伸此面60,--------此行出现错误。(第一个参数类型不对)
        box->close();
    acutPrintf("\n所选是三维实体");
        }
        else {
                pEnt->setColorIndex(2);
                pEnt->highlight();
                pressEnterToContinue();
                pEnt->unhighlight();
                pEnt->close();
        acutPrintf("\n所选不是三维实体");
    }
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-9-20 20:27 , Processed in 0.187451 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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