NX版本:12.0
VS版本:2017
功能:通过二次开发实现批量在程序中进行插入边界
逻辑:使用UF函数进行插入
主要运用C#语言,本次主要使用UFun类型进行设置,若使用c#类型,需要将每个程序类型单独编写函数,这样可以批量操作,有利于开发人员的开发效率。
public static void Add_Bound(Tag tag_oper,List<Tag> tags_Curve,double yl)
{
UFCambnd.BoundaryData boundaryData = new BoundaryData();
boundaryData.matrix = new double[9] { workPart.Views.WorkView.Matrix.Xx, workPart.Views.WorkView.Matrix.Xy, workPart.Views.WorkView.Matrix.Xz, workPart.Views.WorkView.Matrix.Yx, workPart.Views.WorkView.Matrix.Yy, workPart.Views.WorkView.Matrix.Yz, workPart.Views.WorkView.Matrix.Zx, workPart.Views.WorkView.Matrix.Zy, workPart.Views.WorkView.Matrix.Zz };
boundaryData.plane_type = 0;
boundaryData.boundary_type = 0;
UFCambnd.AppData appData = new AppData();
appData.stock = yl;
appData.has_stock = 1;
List<UFCambnd.AppData> appDatas = new List<AppData> { };
foreach (Tag tag in tags_Curve)
{
appDatas.Add(appData);
}
theUfSession.Cambnd.AppendBndFromCurve(tag_oper,CamGeomType.CamTrim, tags_Curve.Count, tags_Curve.ToArray(),ref boundaryData, appDatas.ToArray());
}