<?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 Re: SpatialElementTag Leader position in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/13642079#M26399</link>
    <description>&lt;P&gt;I ran into the same problem. It turns out you need to set LeaderElbow in the same transaction to force a update. No regen is required. For example of straight RoomTags:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;tag.TagHeadPosition = SomeNewValue();
tag.LeaderElbow = (tag.LeaderEnd + tag.TagHeadPosition) / 2;&lt;/LI-CODE&gt;&lt;P&gt;for elbowed tags, I think&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;tag.LeaderElbow = tag.LeaderElbow;&lt;/LI-CODE&gt;&lt;P&gt;will do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 May 2025 08:11:43 GMT</pubDate>
    <dc:creator>gankeyu</dc:creator>
    <dc:date>2025-05-21T08:11:43Z</dc:date>
    <item>
      <title>SpatialElementTag Leader position</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10259850#M26394</link>
      <description>&lt;P&gt;I'm trying to manipulate the SpatialElementTag and its leaders coordinates, but although the Revit API docs states that both LeaderEnd, LeaderElbow and TagHeadPosition can be set, it doesn't work. Nothing happens, no exception, just nothing. Its the same for version 2020, and 2021 as well. It works with any tags of the IndependentTag class, and I'm trying the same with the SpatialElementTag without success. What is the magic, if there is any?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 14:54:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10259850#M26394</guid>
      <dc:creator>tamas.deri</dc:creator>
      <dc:date>2021-04-22T14:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialElementTag Leader position</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10261516#M26395</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tested this, in Revit 2020 and it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Document doc = uiDoc.Document;
Reference pickObject = uiDoc.Selection.PickObject(ObjectType.Element);
SpatialElementTag tag = doc.GetElement(pickObject.ElementId) as SpatialElementTag;

XYZ currentPosition1 = tag.LeaderEnd;
XYZ newPosition1 = new XYZ(currentPosition1.X, currentPosition1.Y + 3, currentPosition1.Z);

XYZ currentPosition2 = tag.LeaderElbow;
XYZ newPosition2 = new XYZ(currentPosition2.X, currentPosition2.Y + 3, currentPosition2.Z);

XYZ currentPosition3 = tag.TagHeadPosition;
XYZ newPosition3 = new XYZ(currentPosition3.X, currentPosition3.Y + 3, currentPosition3.Z);

using (Transaction t = new Transaction(doc, "Change leader position"))
{
    t.Start();
    tag.LeaderEnd = newPosition1;
    tag.LeaderElbow = newPosition2;
    tag.TagHeadPosition = newPosition3;
    t.Commit();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the Room tag that is by default in the Revit Sample Project. The location of the 3 points was modified correctly. The only caveat I got while testing was that the LeaderEnd has to be inside the room, which makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps,&lt;/P&gt;&lt;P&gt;Kind regards!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 01:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10261516#M26395</guid>
      <dc:creator>franciscopossetto</dc:creator>
      <dc:date>2021-04-23T01:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialElementTag Leader position</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10271430#M26396</link>
      <description>&lt;P&gt;I've tried your code as a Macro, and it did work. However if I only apply&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;tag.TagHeadPosition = newPosition3;&lt;/LI-CODE&gt;&lt;P&gt;the outcome is not visible on the screen, like nothing happened, but once I hit undo and redo, the change is visible. It seems&amp;nbsp; there is some weird issue with regenerating. I'll attach a screen recording.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 10:31:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10271430#M26396</guid>
      <dc:creator>tamas.deri</dc:creator>
      <dc:date>2021-04-27T10:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialElementTag Leader position</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10273159#M26397</link>
      <description>&lt;P&gt;Could try Regenerating the document after the changes?&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2022/22468e2c-9772-8478-0816-c9759aa43428.htm" target="_blank" rel="noopener"&gt;Regenerate Method (revitapidocs.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or update the current view&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2015/5d9f248c-a1be-ac2e-1f4c-2219ed0fc5ae.htm" target="_blank"&gt;RefreshActiveView Method (revitapidocs.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 20:38:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10273159#M26397</guid>
      <dc:creator>Sean_Page</dc:creator>
      <dc:date>2021-04-27T20:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialElementTag Leader position</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10277579#M26398</link>
      <description>&lt;P&gt;None of the above works, unfortunately. I understand that there is an automatic doc.Regenerate() at the end of each transaction, and calling it after commiting the transaction throws an &lt;A href="https://apidocs.co/apps/revit/2021.1/9e715f03-3884-e539-4dd6-8d7545733adc.htm" target="_blank"&gt;InvalidOperationException&lt;/A&gt; that there is no open transactions, which is quite strange, why would I need a Transaction, to regenerate?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 07:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/10277579#M26398</guid>
      <dc:creator>tamas.deri</dc:creator>
      <dc:date>2021-04-29T07:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialElementTag Leader position</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/13642079#M26399</link>
      <description>&lt;P&gt;I ran into the same problem. It turns out you need to set LeaderElbow in the same transaction to force a update. No regen is required. For example of straight RoomTags:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;tag.TagHeadPosition = SomeNewValue();
tag.LeaderElbow = (tag.LeaderEnd + tag.TagHeadPosition) / 2;&lt;/LI-CODE&gt;&lt;P&gt;for elbowed tags, I think&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;tag.LeaderElbow = tag.LeaderElbow;&lt;/LI-CODE&gt;&lt;P&gt;will do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 08:11:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/spatialelementtag-leader-position/m-p/13642079#M26399</guid>
      <dc:creator>gankeyu</dc:creator>
      <dc:date>2025-05-21T08:11:43Z</dc:date>
    </item>
  </channel>
</rss>

