private BodyInfo GetDischargeFace(CartesianCoordinateSystem csys, Component ct)
        {
            List <string> err  = new List <string>();
            Part          host = work.GetHostWorkpiece();

            if (host == null)
            {
                return(null);
            }
            Body workBody           = host.Bodies.ToArray()[0];
            Body eleBody            = elePart.Bodies.ToArray()[0];
            Body comBody            = AssmbliesUtils.GetNXObjectOfOcc(ct.Tag, eleBody.Tag) as Body;
            ComputeDischargeFace cp = new ComputeDischargeFace(comBody, workBody, work.Info.Matr, csys);

            return(cp.GetBodyInfoForInterference(false, out err));
        }
 public void Show()
 {
     if (user.UserSucceed && user.Jurisd.GetElectrodeJurisd())
     {
         Session.UndoMarkId markId;
         markId = Session.GetSession().SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "基准台");
         if (!WorkModel.IsWork(workPart))
         {
             NXOpen.UI.GetUI().NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "请设置WORK为工作部件");
             return;
         }
         WorkModel work      = new WorkModel(workPart);
         Matrix4   mat       = (work.Info).Matr;
         Part      workpiece = work.GetHostWorkpiece();
         if (workpiece == null)
         {
             NXOpen.UI.GetUI().NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "无法找到主件");
             return;
         }
         List <Body> headBodys = SelectObject();
         if (headBodys == null || headBodys.Count == 0)
         {
             return;
         }
         ElectrodeCreateCondition condition = new ElectrodeCreateCondition(expAndMatr, headBodys, work, workpiece);
         if (expAndMatr.Matr.AnalyeBackOffFace())
         {
             int ok = NXOpen.UI.GetUI().NXMessageBox.Show("错误", NXMessageBox.DialogType.Question, "电极有倒扣!");
             if (ok != 1)
             {
                 return;
             }
         }
         ParentAssmblieInfo parent = new ParentAssmblieInfo(work.Info.MoldInfo, user.CreatorUser);
         ShowForm(condition, parent, work);
     }
 }
 public InterferenceElectrodeBuilder(Component workComp, WorkModel work)
 {
     this.work     = work;
     this.hostPart = work.GetHostWorkpiece();
     this.workComp = workComp;
 }