天气与日历 切换到窄版

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

objectarx之画多段线和画直线

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
void CCommonFuntion::DrowPloyLine(AcGePoint2dArray& inputpoints)
{
if (inputpoints.length() < 3)
return;
AcDbPolyline *pPolyLine = new AcDbPolyline(3);
for (int i = 0; i < inputpoints.length(); i++)
{

pPolyLine->addVertexAt(i, inputpoints.at(i), 0, 1.0, 1.0);
}

AcDbBlockTable *pBlockTable = NULL;
acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRocord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRocord, AcDb::kForWrite);
AcDbObjectId lineId;
pBlockTableRocord->appendAcDbEntity(lineId, pPolyLine);
pBlockTable->close();
pBlockTableRocord->close();
pPolyLine->close();
}

AcDbObjectIdArray CCommonFuntion::DrowLine(AcGePoint3dArray& inputpoints)
{
AcDbObjectIdArray ids;
if (inputpoints.length() < 2)
return ids;
for (int i=0;i<inputpoints.length();i++)
{

if (i==inputpoints.length()-1)
{
AcDbLine *pPline = new AcDbLine(inputpoints[i], inputpoints[0]);
AcDbObjectId ID=CCommonFuntion::PostToModelSpace(pPline);
if (pPline)
pPline->close();
ids.append(ID);
}
else
{
AcDbLine *pPline = new AcDbLine(inputpoints[i], inputpoints[i + 1]);
AcDbObjectId ID = CCommonFuntion::PostToModelSpace(pPline);
if (pPline)
pPline->close();
ids.append(ID);
}

}
return ids;
}

 

 

 

 

objectarx之画多段线和画直线
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-1 13:35 , Processed in 0.140754 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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