Exemple #1
0
 public static void AddOverrule()
 {
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), UserDrawOverrule.TheOverrule, false);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), DCadDrawEntityOverrule.TheOverrule, false);
     Overrule.AddOverrule(RXObject.GetClass(typeof(DBText)), DCadDrawEntityOverrule.TheOverrule, true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(MText)), DCadDrawEntityOverrule.TheOverrule, true);
 }
Exemple #2
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);
 }
Exemple #3
0
 //开启夹点规则重定义
 public static void openGripRule()
 {
     if (UserGripOverrule.TheOverrule != null)
     {
         Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), UserGripOverrule.TheOverrule, false);
         Overrule.AddOverrule(RXObject.GetClass(typeof(DBText)), UserGripOverrule.TheOverrule, true);
         Overrule.AddOverrule(RXObject.GetClass(typeof(MText)), UserGripOverrule.TheOverrule, true);
     }
 }
Exemple #4
0
        public void ovcmd3()
        {
            var gripRule = new DonutGripRule();

            gripRule.SetXDataFilter(AppName);
            Overrule.AddOverrule(RXClass.GetClass(typeof(Circle)), gripRule, false);

            Overrule.Overruling = true;
        }
Exemple #5
0
        public void ovcmd4()
        {
            var transRule = new DonutTransformRule();

            transRule.SetXDataFilter(AppName);
            Overrule.AddOverrule(RXClass.GetClass(typeof(Circle)), transRule, false);

            Overrule.Overruling = true;
        }
Exemple #6
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);
     }
 }
Exemple #7
0
        public void ovcmd2()
        {
            var drawRule = new DonutDrawRule();

            drawRule.SetXDataFilter(AppName);
            Overrule.AddOverrule(RXClass.GetClass(typeof(Circle)), drawRule, false);

            Overrule.Overruling = true;
        }
Exemple #8
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();
 }
Exemple #9
0
 public static void ImplementOverrule()
 {
     if (myOverrule == null)
     {
         myOverrule = new KeepStraightOverrule();
         Overrule.AddOverrule(RXClass.GetClass(typeof(AttributeReference)), myOverrule, false);
     }
     Overrule.Overruling = true;
 }
 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();
     }
 }
Exemple #11
0
 public static void ShowIcon()
 {
     if (MpProductsDrawableOverrule.MpProductsDrawableOverruleInstance == null)
     {
         UserConfigFile.SetValue(UserConfigFile.ConfigFileZone.Settings, "mpProductInsert", "ShowIcon",
                                 true.ToString(), true);
         Overrule.AddOverrule(RXObject.GetClass(typeof(Entity)), MpProductsDrawableOverrule.Instance(), true);
         Overrule.Overruling = true;
         AcApp.DocumentManager.MdiActiveDocument.Editor.Regen();
     }
 }
Exemple #12
0
 void IExtensionApplication.Initialize()
 {
     try
     {
         //Запустить PolylineCaptionOverrule
         polylineCaptionOverrule = new PolylineCaptionOverrule();
         Overrule.AddOverrule(RXClass.GetClass(typeof(Polyline3d)), polylineCaptionOverrule, false);
     }
     catch (System.Exception ex)
     {
         CommonException(ex, "Ошибка при инициализации плагина для Civil 3d");
     }
 }
Exemple #13
0
 private static void IsolinesOn()
 {
     ContextMenuIsoline.Attach();
     if (_overruleIsolineDraw == null)
     {
         _overruleIsolineDraw = new IsolineDrawableOverrule();
         Overrule.AddOverrule(RXClass.GetClass(typeof(Curve)), _overruleIsolineDraw, false);
     }
     if (_overruleIsolineTrans == null)
     {
         _overruleIsolineTrans = new IsolineTransformOverrule();
         Overrule.AddOverrule(RXClass.GetClass(typeof(Curve)), _overruleIsolineTrans, false);
     }
 }
Exemple #14
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();
 }
Exemple #16
0
        public void jscmd2()
        {
            var drawRule = new WallDrawRule();

            drawRule.SetXDataFilter(AppName);
            drawRule.SetCustomFilter();
            Overrule.AddOverrule(RXObject.GetClass(typeof(Line)), drawRule, false);

            var gripRule = new WallGripRule();

            gripRule.SetXDataFilter(AppName);
            gripRule.SetCustomFilter();
            Overrule.AddOverrule(RXObject.GetClass(typeof(Line)), gripRule, false);

            Overrule.Overruling = true;
        }
 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();
 }
Exemple #18
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();
 }
Exemple #19
0
 public static void ToggleOverrule()
 {
     // Initialize Overrule if first time run
     if (_drawOverrule == null)
     {
         _drawOverrule = new MyDrawOverrule();
         Overrule.AddOverrule(RXObject.GetClass(typeof(Line)), _drawOverrule, false);
         Overrule.Overruling = true;
     }
     else
     {
         // Toggle Overruling on/off
         Overrule.Overruling = !Overrule.Overruling;
     }
     // Regen is required to update changes on screen
     Application.DocumentManager.MdiActiveDocument.Editor.Regen();
 }
Exemple #20
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);
     }
 }
Exemple #21
0
 // 开启高亮规则重定义
 public static void openHightLightRule()
 {
     try
     {
         if (hightLightRule == null)
         {
             hightLightRule = new HightLightRule();
             //为实体添加亮显重定义
             Overrule.AddOverrule(RXObject.GetClass(typeof(Entity)), hightLightRule, false);
             Overrule.Overruling = true;//开启规则重定义
         }
         PublicMethod.Instance.RegenerateModel();
     }
     catch (System.Exception ex)
     {
         PublicMethod.Instance.Editor.WriteMessageWithReturn(ex);
     }
 }
Exemple #22
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();
 }
Exemple #23
0
        public void Test()
        {
            Document acDoc = Application.DocumentManager.MdiActiveDocument;

            Database acCurDb = acDoc.Database;

            Editor acEd = acDoc.Editor;

            using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
            {
                var blkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;

                var mdlSpc = acTrans.GetObject(blkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;


                var myWallRule = new MyWallDrawRule();

                myWallRule.SetExtensionDictionaryEntryFilter("MyWallType");

                Overrule.AddOverrule(RXObject.GetClass(typeof(Line)), myWallRule, false);
                Overrule.Overruling = true;


                var line = new Line(Point3d.Origin, Point3d.Origin + Vector3d.XAxis.RotateBy(Math.PI / 6, Vector3d.ZAxis) * 10);

                mdlSpc.AppendEntity(line);

                if (!line.ExtensionDictionary.IsValid)
                {
                    line.CreateExtensionDictionary();
                    var dict = acTrans.GetObject(line.ExtensionDictionary, OpenMode.ForWrite) as DBDictionary;
                    dict.SetAt("MyWallType", new DataTable());
                }

                acTrans.AddNewlyCreatedDBObject(line, true);

                acTrans.Commit();
            }
        }
Exemple #24
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());
 }
Exemple #25
0
 /// <inheritdoc />
 public void Initialize()
 {
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), GroundLineGripPointOverrule.Instance(), true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), GroundLineOsnapOverrule.Instance(), true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), GroundLineObjectOverrule.Instance(), true);
 }
 //重定义失效
 public static void OverruleEnd()
 {
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(Line)), LArrowDrawOverrule3.TheOverrule);
     Overrule.RemoveOverrule(RXObject.GetClass(typeof(Line)), LArrowGripOverrule3.TheOverrule);
 }
 /// <inheritdoc/>
 public void Initialize()
 {
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), LevelMarkGripPointOverrule.Instance(), true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), LevelMarkOsnapOverrule.Instance(), true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), LevelMarkObjectOverrule.Instance(), true);
 }
 /// <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 Initialize()
 {
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), WaterProofingGripPointOverrule.Instance(), true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), WaterProofingOsnapOverrule.Instance(), true);
     Overrule.AddOverrule(RXObject.GetClass(typeof(BlockReference)), WaterProofingObjectOverrule.Instance(), true);
 }
 /// <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());
 }