void AnchorDeviationsCmdForm_PointMonitor(object sender, PointMonitorEventArgs e) { //e.AppendToolTipText("Игорь - это проверка)))"); BlockReference hBr; BlockReference vBr; using (Transaction trans = Tools.StartTransaction()) { hBr = (BlockReference)arrowHorizontalId.GetObject(OpenMode.ForRead, true, true); vBr = (BlockReference)arrowVerticalId.GetObject(OpenMode.ForRead, true, true); } BlockReference copyHBr = this.arrowHorizontal.GetRedirectBlockReferenceCopy(hBr, e.Context.ComputedPoint); BlockReference copyVBr = this.arrowVertical.GetRedirectBlockReferenceCopy(vBr, e.Context.ComputedPoint); if (transient == null) { transient = new display.DynamicTransient(); } transient.ClearTransientGraphics(); if (copyHBr != null) { transient.AddMarker(copyHBr, arrowHorizontal.BlockName); } if (copyVBr != null) { transient.AddMarker(copyVBr, arrowVertical.BlockName); } transient.Display(); }
public ArrowDirectional(Matrix3d matrix, DirectionMode mode, double angle = 0d) { this.BlockTableRecordId = ObjectId.Null; this.Origin = new Point3d(0, 0, 0); this.Matrix = matrix; this.Mode = mode; this.BlockName = "_DrawAnchorDeviations_" + this.Mode.ToString(); this.DynTransient = new display.DynamicTransient(); }
void AnchorDeviationsCmdForm_PromptedForPoint(object sender, PromptPointResultEventArgs e) { Tools.GetAcadEditor().PointMonitor -= AnchorDeviationsCmdForm_PointMonitor; Tools.GetAcadEditor().PromptingForPoint -= AnchorDeviationsCmdForm_PromptingForPoint; Tools.GetAcadEditor().PromptedForPoint -= AnchorDeviationsCmdForm_PromptedForPoint; if (transient != null) { /*List<DBObject> markers = transient.GetClonedMarkers(); * using (Transaction trans = Tools.StartTransaction()) * { * foreach (BlockReference br in markers) * { * * if (br.Name == this.arrowHorizontal.BlockName) * { * trans.GetObject(this.arrowHorizontalId, OpenMode.ForWrite).Erase(); * Tools.AppendEntity(trans, br, false); * } * if (br.Name == this.arrowVertical.BlockName) * { * trans.GetObject(this.arrowVerticalId, OpenMode.ForWrite).Erase(); * Tools.AppendEntity(trans, br, false); * } * } * trans.Commit(); * }*/ using (Transaction trans = Tools.StartTransaction()) { var brs = transient.FindAllAtTag <BlockReference>(this.arrowHorizontal.BlockName); foreach (var br in brs) { trans.GetObject(this.arrowHorizontalId, OpenMode.ForWrite).Erase(); Tools.AppendEntityEx(trans, (BlockReference)br.Clone(), false); //br.GetAnonymClone(br.Position); } brs = transient.FindAllAtTag <BlockReference>(this.arrowVertical.BlockName); foreach (var br in brs) { trans.GetObject(this.arrowVerticalId, OpenMode.ForWrite).Erase(); Tools.AppendEntityEx(trans, (BlockReference)br.Clone(), false); } trans.Commit(); } transient.Dispose(); transient = null; } }
public virtual void DisplayAtBlock(Point3d position, Dictionary <string, string> attributeInfoSet) { if (_transient == null) { _transient = new display.DynamicTransient(); } ObjectId btrId = AcadBlocks.BlockTools.CreateBlockTableRecordEx(Origin, "*U", Entities, AnnotativeStates.True); BlockReference br = new BlockReference(position, btrId); foreach (var ent in Entities) { _transient.AddMarker((Entity)ent.Clone()); } _transient.Display(); }