public XYZ GetLeaderEnd() { XYZ xyz = this.Center; Element parent = this.Parent; if (((object)parent).GetType() == typeof(IndependentTag)) { IndependentTag tag = parent as IndependentTag; if (tag.get_HasLeader()) { xyz = tag.get_LeaderEndCondition() != 1 ? TagLeader.GetLeaderEnd(TagLeader.GetTaggedElement(this._doc, tag), this._ownerView) : tag.get_LeaderEnd(); } } else if (((object)parent).GetType() == typeof(TextNote)) { TextNote textNote = parent as TextNote; if ((uint)textNote.get_LeaderCount() > 0U) { xyz = ((IEnumerable <Leader>)textNote.GetLeaders()).FirstOrDefault <Leader>().get_End(); } } else if (((object)parent).GetType().IsSubclassOf(typeof(SpatialElementTag))) { SpatialElementTag spatialElementTag = parent as SpatialElementTag; if (spatialElementTag.get_HasLeader()) { xyz = spatialElementTag.get_LeaderEnd(); } } else { xyz = this.Center; } return(xyz); }
public TagLeader(IndependentTag tag, Document doc) { this._doc = doc; this._currentView = this._doc.GetElement(((Element)tag).get_OwnerViewId()) as View; this._tag = tag; this._taggedElement = TagLeader.GetTaggedElement(this._doc, this._tag); this._tagHeadPosition = this._currentView.get_CropBox().get_Transform().get_Inverse().OfPoint(tag.get_TagHeadPosition()); this._tagHeadPosition = new XYZ(this._tagHeadPosition.get_X(), this._tagHeadPosition.get_Y(), 0.0); this._leaderEnd = TagLeader.GetLeaderEnd(this._taggedElement, this._currentView); this._side = XYZ.op_Division(XYZ.op_Addition(this._currentView.get_CropBox().get_Max(), this._currentView.get_CropBox().get_Min()), 2.0).get_X() <= this._leaderEnd.get_X() ? ViewSides.Right : ViewSides.Left; this.GetTagDimension(); }
public XYZ GetLeaderEnd() { XYZ LeaderEnd = this.Center; Element e = this.Parent; //Find the leader end, if any if (e.GetType() == typeof(IndependentTag)) { IndependentTag tag = e as IndependentTag; if (tag.HasLeader) { if (tag.LeaderEndCondition == LeaderEndCondition.Free) { LeaderEnd = tag.LeaderEnd; } else { Element taggedElement = TagLeader.GetTaggedElement(_doc, tag); LeaderEnd = TagLeader.GetLeaderEnd(taggedElement, _ownerView); } } } else if (e.GetType() == typeof(TextNote)) { TextNote note = e as TextNote; if (note.LeaderCount != 0) { LeaderEnd = note.GetLeaders().FirstOrDefault().End; } } else if (e.GetType().IsSubclassOf(typeof(SpatialElementTag))) { SpatialElementTag tag = e as SpatialElementTag; if (tag.HasLeader) { LeaderEnd = tag.LeaderEnd; } } else { LeaderEnd = Center; } return(LeaderEnd); }