iCAx开思工具箱
标题:
求高手:为什么我的.net程序为什么不能延展body的面呢
[打印本页]
作者:
begtostudy
时间:
2008-7-23 19:36
标题:
求高手:为什么我的.net程序为什么不能延展body的面呢
下面的程序,我用单个曲面测试通过,但是用简单body比如block的一个面和边,却出现这样的错:
Target / Tool must contain only exterior edges。
程序如下
Face face = (Face)Session.GetSession().Parts.Work.FindObject("HANDLE R-2295");//为了方便,加了高亮测试
Edge edge = (Edge)Session.GetSession().Parts.Work.FindObject("HANDLE R-2095");
face.Highlight();
edge.Highlight();
TrimExtend feature = null;
TrimExtendBuilder theBuilder = Session.GetSession().Parts.Work.Features.CreateTrimExtendBuilder(feature);
theBuilder.ExtendNewFace = false;
theBuilder.Type = TrimExtendBuilder.CreationTypes.ByDistance;
theBuilder.ExtensionMethod = TrimExtendBuilder.ExtensionMethods.NaturalTangent;
Expression exp = theBuilder.TargetExtendDistance;
exp.RightHandSide = "10";
FaceDumbRule theRule = Session.GetSession().Parts.Work.ScRuleFactory.CreateRuleFaceDumb( new Face[] { face });
theBuilder.TargetCollector.ReplaceRules(new SelectionIntentRule[] { theRule },false);
EdgeDumbRule theRule2 = Session.GetSession().Parts.Work.ScRuleFactory.CreateRuleEdgeDumb(new Edge[] { edge });
theBuilder.TargetCollector.ReplaceRules(new SelectionIntentRule[] { theRule2 }, false );
//theBuilder.TargetReversed = true;
theBuilder.Commit();
face.Unhighlight();
edge.Unhighlight();
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3