public void OverruleStart() { ObjectOverrule.AddOverrule( RXClass.GetClass(typeof(Line)), LinePipeDrawOverrule.theOverrule, true ); ObjectOverrule.AddOverrule( RXClass.GetClass(typeof(Circle)), CirclePipeDrawOverrule.theOverrule, true ); ObjectOverrule.AddOverrule( RXClass.GetClass(typeof(Line)), LinePipeTransformOverrule.theOverrule, true ); ObjectOverrule.AddOverrule( RXClass.GetClass(typeof(Circle)), CirclePipeTransformOverrule.theOverrule, true ); ObjectOverrule.AddOverrule( RXClass.GetClass(typeof(Entity)), CopyOverrule.theOverrule, true ); Overrule(true); }
public bool askForDistances(AC_Line acline) { circleCenter = acline.StartPoint; previewCircle = new AC_Circle(); previewCircle.addToDrawing(); removeSnap noSnap = new removeSnap(previewCircle.ObjectId); ObjectOverrule.AddOverrule(RXObject.GetClass(typeof(Entity)), noSnap, true); drawPreviewCircle = true; PromptDistanceOptions DistOption = new PromptDistanceOptions("Triangulation Distance"); DistOption.BasePoint = circleCenter; DistOption.UseBasePoint = true; PromptDoubleResult triang1 = tr.AC_Doc.Editor.GetDistance(DistOption); if (triang1.Status == PromptStatus.OK) { if (triang1.Value != 0) { tr.AC_Doc.Editor.WriteMessage(triang1.Value.ToString() + "\n"); circleCenter = acline.EndPoint; DistOption.BasePoint = circleCenter; radius.Add(triang1.Value); PromptDoubleResult triang2 = tr.AC_Doc.Editor.GetDistance(DistOption); if (triang2.Status == PromptStatus.OK) { tr.AC_Doc.Editor.WriteMessage(triang2.Value.ToString() + "\n"); radius.Add(triang2.Value); previewCircle.Visible = false; drawPreviewCircle = false; return(true); } else { tr.AC_Doc.Editor.PointMonitor -= Editor_PointMonitor; ObjectOverrule.RemoveOverrule(RXObject.GetClass(typeof(Entity)), noSnap); previewCircle.Erase(true); return(false); } } else { tr.AC_Doc.Editor.PointMonitor -= Editor_PointMonitor; tr.AC_Doc.Editor.WriteMessage("Cannot Calculate Triangulation \n"); ObjectOverrule.RemoveOverrule(RXObject.GetClass(typeof(Entity)), noSnap); previewCircle.Erase(true); return(false); } } else { tr.AC_Doc.Editor.PointMonitor -= Editor_PointMonitor; ObjectOverrule.RemoveOverrule(RXObject.GetClass(typeof(Entity)), noSnap); previewCircle.Visible = false; drawPreviewCircle = false; return(false); } }
void Editor_SelectionAdded(object sender, SelectionAddedEventArgs e) { foreach (ObjectId id in e.AddedObjects.GetObjectIds()) { if (id == DimInc_pLine && needOverrule) { tr.AC_Doc.Editor.PointMonitor += Editor_PointMonitor; tr.AC_Doc.Editor.PromptedForPoint += Editor_PromptedForPoint; tr.AC_Doc.Editor.DraggingEnded += Editor_DraggingEnded; ObjectOverrule.AddOverrule(RXClass.GetClass(typeof(Entity)), this, true); needOverrule = false; } } }
public void beginDraw_PreviewLine(Point3d point) { //CREATE LINE drawline = true; Line line = new Line(point, point); PrevLine = tr.addObject(line); DBText acText = new DBText(); PrevText = tr.addObject(acText); _osOverrule = new OsSnappOver(PrevLine); ObjectOverrule.AddOverrule(RXObject.GetClass(typeof(Entity)), _osOverrule, false); }
void IExtensionApplication.Initialize() { // Load the dependent assembly try { Assembly.LoadFrom(System.IO.Path.Combine(RebarPosCommands.MyCommands.ApplicationBinPath, "ManagedRebarPos.dll")); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Error: " + ex.Message, "RebarPos", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } // Create overrules DrawableOverrule.Overruling = true; ObjectOverrule.AddOverrule(RXClass.GetClass(typeof(RebarPos)), CountOverrule.Instance, true); ObjectOverrule.AddOverrule(RXClass.GetClass(typeof(RebarPos)), ShowShapesOverrule.Instance, true); }