private void GetTagDimension() { BoundingBoxXYZ boundingBox = ((Element)this._tag).get_BoundingBox(this._currentView); BoundingBoxXYZ cropBox = this._currentView.get_CropBox(); this._tagHeight = cropBox.get_Transform().get_Inverse().OfPoint(boundingBox.get_Max()).get_Y() - cropBox.get_Transform().get_Inverse().OfPoint(boundingBox.get_Min()).get_Y(); this._tagWidth = cropBox.get_Transform().get_Inverse().OfPoint(boundingBox.get_Max()).get_X() - cropBox.get_Transform().get_Inverse().OfPoint(boundingBox.get_Min()).get_X(); this._tagCenter = XYZ.op_Division(XYZ.op_Addition(cropBox.get_Transform().get_Inverse().OfPoint(boundingBox.get_Max()), cropBox.get_Transform().get_Inverse().OfPoint(boundingBox.get_Min())), 2.0); this._tagCenter = new XYZ(this._tagCenter.get_X(), this._tagCenter.get_Y(), 0.0); this._headOffset = XYZ.op_Subtraction(this._tagHeadPosition, this._tagCenter); }
public static XYZ GetLeaderEnd(Element taggedElement, View currentView) { BoundingBoxXYZ boundingBox = taggedElement.get_BoundingBox(currentView); BoundingBoxXYZ cropBox = currentView.get_CropBox(); XYZ xyz1 = new XYZ(); XYZ xyz2 = boundingBox == null?XYZ.op_Addition(XYZ.op_Division(XYZ.op_Addition(cropBox.get_Max(), cropBox.get_Min()), 2.0), new XYZ(0.001, 0.0, 0.0)) : XYZ.op_Division(XYZ.op_Addition(boundingBox.get_Max(), boundingBox.get_Min()), 2.0); XYZ xyz3 = cropBox.get_Transform().get_Inverse().OfPoint(xyz2); return(new XYZ(Math.Round(xyz3.get_X(), 4), Math.Round(xyz3.get_Y(), 4), 0.0)); }