一、代码
ModelDoc2 swMode = swApp.NewPart();
ModelDoc2 Part = swApp.ActiveDoc;//激活ModelDoc2,激活需要上一层激活
//钣金使用
BaseFlangeFeatureData swFeatData = default(BaseFlangeFeatureData);
swFeatData = Part.FeatureManager.CreateDefinition((int)swFeatureNameID_e.swFmBaseFlange);
swFeatData.BendRadius = 0.012;
swFeatData.D1EndConditionDistance = 0.02;
swFeatData.D1EndConditionType = 1;
swFeatData.D1ReverseOffset = false;
swFeatData.D2EndConditionDistance = 0.01;
swFeatData.D2EndConditionType = 1;
swFeatData.D2ReverseOffset = false;
swFeatData.OffsetDirections = 1;
swFeatData.ReverseDirection = false;
swFeatData.ReverseThickness = false;
swFeatData.Thickness = Convert.ToDouble(name6[2]) / 1000;//改变钣金拉伸的厚度
Part.FeatureManager.CreateFeature(swFeatData);
Part.SelectionManager.EnableContourSelection = false;
二、效果展示