- 积分
- 25214
- 明经币
- 个
- 注册时间
- 2003-6-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2011-6-10 14:47:27
|
显示全部楼层
本帖最后由 sieben 于 2011-6-10 14:55 编辑
public void DealEntity(Entity entity, Point3d ptStart, Point3d ptEnd, Point3d targetPt, Document doc)
{
Database db = doc.Database;
if (entity is Hatch)
{
DBObjectCollection explodedEntity = new DBObjectCollection();
Hatch hatch = (Hatch)entity;
if (!hatch.IsSolidFill)
{
entity.Explode(explodedEntity);
if (explodedEntity != null && explodedEntity.Count > 0)
{
foreach (Entity explodedEnt in explodedEntity)
{
DealEntity(explodedEnt, ptStart, ptEnd, targetPt, doc);
}
}
else
{
CopyEntity(entity, ptStart, targetPt, doc);
}
}
else
{
CopyEntity(entity, ptStart, targetPt, doc);
}
}
else if (entity is Curve)
{
TrimCurve(entity, ptStart, ptEnd, targetPt, db);
}
else if (entity is DBText || entity is MText || entity is DBPoint || entity is Solid)
{
CopyEntity(entity, ptStart, targetPt, doc);
}
else
{
DBObjectCollection explodedEntity = new DBObjectCollection();
entity.Explode(explodedEntity);
if (explodedEntity != null && explodedEntity.Count > 0)
{
foreach (Entity explodedEnt in explodedEntity)
{
DealEntity(explodedEnt, ptStart, ptEnd, targetPt, doc);
}
}
else
{
CopyEntity(entity, ptStart, targetPt, doc);
}
}
}
这个函数这样调整一下会不会好些?
|
|