Ejemplo n.º 1
0
        public void HideTriangulate()
        {
            Triangulations      triangulation = new Triangulations();
            AC_Transactions     tr            = new AC_Transactions();
            PromptEntityOptions options       = new PromptEntityOptions("Pick a Line to Hide Triangulations");

            options.SetRejectMessage("not valid Object \n");
            options.AddAllowedClass(typeof(Line), true);
            PromptEntityResult sel = tr.AC_Doc.Editor.GetEntity(options);

            if (sel.Status == PromptStatus.OK)
            {
                triangulation.Hide((AC_Line)tr.openObjectErased(sel.ObjectId));
            }
        }
Ejemplo n.º 2
0
        public void HideAllTriangulate()
        {
            Triangulations  triangulation = new Triangulations();
            AC_Transactions tr            = new AC_Transactions();
            Transaction     trans         = tr.start_Transaction();

            tr.openBlockTables(OpenMode.ForRead, OpenMode.ForRead);
            foreach (ObjectId id in tr.AC_blockTableRecord)
            {
                try{
                    AC_Entity ent = (AC_Entity)tr.openObjectErased(id);
                    if (ent.BaseEntity is Line)
                    {
                        AC_Line      line = (AC_Line)ent;
                        ResultBuffer rb   = line.XData;
                        if (rb != null)
                        {
                            //FIND XDATA GUID
                            int    index = 0;
                            string guid  = null;
                            foreach (TypedValue tv in rb)
                            {
                                if (index == 3)
                                {
                                    guid = tv.Value.ToString();
                                }
                                index++;
                            }

                            if (guid != null)
                            {
                                triangulation.Hide(line);
                            }
                        }
                    }
                    tr.Dispose(trans);
                }
                catch
                {
                    tr.AC_Doc.Editor.WriteMessage("Skipped a not Entity Object");
                }
            }
        }
Ejemplo n.º 3
0
        public void HideAllTriangulate()
        {
            Triangulations triangulation = new Triangulations();
            AC_Transactions tr = new AC_Transactions();
            Transaction trans = tr.start_Transaction();
            tr.openBlockTables(OpenMode.ForRead, OpenMode.ForRead);
            foreach (ObjectId id in tr.AC_blockTableRecord)
            {
                try{
                    AC_Entity ent = (AC_Entity)tr.openObjectErased(id);
                    if (ent.BaseEntity is Line)
                    {
                        AC_Line line = (AC_Line)ent;
                        ResultBuffer rb = line.XData;
                        if (rb != null)
                        {
                            //FIND XDATA GUID
                            int index = 0;
                            string guid = null;
                            foreach (TypedValue tv in rb)
                            {
                                if (index == 3)
                                {
                                    guid = tv.Value.ToString();
                                }
                                index++;
                            }

                            if (guid != null)
                            {
                                triangulation.Hide(line);
                            }
                        }
                    }
                    tr.Dispose(trans);
                }
                catch
                {
                    tr.AC_Doc.Editor.WriteMessage("Skipped a not Entity Object");
                }
            }
        }
Ejemplo n.º 4
0
 public void HideTriangulate()
 {
     Triangulations triangulation = new Triangulations();
     AC_Transactions tr = new AC_Transactions();
     PromptEntityOptions options = new PromptEntityOptions("Pick a Line to Hide Triangulations");
     options.SetRejectMessage("not valid Object \n");
     options.AddAllowedClass(typeof(Line), true);
     PromptEntityResult sel = tr.AC_Doc.Editor.GetEntity(options);
     if (sel.Status == PromptStatus.OK)
     {
         triangulation.Hide((AC_Line)tr.openObjectErased(sel.ObjectId));
     }
 }