创建圆台并进行边倒圆

来源:互联网 发布:淘宝大股东是谁 编辑:程序博客网 时间:2024/04/28 14:52
public static int Main(string[] args) 
    { 
        int retValue = 0; 
        try 
        { 
            theProgram = new Program(); 


            //TODO: Add your application code here 
            Session theSession = Session.GetSession(); 
            Part worPart = theSession.Parts.Work; 
            Part displyPart = theSession.Parts.Display; 


            NXOpen.Features.ConeBuilder ConeBuilder1 = worPart.Features.CreateConeBuilder(null);//创建圆台 
            ConeBuilder1.BaseDiameter.RightHandSide = "50"; 
            ConeBuilder1.TopDiameter.RightHandSide = "30"; 
            ConeBuilder1.Height.RightHandSide = "50"; 
            NXOpen.Features.Feature feature = ConeBuilder1.CommitFeature();//特征类来接收 


            NXOpen.Features.BodyFeature bodyFeature = (NXOpen.Features.BodyFeature) feature;//将特征转换为BODY特征 
            Body[] bodyBodies= bodyFeature.GetBodies();//创建一个BODY数组来接收body 


            int count = bodyBodies.Length;//取数组长度 
            ScCollector scCollector1 = worPart.ScCollectors.CreateCollector();//创建特征收集器 
            SelectionIntentRule[] rules1 = new SelectionIntentRule[count];//创建体的边的规则父类对象 
            for (int i = 0; i < count; i++) 
            { 
                rules1[i ] = worPart.ScRuleFactory.CreateRuleEdgeBody(bodyBodies[ i]);//将体的边规则放到父类对象数组中 
            } 
            scCollector1.ReplaceRules(rules1, false);//规则收集器 
            NXOpen.Features.EdgeBlendBuilder edgeBlendBuilder1 = worPart.Features.CreateEdgeBlendBuilder(null); 
            int csIndex1 = edgeBlendBuilder1.AddChainset(scCollector1, "10");//创建体的边倒圆 
            NXOpen.Features.Feature feature1= edgeBlendBuilder1.CommitFeature();//委托 
            theProgram.Dispose(); 
        }
原创粉丝点击