天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 41|回复: 0

AcDb3dSolid::createLoftedSolid()

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
[code]        static void MyGroupMyCommand() {
                 Put your command code here
AcArray< AcDbEntity *> crossCurvesArr;
AcArray< AcDbEntity *> guideCuvesArr;
AcDbEntity *pPathEntity = NULL;
AcDbLoftOptions loftOption;

                double y = 0.0;
                for (int i = 0; i < 300; i++)
                {
y = i * 1.0;
AcDbLine *pLine1 = new AcDbLine(AcGePoint3d(0.0, y, 0.0), AcGePoint3d(0.0, y, 0.15));
AcDbLine *pLine2 = new AcDbLine(AcGePoint3d(0.0, y, 0.15), AcGePoint3d(0.03, y, 0.30));
AcDbLine *pLine3 = new AcDbLine(AcGePoint3d(0.03, y, 0.30), AcGePoint3d(0.18, y, 0.30));
AcDbLine *pLine4 = new AcDbLine(AcGePoint3d(0.18, y, 0.30), AcGePoint3d(0.18, y, 0.0));
AcDbLine *pLine5 = new AcDbLine(AcGePoint3d(0.18, y, 0.0), AcGePoint3d(0.0, y, 0.0));

AcDbVoidPtrArray curveArray1;
curveArray1.append(pLine1);
curveArray1.append(pLine2);
curveArray1.append(pLine3);
curveArray1.append(pLine4);
curveArray1.append(pLine5);

AcDbVoidPtrArray regArr1;
Acad::ErrorStatus aEs = AcDbRegion::createFromCurves(curveArray1, regArr1);
                        delete pLine1;
                        delete pLine2;
                        delete pLine3;
                        delete pLine4;
                        delete pLine5;
                        if (aEs !=Acad::eOk)
                                return;

AcDbRegion *pRegion1 = (AcDbRegion *)regArr1.at(0);
crossCurvesArr.append(pRegion1);
                }



AcDb3dSolid *pLoftedSolid = new AcDb3dSolid;

Acad::ErrorStatus aEs = pLoftedSolid->createLoftedSolid(crossCurvesArr, guideCuvesArr, pPathEntity, loftOption);


                if (aEs !=Acad::eOk) {
                        delete pLoftedSolid;
                        return;
                }

AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()
                        ->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite);
pBlockTable->close();

AcDbObjectId objectId;
pBlockTableRecord->appendAcDbEntity(objectId, pLoftedSolid);
pBlockTableRecord->close();
pLoftedSolid->close();
        }[/code]

 

 

 

 

AcDb3dSolid::createLoftedSolid()
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

GMT+8, 2024-11-1 09:20 , Processed in 0.175860 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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