- 积分
- 848
- 明经币
- 个
- 注册时间
- 2008-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 LDJ 于 2015-5-29 13:57 编辑
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
Entity entity = tr.GetObject(entityID, OpenMode.ForWrite) as Entity;
Entity entity2 = tr.GetObject(entityID2, OpenMode.ForWrite) as Entity;
DBObjectCollection curveSegments = new DBObjectCollection();
curveSegments.Add(entity);
DBObjectCollection regions = Region.CreateFromCurves(curveSegments);
DBObjectCollection curveSegments2 = new DBObjectCollection();
curveSegments2.Add(entity2);
DBObjectCollection regions2 = Region.CreateFromCurves(curveSegments2);
Region region = regions[0] as Region;
Region region1 = regions2[0] as Region;
region.BooleanOperation(BooleanOperationType.BoolSubtract, region1);
entity和entity2是2个闭合的polyline
相交
BooleanOperation前region 和region2面积都不是0
BooleanOperation后region 面积为0 region.BooleanOperation(BooleanOperationType.BoolSubtract, region1);有异常
测试环境是c#2010+autoccad2013
高手帮助看下。这个问题困扰我几天了
|
|