Example #1
0
 public virtual int IndexOfObject(AnyObject obj, NSRange inSortedRange, NSBinarySearchingOptions options, NSComparator usingComparator)
 {
     return(default(int));
 }
Example #2
0
 public static bool IsValidJSONObject(AnyObject obj)
 {
     return(default(bool));
 }
Example #3
0
 public virtual void RemoveObjectForKey(AnyObject aKey)
 {
 }
Example #4
0
 public virtual void SetObject(AnyObject obj, AnyObject forKey, int cost)
 {
 }
Example #5
0
 public static NSData DataWithJSONObject(AnyObject obj, NSJSONWritingOptions options, NSErrorPointer error)
 {
     return(default(NSData));
 }
        private void ReadCoord_Click(object sender, EventArgs e)
        {
            progressBar.Value = 0;
            if (datatable.Columns.Count < 1)
            {
                InitDataTable();
            }
            this.WindowState = FormWindowState.Minimized;
            RepeatNum        = 0;
            Array.Clear(GetRepeatRef, 0, GetRepeatRef.Length);
            ReadType = 2;
            Selection SelectArc = null;

            CATIA_Class.GetSelect(CatDocument, ref SelectArc, this);
            if (SelectArc == null || SelectArc.Count2 == 0)
            {
                this.WindowState   = FormWindowState.Normal;
                this.StartPosition = FormStartPosition.CenterScreen;
                this.TopMost       = true;
                return;
            }
            int ERR = 0;

            progressBar.Maximum = SelectArc.Count2;
            progressBar.Step    = 1;
            for (int i = 1; i < SelectArc.Count2 + 1; i++)
            {
                object[]           PointCoord      = new object[] { -99, -99, -99, -99, -99, -99 };
                HybridShapeFactory PartHyb         = (HybridShapeFactory)PartID.HybridShapeFactory;
                SPAWorkbench       TheSPAWorkbench = null;
                TheSPAWorkbench = (SPAWorkbench)CatDocument.GetWorkbench("SPAWorkbench"); // Default Get Coordxyz From Word
                Reference referenceObject;
                String    ObjType = SelectArc.Item(i).Type;
                Boolean   LeafProductProcessed;
                string    TName = string.Empty;
                switch (ObjType)
                {
                case "HybridShape":
                {
                    referenceObject = SelectArc.Item(i).Reference; //!=null? SelectArc.Item(i).Reference: Temp;
                    TName           = referenceObject.get_Name();  //读取选择的曲面名称
                    break;
                }

                case "Shape":
                {
                    string  Name    = string.Empty;
                    Shape   shape   = (Shape)SelectArc.Item(i).Value;
                    Product product = (Product)SelectArc.Item(i).LeafProduct;
                    TName = product.get_PartNumber();                                     //读取选择的曲面名称
                    String   RefStr     = product.GetMasterShapeRepresentationPathName(); //获取零件路径地址
                    string[] RefStrArry = RefStr.Split('\\');
                    if (RefStrArry.Length > 1)
                    {
                        RefStr = RefStrArry.Last();
                    }
                    Part RefPart = ((PartDocument)CatApplication.Documents.Item(RefStr)).Part;        //通过总文档将当前零件转换成PartDocumet
                    TName = RefPart.get_Name();
                    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    if (getJTCoord.Checked)
                    {
                        try
                        {
                            //Product PCompoments = (Product)product.Parent;
                            //TName = PCompoments.get_Name();
                            //referenceObject = PCompoments.CreateReferenceFromName(TName);
                            //Measurable TheMeasurable1 = TheSPAWorkbench.GetMeasurable(referenceObject);
                        }
                        catch (Exception)
                        {
                            throw;
                        }
                    }
                    //String RefStr1 = productPre.GetMasterShapeRepresentationPathName(); //获取零件路径地址
                    //string[] RefStrArry1 = RefStr1.Split('\\');
                    //if (RefStrArry.Length > 1)
                    //{
                    //    RefStr1 = RefStrArry1.Last();
                    //}
                    //string tname= productPre.get_PartNumber();
                    //referenceObject= productPre.CreateReferenceFromName(TName);
                    //Product RefProduct = ((ProductDocument)CatApplication.Documents.Item("70918")).Product;//通过总文档将当前零件转换成PartDocumet
                    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    try
                    {
                        //RefPart = (Part)RefPart.Parent;
                        referenceObject = RefPart.CreateReferenceFromObject(shape);
                    }
                    catch (Exception)
                    {
                        MessageBox.Show("请确认当前是否打开了多个窗口,软件识别的零件和您选择的零件不在一个集合!");
                        return;
                    }
                    break;
                }

                default:
                {
                    AnyObject Feature = (AnyObject)SelectArc.Item(i).Value;
                    try
                    {
                        String Name = string.Empty;
                        Shape  GE   = (Shape)SelectArc.Item(i).Value;
                        //Name = GE.get_Name();
                        //Pad Spad = (Pad)GE.GetItem("Face1");
                        //Name = Spad.get_Name();
                        referenceObject = PartID.CreateReferenceFromObject(Feature);
                        PartHyb.AddNewPointCenter(referenceObject);
                    }
                    catch (Exception)
                    {
                        ERR += 1;
                        var LeafProduct = SelectArc.Item(i).LeafProduct;
                        LeafProductProcessed = true;
                        if (LeafProduct.get_Name() == "InvalidLeafProduct")
                        {
                            LeafProductProcessed = false;
                        }
                        if (LeafProductProcessed)
                        {
                            String         ShapeName = Feature.get_Name();
                            VisPropertySet VPS       = SelectArc.VisProperties;
                            VPS.SetVisibleColor(255, 0, 0, 0);
                            continue;
                        }
                        else
                        {
                            String         ShapeName = Feature.get_Name();
                            VisPropertySet VPS       = SelectArc.VisProperties;
                            VPS.SetVisibleColor(255, 0, 0, 0);
                            continue;
                        }
                    }
                }
                break;
                }
                Measurable TheMeasurable = TheSPAWorkbench.GetMeasurable(referenceObject);
                try
                {
                    TheMeasurable.GetPoint(PointCoord); //读取选择的曲面坐标
                }
                catch (Exception)
                {
                    try
                    {
                        TheMeasurable.GetCOG(PointCoord);
                    }
                    catch (Exception)
                    {
                        ERR += 1;
                    }
                }
                if (!KeepName.Checked)
                {
                    TName = "Rx_" + (datatable.Rows.Count + 1);
                }
                WriteObjectToDataGrid(TName, PointCoord, referenceObject, IgRepeat.Checked); //记录数据到DataGridView
                try
                {
                    this.Update(); //Updata Draw
                }
                catch (Exception)
                {
                }
                progressBar.PerformStep();
            }
            SetDataGrid();
            if (ERR > 0)
            {
                MessageBox.Show("共计:" + ERR + "个点创建新参考点失败!");
            }
            if (RepeatCheck.Checked)
            {
                CheckRepeat(SelectArc);
            }
            DataGrid.AllowUserToAddRows = false;
        }
Example #7
0
 public virtual void SetObject([Optional] AnyObject value, string forKey)
 {
 }
Example #8
0
 public static NSData ArchivedDataWithRootObject(AnyObject rootObject)
 {
     return(default(NSData));
 }
Example #9
0
 public static bool ArchiveRootObject(AnyObject rootObject, string toFile)
 {
     return(default(bool));
 }
 public virtual void ShowViewController(UIViewController vc, [Unwrapped] AnyObject sender)
 {
 }
Example #11
0
 public virtual void EncodeObject([Optional] AnyObject objv, string forKey)
 {
 }
Example #12
0
 public virtual bool ContainsObject(AnyObject anObject)
 {
     return(default(bool));
 }
Example #13
0
 public virtual string DescriptionWithLocale([Optional] AnyObject locale, int indent)
 {
     return(default(string));
 }
Example #14
0
 public virtual AnyObject[] ArrayByAddingObject(AnyObject anObject)
 {
     return(default(AnyObject[]));
 }
Example #15
0
 public virtual void InsertObject(AnyObject anObject, int atIndex)
 {
 }
Example #16
0
 public virtual void SetUserInfoObject([Optional] AnyObject objectOrNil, string forKey)
 {
 }
Example #17
0
 public virtual bool SendAction(Selector action, [Optional] AnyObject to, [Optional] AnyObject from, [Optional] UIEvent forEvent)
 {
     return(default(bool));
 }
Example #18
0
 public virtual void RemoveObject(AnyObject anObject)
 {
 }
 public UIAccessibilityElement(AnyObject accessibilityContainer)
 {
 }
Example #20
0
 public virtual void RemoveObject(AnyObject anObject, NSRange inRange)
 {
 }
Example #21
0
 public virtual void SetObject(AnyObject obj, AnyObject forKey)
 {
 }
Example #22
0
 public virtual void RemoveObjectIdenticalTo(AnyObject anObject)
 {
 }
Example #23
0
 public UIAlertView([Optional] string title, [Optional] string message, [Optional] AnyObject @delegate, [Optional] string cancelButtonTitle)
 {
 }
Example #24
0
 public virtual void RemoveObjectIdenticalTo(AnyObject anObject, NSRange inRange)
 {
 }
Example #25
0
 public static int WriteJSONObject(AnyObject obj, NSOutputStream toStream, NSJSONWritingOptions options, NSErrorPointer error)
 {
     return(default(int));
 }
Example #26
0
 public virtual void ReplaceObjectAtIndex(int index, AnyObject withObject)
 {
 }
Example #27
0
 public virtual void SetObject(AnyObject anObject, AnyObject forKey)
 {
 }
Example #28
0
 public virtual void AddObject(AnyObject anObject)
 {
 }
Example #29
0
 public virtual AnyObject ObjectForKey(AnyObject aKey)
 {
     return(default(AnyObject));
 }
Example #30
0
 public NSArray(AnyObject @object)
 {
 }