Esempio n. 1
0
 public static void RemoveOverrule()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), UserDrawOverrule.TheOverrule);
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), DCadDrawEntityOverrule.TheOverrule);
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(DBText)), DCadDrawEntityOverrule.TheOverrule);
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(MText)), DCadDrawEntityOverrule.TheOverrule);
 }
Esempio n. 2
0
 private static void End()
 {
     foreach (Overrule o in m_overrules)
     {
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(Circle)), o);
     }
     Overrule.Overruling = false;
     Application.DocumentManager.MdiActiveDocument.Editor.Regen();
 }
Esempio n. 3
0
 //关闭夹点规则重定义
 public static void closeGripRule()
 {
     if (UserGripOverrule.TheOverrule != null)
     {
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), UserGripOverrule.TheOverrule);
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(DBText)), UserGripOverrule.TheOverrule);
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(MText)), UserGripOverrule.TheOverrule);
     }
 }
 public void HideIcon()
 {
     if (ProductsDrawableOverrule.ProductsDrawableOverruleInstance != null)
     {
         UserConfigFile.SetValue("mpProductInsert", "ShowIcon", false.ToString(), true);
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(Entity)), ProductsDrawableOverrule.Instance());
         ProductsDrawableOverrule.ProductsDrawableOverruleInstance = null;
         Application.DocumentManager.MdiActiveDocument.Editor.Regen();
     }
 }
Esempio n. 5
0
 private static void IsolinesOff()
 {
     ContextMenuIsoline.Detach();
     if (_overruleIsolineDraw != null)
     {
         Overrule.RemoveOverrule(RXClass.GetClass(typeof(Curve)), _overruleIsolineDraw);
         _overruleIsolineDraw = null;
     }
     if (_overruleIsolineTrans != null)
     {
         Overrule.RemoveOverrule(RXClass.GetClass(typeof(Curve)), _overruleIsolineTrans);
         _overruleIsolineTrans = null;
     }
 }
 public static void togglegaslabeloverrule()
 {
     if (_GasPolylineLabelOverrule == null)
     {
         _GasPolylineLabelOverrule = new GasPolylineLabel();
         Overrule.AddOverrule(RXObject.GetClass(typeof(Polyline)), _GasPolylineLabelOverrule, false);
         Overrule.Overruling = true;
     }
     else
     {
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(Polyline)), _GasPolylineLabelOverrule);
         _GasPolylineLabelOverrule.Dispose();
         _GasPolylineLabelOverrule = null;
     }
     Application.DocumentManager.MdiActiveDocument.Editor.Regen();
 }
 public static void togglepolydiroverrule()
 {
     if (_polylineDirection == null)
     {
         _polylineDirection = new PolylineDirection();
         Overrule.AddOverrule(RXObject.GetClass(typeof(Polyline)), _polylineDirection, false);
         Overrule.Overruling = true;
     }
     else
     {
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(Polyline)), _polylineDirection);
         _polylineDirection.Dispose();
         _polylineDirection = null;
     }
     Application.DocumentManager.MdiActiveDocument.Editor.Regen();
 }
Esempio n. 8
0
 public void Run()
 {
     if (_overrule == null)
     {
         _overrule = new PViewCOGOPointDO();
         Overrule.AddOverrule
             (RXClass.GetClass(typeof(CogoPoint)), _overrule, false);
     }
     else
     {
         Overrule.RemoveOverrule
             (RXClass.GetClass(typeof(CogoPoint)), _overrule);
         _overrule = null;
     }
     Application.DocumentManager.
     MdiActiveDocument.Editor.Regen();
 }
Esempio n. 9
0
 // 关闭高亮规则重定义
 public static void closeHightLightRule()
 {
     try
     {
         if (hightLightRule != null)
         {
             Overrule.RemoveOverrule(RXObject.GetClass(typeof(Entity)), hightLightRule);
             hightLightRule = null;
             //Overrule.Overruling = false;
         }
         //刷新屏幕,直线被更新为门
         //PublicMethod.Instance.Editor.Regen();
     }
     catch (System.Exception ex)
     {
         PublicMethod.Instance.Editor.WriteMessageWithReturn(ex);
     }
 }
Esempio n. 10
0
 public static void TestOverrideToDifferentPlane()
 {
     if (overrule == null)
     {
         overrule = new PlaneOverrule();
         Overrule.AddOverrule(RXObject.GetClass(typeof(Entity)), overrule, false);
     }
     else
     {
         foreach (DBObject obj in overrule.copyCollection)
         {
             obj.Dispose();
         }
         Overrule.RemoveOverrule(RXObject.GetClass(typeof(Entity)), overrule);
         overrule.Dispose();
         overrule = null;
     }
     Overrule.Overruling = !Overrule.Overruling;
     Application.DocumentManager.MdiActiveDocument.Editor.Regen();
 }
Esempio n. 11
0
 /// <inheritdoc />
 public void Terminate()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), GroundLineGripPointOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), GroundLineOsnapOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), GroundLineObjectOverrule.Instance());
 }
 /// <inheritdoc />
 public void Terminate()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), WaterProofingGripPointOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), WaterProofingOsnapOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), WaterProofingObjectOverrule.Instance());
 }
 /// <inheritdoc/>
 public void Terminate()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), LevelMarkGripPointOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), LevelMarkOsnapOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), LevelMarkObjectOverrule.Instance());
 }
Esempio n. 14
0
 public void Terminate()
 {
     Overrule.RemoveOverrule(RXClass.GetClass(typeof(BlockReference)), this);
 }
Esempio n. 15
0
 /// <inheritdoc/>
 public void Terminate()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), NodalLeaderGripPointOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), NodalLeaderOsnapOverrule.Instance());
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(BlockReference)), NodalLeaderObjectOverrule.Instance());
 }
Esempio n. 16
0
 //重定义失效
 public static void OverruleEnd()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(Line)), LArrowDrawOverrule3.TheOverrule);
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(Line)), LArrowGripOverrule3.TheOverrule);
 }
        /// <summary>
        /// Добавляет подписи к полилиниям, которые созданы из CSV (названия файлов CSV)
        /// </summary>
        /// <param name="drawable"></param>
        /// <param name="wd"></param>
        /// <returns></returns>
        public override bool WorldDraw(Drawable drawable, WorldDraw wd)
        {
            // draw the base class
            bool ret = base.WorldDraw(drawable, wd);

            try
            {
                Polyline3d poly = drawable as Polyline3d;
                if (poly != null)
                {
                    //Проверить наличие XData
                    string xdata = Utils.GetCaptionFromXData(poly);
                    if (xdata != null)
                    {
                        //Добавить отображение подписи возле первой точки полилинии
                        //poly.DowngradeOpen();
                        //poly.Database
                        Point3d position = Point3d.Origin;


                        Database db = poly.Database;
                        if (db != null)
                        {
                            using (Transaction tr = db.TransactionManager.StartTransaction())
                            {
                                ObjectId[] verts = poly.Cast <ObjectId>().ToArray();

                                PolylineVertex3d vtStart = tr.GetObject(verts[0], OpenMode.ForRead) as PolylineVertex3d;
                                position = vtStart.Position;

                                tr.Commit();
                            }
                        }
                        else
                        {
                            try
                            {
                                position = poly.StartPoint;
                            }
                            catch (Autodesk.AutoCAD.Runtime.Exception ex)
                            {
                            }
                        }



                        Vector3d normal    = Vector3d.ZAxis;
                        Vector3d direction = Vector3d.XAxis;

                        wd.Geometry.Text(position, normal, direction, 5, 1, 0, xdata);
                    }
                }
            }
            catch (System.Exception ex)
            {
                CommonException(ex, "Ошибка PolylineCaptionOverrule");
                Overrule.RemoveOverrule(RXClass.GetClass(typeof(Polyline3d)), this);//снять Overrule если возникла ошибка
                ret = false;
            }

            // return the base
            return(ret);
            //return base.WorldDraw(drawable, wd);
        }