yfy2003 发表于 2003-11-22 14:13:00

[请问]我这样做为什么不行?

本帖最后由 作者 于 2003-11-23 14:01:54 编辑

if(kkkk==1)AcDb2dPolyline *pline=new AcDb2dPolyline(AcDb::k2dFitCurvePoly,pt,0.0,Adesk::kTrue,bl1,bl1);
if(kkkk==2)AcDb2dPolyline *pline=new AcDb2dPolyline(AcDb::k2dQuadSplinePoly,pt,0.0,Adesk::kFalse,bl1,bl1);
if(kkkk==3)AcDb2dPolyline *pline=new AcDb2dPolyline(AcDb::k2dCubicSplinePoly,pt,0.0,Adesk::kFalse,bl1,bl1);
    ..........

    pline->setElevation(zvalue);
    if(gc2==0.0)pline->setColorIndex(3);
        AcDbBlockTable *pBlockTable;
    acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);
    AcDbBlockTableRecord *pBlockTableRecord;
    pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);
    pBlockTable->close();
    AcDbObjectId plineObjId;
    pBlockTableRecord->appendAcDbEntity(plineObjId,pline);
    pBlockTableRecord->close();
    pline->setLayer(layer_tc);
        pline->setLinetype(layer_xx);
    pline->close();

yfy2003 发表于 2003-11-23 16:13:00

我的目的是:根据kkkk判断,如果为1、2、3.......,分别为曲线拟合、二次B样条拟合、三次B样条拟合。如果分别编写程序,编译可以通过,如上代码合并在一起,编译不能通过。帮帮忙!分析一下原因,并告诉我正确的方法。
页: [1]
查看完整版本: [请问]我这样做为什么不行?