<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tag Leader Geometry in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10710855#M22914</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tag.png" style="width: 700px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/981215i0F9CAF5FAAD88B37/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tag.png" alt="Tag.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to modify the Tag Leaders in certain way, But I see there is no way to directly control the Tags leader instead it is controlled by other parameters such as Head Position and leader elbow, How is the leader logically created? And what parameters effect it directly?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Oct 2021 06:57:47 GMT</pubDate>
    <dc:creator>sahin.ikbal</dc:creator>
    <dc:date>2021-10-25T06:57:47Z</dc:date>
    <item>
      <title>Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10710855#M22914</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tag.png" style="width: 700px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/981215i0F9CAF5FAAD88B37/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tag.png" alt="Tag.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to modify the Tag Leaders in certain way, But I see there is no way to directly control the Tags leader instead it is controlled by other parameters such as Head Position and leader elbow, How is the leader logically created? And what parameters effect it directly?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 06:57:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10710855#M22914</guid>
      <dc:creator>sahin.ikbal</dc:creator>
      <dc:date>2021-10-25T06:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711022#M22915</link>
      <description>&lt;P&gt;Please look at the Revit SDK samples, especially the TagBeam sample, and let us know whether that helps. Among many other thins, it allows you to 'select the tag orientation and choose whether tags have leaders', so it should cover what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 07:27:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711022#M22915</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-10-25T07:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711211#M22916</link>
      <description>&lt;P&gt;In the example I found it's controlling Leader-end point but I am not able to understand start point control.&lt;BR /&gt;After a bit of tinkering I found Leaders are starting from the edge middle positions of the Bounding box of tag only when it's without leader,&lt;BR /&gt;But now for some test files I found its not coming from bounding box middle position Image attached(In the lower tag its elbow position is given in parallel direction from boundingbox middle but still its not straight), So I wanted to know from where does it actually come, I mean what are the things that controls this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tag.png" style="width: 456px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/981264i70E46AB0DC364877/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tag.png" alt="Tag.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tag.png" style="width: 929px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/981266iD3BF5BFBAE3EA60B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tag.png" alt="Tag.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 09:11:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711211#M22916</guid>
      <dc:creator>sahin.ikbal</dc:creator>
      <dc:date>2021-10-25T09:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711251#M22917</link>
      <description>&lt;P&gt;Maybe the answer requires some content creation knowledge on how to create the tag family definition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 09:24:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711251#M22917</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-10-25T09:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711366#M22918</link>
      <description>&lt;P&gt;Seems like that.&lt;/P&gt;&lt;P&gt;For now I'm going with Boundingbox middle position, it seems to work fine most of the time.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 10:26:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711366#M22918</guid>
      <dc:creator>sahin.ikbal</dc:creator>
      <dc:date>2021-10-25T10:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711610#M22919</link>
      <description>&lt;P&gt;You can think of the tag as starting from the centre of the geometry bounding box but being hidden behind the tag graphics. From previous experience it doesn't seem to follow the position of reference plane intersection (I believe that is where tag head is found to be).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The usual approach is therefore to analyses the bounding box without a leader and centre on that. This could mean either:&lt;/P&gt;&lt;P&gt;A) Turning the leader off in a temporary transaction&lt;/P&gt;&lt;P&gt;B) Looking at the label position bounding box in relation to the family origin and then applying this same vector translation from TagHeadPosition in the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For (B) if your label is top left centred then you need to consider that aspect: how the bounding box will change due to due to text length. Additionally you can have multiple labels all with differing alignments and also other graphics so option (A) is usually the best worst option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:24:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711610#M22919</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-10-25T12:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711660#M22920</link>
      <description>&lt;LI-CODE lang="general"&gt;var tag = CreatedFrom.Tag;
            var taggedElement = tag.Document.GetElement(tag.GetTaggedReference());
            var taggedElementBbx = taggedElement.get_BoundingBox(tag.Document.ActiveView);
            hostMaxbbx = taggedElementBbx.Max;
            hostMinbbx = taggedElementBbx.Min;
            hostTopMid = new XYZ((hostMaxbbx.X + hostMinbbx.X) / 2, hostMaxbbx.Y, tag.TagHeadPosition.Z);
            hostLowerMid = new XYZ((hostMaxbbx.X + hostMinbbx.X) / 2, hostMinbbx.Y, tag.TagHeadPosition.Z);
            hostLeftMid = new XYZ(hostMinbbx.X, (hostMaxbbx.Y + hostMinbbx.Y) / 2, tag.TagHeadPosition.Z);
            hostRightMid = new XYZ(hostMaxbbx.X, (hostMaxbbx.Y + hostMinbbx.Y) / 2, tag.TagHeadPosition.Z);

            var tagBbx = tagBounding.BoundingBox;

            tagMaxbbx = tagBbx.Max;
            tagMinbbx = tagBbx.Min;
            tagTopMid = new XYZ((tagMaxbbx.X + tagMinbbx.X) / 2, tagMaxbbx.Y, tag.TagHeadPosition.Z);
            tagLowerMid = new XYZ((tagMaxbbx.X + tagMinbbx.X) / 2, tagMinbbx.Y, tag.TagHeadPosition.Z);
            tagLeftMid = new XYZ(tagMinbbx.X, (tagMaxbbx.Y + tagMinbbx.Y) / 2, tag.TagHeadPosition.Z);
            tagRightMid = new XYZ(tagMaxbbx.X, (tagMaxbbx.Y + tagMinbbx.Y) / 2, tag.TagHeadPosition.Z);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; tagBbxPoints = new List&amp;lt;PositionXYZ&amp;gt;()
            {new PositionXYZ(){xyz= tagLeftMid,position=Position.LeftMid },
             new PositionXYZ(){xyz=  tagTopMid, position=Position.TopMid},
             new PositionXYZ(){xyz=  tagRightMid, position=Position.RightMid},
             new PositionXYZ(){  xyz= tagLowerMid ,position=Position.LowerMid}};
            hostBbxPoints = new List&amp;lt;PositionXYZ&amp;gt;()
            {new PositionXYZ(){xyz= hostLeftMid,position=Position.LeftMid },
             new PositionXYZ(){xyz= hostTopMid, position=Position.TopMid},
             new PositionXYZ(){xyz= hostRightMid, position=Position.RightMid},
             new PositionXYZ(){  xyz= hostLowerMid ,position=Position.LowerMid}};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; public PositionXYZ ClosestPoint(ElemType elemType)
        {

            var combinedDistData = hostBbxPoints.SelectMany(h =&amp;gt;
            {
                return tagBbxPoints.Select(t =&amp;gt;
                {
                    return new { host = h, tag = t, dist = t.xyz.DistanceTo(h.xyz) };
                });
            });

            var closest = combinedDistData.OrderBy(x =&amp;gt; x.dist).FirstOrDefault();

            if (elemType is ElemType.Host)
                return closest.host;
            else
                return closest.tag;

        }
        public PositionXYZ ClosestPoint(ElemType elemType, XYZ otherPoint)
        {


            var hostPoint = hostBbxPoints.OrderBy(x =&amp;gt; x.xyz.DistanceTo(otherPoint)).FirstOrDefault();
            var tagPoint = tagBbxPoints.OrderBy(x =&amp;gt; x.xyz.DistanceTo(otherPoint)).FirstOrDefault();


            if (elemType is ElemType.Host)
                return hostPoint;
            else
                return tagPoint;

        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This are the methods I'm using to calculate the starting and end position.&lt;BR /&gt;Where&amp;nbsp;taggedElementBbx is the Host Elements Bounding Box&lt;BR /&gt;and TagBbx is taken by temporary transaction and turning off the leader then taking the bounding box.&lt;/P&gt;&lt;P&gt;Other Point I'm giving when leader elbow is available, It's working for attached end geometry as well.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Just don't know why some cases are giving anomalies.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:43:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711660#M22920</guid>
      <dc:creator>sahin.ikbal</dc:creator>
      <dc:date>2021-10-25T12:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711686#M22921</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;//Looking at the label position bounding box in relation to the family origin//&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;what u meant by &lt;U&gt;&lt;STRONG&gt;family origin&lt;/STRONG&gt;&lt;/U&gt; here for IndependentTag?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:53:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10711686#M22921</guid>
      <dc:creator>sahin.ikbal</dc:creator>
      <dc:date>2021-10-25T12:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Tag Leader Geometry</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10712331#M22922</link>
      <description>&lt;P&gt;If you edit the family you can find bounding box of label in family. Then from that find the difference between the centre of the label bounding box and intersection of ref planes (which defines family origin and I believe the TagHeadPosition in project).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The quirk is that in the family the label bounding box hasn't grown to show the same value in the project and as previously noted multiple labels can grow and shrink in different directions affecting the overall bounding box relationship to family origin. There may be other non-visible graphics skewing the result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the cases where you find it not quite working is there non-visible graphics in the family or other labels without parameter values etc? If all the labels are centred on origin and justified that way then it doesn't matter because overall bounding box centre doesn't change.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 17:23:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/tag-leader-geometry/m-p/10712331#M22922</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-10-25T17:23:46Z</dc:date>
    </item>
  </channel>
</rss>

