Beispiel #1
0
        /// <summary>
        /// 取得ToolSpeed
        /// </summary>
        /// <param name="singleOper"></param>
        /// <returns></returns>
        public static string AskOperToolSpeed(NXOpen.CAM.Operation singleOper)
        {
            string OperToolSpeed = "";

            //double maxSpindleSpeed;
            try
            {
                NXOpen.CAM.CAMObject[] params1 = new NXOpen.CAM.CAMObject[1];
                params1[0] = singleOper;
                NXOpen.CAM.ObjectsFeedsBuilder objectsFeedsBuilder1;
                objectsFeedsBuilder1 = workPart.CAMSetup.CreateFeedsBuilder(params1);
                string OutPutMode = objectsFeedsBuilder1.FeedsBuilder.SpindleModeBuilder.Value.ToString();
                if (OutPutMode == "0")
                {
                    OperToolSpeed = "S:" + objectsFeedsBuilder1.FeedsBuilder.SpindleRpmBuilder.Value.ToString();
                }
                else if (OutPutMode == "1" || OutPutMode == "2")
                {
                    OperToolSpeed = "V:" + objectsFeedsBuilder1.FeedsBuilder.SurfaceSpeedBuilder.Value.ToString();
                    //JOperation jOper = JOperationFactory.CreateJOperation(singleOper);
                    //maxSpindleSpeed = jOper.GetMaximunSpindleSpeed();
                }
                return(OperToolSpeed);
            }
            catch (System.Exception ex)
            {
                return(OperToolSpeed);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 取得ToolSpeed
        /// </summary>
        /// <param name="singleOper"></param>
        /// <returns></returns>
        public static string AskOperToolSpeed(NXOpen.CAM.Operation singleOper)
        {
            string OperToolSpeed = "";

            try
            {
                NXOpen.CAM.CAMObject[] params1 = new NXOpen.CAM.CAMObject[1];
                params1[0] = singleOper;
                NXOpen.CAM.ObjectsFeedsBuilder objectsFeedsBuilder1;
                objectsFeedsBuilder1 = workPart.CAMSetup.CreateFeedsBuilder(params1);
                string OutPutMode = objectsFeedsBuilder1.FeedsBuilder.SpindleModeBuilder.Value.ToString();
                //CaxLog.ShowListingWindow(objectsFeedsBuilder1.FeedsBuilder.SpindleModeBuilder.Value.ToString());
                if (OutPutMode == "0")
                {
                    OperToolSpeed = objectsFeedsBuilder1.FeedsBuilder.SpindleRpmBuilder.Value.ToString();
                }
                else
                {
                    OperToolSpeed = objectsFeedsBuilder1.FeedsBuilder.SurfaceSpeedBuilder.Value.ToString();
                }
                //OperToolSpeed = objectsFeedsBuilder1.FeedsBuilder.SurfaceSpeedBuilder.Value.ToString(); CaxLog.ShowListingWindow(OperToolSpeed);
                //string aa = objectsFeedsBuilder1.FeedsBuilder.SpindleRpmBuilder.Value.ToString(); CaxLog.ShowListingWindow(aa); CaxLog.ShowListingWindow("--");
                return(OperToolSpeed);
            }
            catch (System.Exception ex)
            {
                return(OperToolSpeed);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 輸出Post
 /// </summary>
 /// <param name="OperObject">程式物件</param>
 /// <param name="PostName">後處理器名稱</param>
 /// <param name="OutputPath">輸出路徑</param>
 public static bool CreatePost(NXOpen.CAM.CAMObject OperObject, string PostName, string OutputPath)
 {
     try
     {
         NXOpen.CAM.CAMObject[] objects1 = new NXOpen.CAM.CAMObject[1];
         objects1[0] = OperObject;
         workPart.CAMSetup.Postprocess(objects1, PostName, OutputPath, NXOpen.CAM.CAMSetup.OutputUnits.PostDefined);
     }
     catch (System.Exception ex)
     {
         return(false);
     }
     return(true);
 }
Beispiel #4
0
        /// <summary>
        /// 取得ToolSpeed
        /// </summary>
        /// <param name="singleOper"></param>
        /// <returns></returns>
        public static string AskOperToolSpeed(NXOpen.CAM.Operation singleOper)
        {
            string OperToolSpeed = "";

            try
            {
                NXOpen.CAM.CAMObject[] params1 = new NXOpen.CAM.CAMObject[1];
                params1[0] = singleOper;
                NXOpen.CAM.ObjectsFeedsBuilder objectsFeedsBuilder1;
                objectsFeedsBuilder1 = workPart.CAMSetup.CreateFeedsBuilder(params1);
                return(OperToolSpeed = objectsFeedsBuilder1.FeedsBuilder.SpindleRpmBuilder.Value.ToString());
            }
            catch (System.Exception ex)
            {
                return(OperToolSpeed);
            }
        }
Beispiel #5
0
        private int GetWCSNumber()
        {
            Tag tagMCS;

            ufs.Param.AskParamDefiner(Operation.Tag, UFConstants.UF_PARAM_MCS, out tagMCS);
            NXOpen.CAM.CAMObject[] CAMObj = new NXOpen.CAM.CAMObject[1];
            CAMObj[0] = Operation;


            NXOpen.CAM.TurnOrientGeomBuilder turnOrientGeomBuilder
                = NxSession.Part.CAMSetup.CAMGroupCollection.CreateTurnOrientGeomBuilder(CAMObj[0]);

            int x = turnOrientGeomBuilder.FixtureOffsetBuilder.Value;

            turnOrientGeomBuilder.Destroy();

            return(x);
        }
Beispiel #6
0
        /// <summary>
        /// 取得Operation的刀具進給
        /// </summary>
        /// <param name="singleOper"></param>
        /// <returns></returns>
        public static string AskOperToolFeed(NXOpen.CAM.Operation singleOper)
        {
            string OperToolFeed = "";

            try
            {
                NXOpen.CAM.CAMObject[] params1 = new NXOpen.CAM.CAMObject[1];
                params1[0] = singleOper;
                NXOpen.CAM.ObjectsFeedsBuilder objectsFeedsBuilder1;
                objectsFeedsBuilder1 = workPart.CAMSetup.CreateFeedsBuilder(params1);
                OperToolFeed         = objectsFeedsBuilder1.FeedsBuilder.FeedCutBuilder.Value.ToString();
                //CaxLog.ShowListingWindow(OperToolFeed);
                //OperToolFeed = (Convert.ToDouble(AskOperCuttingLength(singleOper)) / Convert.ToDouble(AskOperCuttingTime(singleOper))).ToString();
                return(OperToolFeed);
            }
            catch (System.Exception ex)
            {
                return(OperToolFeed);
            }
        }
Beispiel #7
0
 /// <summary>
 /// 輸出Post
 /// </summary>
 /// <param name="OperObject">程式物件</param>
 /// <param name="PostName">後處理器名稱</param>
 /// <param name="OutputPath">輸出路徑</param>
 public static bool CreatePost(NXOpen.CAM.CAMObject OperObject, string PostName, string OutputPath)
 {
     try
     {
         NXOpen.CAM.CAMObject[] objects1 = new NXOpen.CAM.CAMObject[1];
         objects1[0] = OperObject;
         workPart.CAMSetup.Postprocess(objects1, PostName, OutputPath, NXOpen.CAM.CAMSetup.OutputUnits.PostDefined);
     }
     //catch (NXOpen.NXException NXex)
     //{
     //    MessageBox.Show(NXex.ToString());
     //    if (NXex.ErrorCode == 11)
     //    {
     //        return true;
     //    }
     //}
     catch (System.Exception ex)
     {
         return(false);
     }
     return(true);
 }