示例#1
0
        //------------------------------------------------------------------------------
        //Callback Name: filter_cb
        //------------------------------------------------------------------------------
        public int filter_cb(NXOpen.BlockStyler.UIBlock block, NXOpen.TaggedObject selectedObject)
        {
            Model.MoldInfoModel info = builder.Model.Asm.MoldInfo;

            if (this.selePart.GetSelectedObjects().Length != 0)
            {
                Part   part = (this.selePart.GetSelectedObjects()[0] as NXOpen.Assemblies.Component).Prototype as Part;
                string name = AttributeUtils.GetAttrForString(part, "PartType");
                if (name.Equals("Workpiece", StringComparison.CurrentCultureIgnoreCase))
                {
                    return(UFConstants.UF_UI_SEL_ACCEPT);
                }
                if (selectedObject is Face)
                {
                    Face seleFace = selectedObject as Face;
                    Part selePart = (seleFace.Prototype as Face).OwningPart as Part;

                    if (selePart.Tag != part.Tag)
                    {
                        return(UFConstants.UF_UI_SEL_REJECT);
                    }
                }
            }
            return(NXOpen.UF.UFConstants.UF_UI_SEL_ACCEPT);
        }
示例#2
0
 public EDMModel(string filePath, MoldInfoModel moldInfo)
 {
     this.MoldInfo = moldInfo;
     this.PartType = "EDM";
     GetAssembleName();
     this.WorkpieceDirectoryPath = filePath;
     this.WorkpiecePath          = filePath + this.AssembleName + ".prt";
 }
示例#3
0
        public AssembleModel(Part part)
        {
            this.part = part;
            MoldInfoModel info = new MoldInfoModel(part);

            this.moldAndWorkpieceNum = info.MoldNumber + "-" + info.WorkpieceNumber;
            GetAssembleInfo();
        }
示例#4
0
 public WorkModel(string filePath, MoldInfoModel moldInfo, int workNumber, Matrix4 matr)
 {
     this.MoldInfo   = moldInfo;
     this.WorkNumber = workNumber;
     this.WorkMatr   = matr;
     this.PartType   = "Work";
     GetAssembleName();
     this.WorkpieceDirectoryPath = filePath;
     this.WorkpiecePath          = filePath + this.AssembleName + ".prt";
 }
示例#5
0
 public WorkpieceModel(string filePath, Part part, MoldInfoModel moldInfo)
 {
     this.PartTag                = part;
     this.MoldInfo               = moldInfo;
     this.WorkpiecePath          = part.FullPath;
     this.WorkpieceDirectoryPath = Path.GetDirectoryName(WorkpiecePath) + "\\";
     this.PartType               = "Workpiece";
     this.filePath               = filePath;
     this.GetAssembleName();
 }
 public ElectrodeModel(string filePath, int workNum, ElectrodeInfo info, MoldInfoModel mold, Matrix4 mat, Point3d center)
 {
     this.PartType = "Electrode";
     this.EleInfo  = info;
     this.MoldInfo = mold;
     this.EleMatr  = mat;
     this.CenterPt = center;
     GetAssembleName();
     this.WorkpieceDirectoryPath = filePath;
     this.WorkpiecePath          = filePath + this.AssembleName + ".prt";
     this.WorkNumber             = workNum;
 }
示例#7
0
        //------------------------------------------------------------------------------
        //Callback Name: filter_cb
        //------------------------------------------------------------------------------
        public int filter_cb(NXOpen.BlockStyler.UIBlock block, NXOpen.TaggedObject selectedObject)
        {
            Model.MoldInfoModel info = new Model.MoldInfoModel();
            info.GetAttribute(asmPart);
            if (this.selePart.GetSelectedObjects().Length != 0)
            {
                Part part = (this.selePart.GetSelectedObjects()[0] as NXOpen.Assemblies.Component).Prototype as Part;
                if (!part.Name.Equals(info.MoldNumber + "-" + info.WorkpieceNumber + info.EditionNumber))
                {
                    return(UFConstants.UF_UI_SEL_REJECT);
                }
                if (selectedObject is Face)
                {
                    Face seleFace = selectedObject as Face;
                    Part selePart = (seleFace.Prototype as Face).OwningPart as Part;

                    if (selePart.Tag != part.Tag)
                    {
                        return(UFConstants.UF_UI_SEL_REJECT);
                    }
                }
            }
            return(NXOpen.UF.UFConstants.UF_UI_SEL_ACCEPT);
        }