<?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: Revit 2016 API Leader Attachment in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738386#M71342</link>
    <description>&lt;P&gt;You're right, but I'm running a decision to only put the leader that I need based upon where it was drawn, see here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;UIDocument uiDoc = commandData.Application.ActiveUIDocument;&lt;BR /&gt;Leader leader = null;&lt;BR /&gt;&lt;BR /&gt;if (uiDoc.ActiveView.ViewType != ViewType.DraftingView &amp;amp;&amp;amp; uiDoc.ActiveView.ViewType != ViewType.Legend)&lt;BR /&gt; {&lt;BR /&gt;    Plane plane = commandData.Application.Application.Create.NewPlane(uiDoc.ActiveView.ViewDirection, uiDoc.ActiveView.Origin);&lt;BR /&gt;    SketchPlane sketchPlane = SketchPlane.Create(uiDoc.Document, plane);&lt;BR /&gt;    uiDoc.ActiveView.SketchPlane = sketchPlane;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt;try&lt;BR /&gt; {&lt;BR /&gt;    // Prompt the user to select three points and store there values&lt;BR /&gt;    startPoint = uiDoc.Selection.PickPoint(snapTypeNone, "Pick the start point of the leader.");&lt;BR /&gt;    elbowPoint = uiDoc.Selection.PickPoint(snapTypeNone, "Pick the elbow point of the leader.");&lt;BR /&gt;    endPoint = uiDoc.Selection.PickPoint(snapTypeNone, "Pick the text location.");&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt;if (Math.Abs(uiDoc.ActiveView.RightDirection.X) == 1 &amp;amp;&amp;amp; (startPoint.X * uiDoc.ActiveView.RightDirection.X) &amp;gt; (elbowPoint.X * uiDoc.ActiveView.RightDirection.X) ||
                Math.Abs(uiDoc.ActiveView.RightDirection.Y) == 1 &amp;amp;&amp;amp; (startPoint.Y * uiDoc.ActiveView.RightDirection.Y) &amp;gt; (elbowPoint.Y * uiDoc.ActiveView.RightDirection.Y))&lt;BR /&gt;{
    leader = note.AddLeader(TextNoteLeaderTypes.TNLT_STRAIGHT_R);
}
else
{
    leader = note.AddLeader(TextNoteLeaderTypes.TNLT_STRAIGHT_L);
}&lt;BR /&gt;&lt;BR /&gt;if (Math.Abs(uiDoc.ActiveView.RightDirection.X) == 1)&lt;BR /&gt; leader.Elbow = new XYZ(elbowPoint.X, leader.Elbow.Y, leader.Elbow.Z);&lt;BR /&gt; else if (Math.Abs(uiDoc.ActiveView.RightDirection.Y) == 1)&lt;BR /&gt; leader.Elbow = new XYZ(leader.Elbow.X, elbowPoint.Y, leader.Elbow.Z);&lt;BR /&gt; else&lt;BR /&gt; leader.Elbow = new XYZ(elbowPoint.X, elbowPoint.Y, leader.Elbow.Z);&lt;/PRE&gt;&lt;P&gt;So now the note has a leader using .AddLeader(). However, I don't want to change the endPoint as you showed as an example below. I want to change the Right Attachment property in the object. See the Screenshot I have attached - it shows that the Left Attachment is Top and the Right Attachment is Bottom. This is the default activity of a new leader on a note - I want to override that and make them both Top.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I can't seem to find anything useful beyond the "TopLine" I posted before, but that doesn't work.... Any additional ideas on how to make that work? Thank you for your help!!&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2015 20:05:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-07-23T20:05:15Z</dc:date>
    <item>
      <title>Revit 2016 API Leader Attachment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5736449#M71340</link>
      <description>&lt;P&gt;I'm create a new note, and needing to add a leader to it. This is updating code from a 2015 plugin to 2016. Previously I was using (where 'note' is my TextNote.Create() object):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; // Set the left and right leader attachments to Top
note.get_Parameter("Left Attachment").Set(0);
note.get_Parameter("Right Attachment").Set(0);&lt;/PRE&gt;&lt;P&gt;That has become obsolete and using the new method, I'm currently using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Set the left and right leader attachments to Top
note.LeaderLeftAttachment.Equals("TopLine");
note.LeaderRightAttachment.Equals("TopLine");&lt;/PRE&gt;&lt;P&gt;I pulled the "TopLine" from Revit Snoop. However, this is not making it into my text note when created in Revit. It is Top for the Left Attachment, but Bottom for Right Attachment. Is there a best time to pass these values (currently I do it after the leader's been created and before the command completes)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 20:59:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5736449#M71340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-22T20:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2016 API Leader Attachment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5737600#M71341</link>
      <description>crobertsnc:&lt;BR /&gt;&lt;BR /&gt;my sincere advice to you so to do less snooping. I understand that the Snoop is a popular tool and is occasionally necessary too, but at many times it does not do any good to you and your application.&lt;BR /&gt;&lt;BR /&gt;As you can find in the RevitAPI.CHM file, text note has three methods related to Leaders. They somehow mirror the UI commands in Revit:&lt;BR /&gt;- AddLeader&lt;BR /&gt;- GetLeaders&lt;BR /&gt;- RemoveLeaders&lt;BR /&gt;&lt;BR /&gt;In your case you will probably be using:&lt;BR /&gt;&lt;BR /&gt;Leader leftLeader =   myNote.AddLeader(TextNoetLeaderTypes.TNT_STRAIGHT_L);&lt;BR /&gt;and&lt;BR /&gt;Leader rightLeader =  myNote.AddLeader(TextNoetLeaderTypes.TNT_STRAIGHT_R);&lt;BR /&gt;&lt;BR /&gt;The Add method returns you the newly created Leader object. You will notice, that just like in the UI, the above method add leaders with some default shape and position. However, you can use the returned leader object and using its method a properties adjust the appearance and position of each leader.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;leftLeader.End = xyzPointSomewhereOnTheModel;&lt;BR /&gt;&lt;BR /&gt;I hope that makes it clear.</description>
      <pubDate>Thu, 23 Jul 2015 14:40:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5737600#M71341</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-07-23T14:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2016 API Leader Attachment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738386#M71342</link>
      <description>&lt;P&gt;You're right, but I'm running a decision to only put the leader that I need based upon where it was drawn, see here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;UIDocument uiDoc = commandData.Application.ActiveUIDocument;&lt;BR /&gt;Leader leader = null;&lt;BR /&gt;&lt;BR /&gt;if (uiDoc.ActiveView.ViewType != ViewType.DraftingView &amp;amp;&amp;amp; uiDoc.ActiveView.ViewType != ViewType.Legend)&lt;BR /&gt; {&lt;BR /&gt;    Plane plane = commandData.Application.Application.Create.NewPlane(uiDoc.ActiveView.ViewDirection, uiDoc.ActiveView.Origin);&lt;BR /&gt;    SketchPlane sketchPlane = SketchPlane.Create(uiDoc.Document, plane);&lt;BR /&gt;    uiDoc.ActiveView.SketchPlane = sketchPlane;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt;try&lt;BR /&gt; {&lt;BR /&gt;    // Prompt the user to select three points and store there values&lt;BR /&gt;    startPoint = uiDoc.Selection.PickPoint(snapTypeNone, "Pick the start point of the leader.");&lt;BR /&gt;    elbowPoint = uiDoc.Selection.PickPoint(snapTypeNone, "Pick the elbow point of the leader.");&lt;BR /&gt;    endPoint = uiDoc.Selection.PickPoint(snapTypeNone, "Pick the text location.");&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt;if (Math.Abs(uiDoc.ActiveView.RightDirection.X) == 1 &amp;amp;&amp;amp; (startPoint.X * uiDoc.ActiveView.RightDirection.X) &amp;gt; (elbowPoint.X * uiDoc.ActiveView.RightDirection.X) ||
                Math.Abs(uiDoc.ActiveView.RightDirection.Y) == 1 &amp;amp;&amp;amp; (startPoint.Y * uiDoc.ActiveView.RightDirection.Y) &amp;gt; (elbowPoint.Y * uiDoc.ActiveView.RightDirection.Y))&lt;BR /&gt;{
    leader = note.AddLeader(TextNoteLeaderTypes.TNLT_STRAIGHT_R);
}
else
{
    leader = note.AddLeader(TextNoteLeaderTypes.TNLT_STRAIGHT_L);
}&lt;BR /&gt;&lt;BR /&gt;if (Math.Abs(uiDoc.ActiveView.RightDirection.X) == 1)&lt;BR /&gt; leader.Elbow = new XYZ(elbowPoint.X, leader.Elbow.Y, leader.Elbow.Z);&lt;BR /&gt; else if (Math.Abs(uiDoc.ActiveView.RightDirection.Y) == 1)&lt;BR /&gt; leader.Elbow = new XYZ(leader.Elbow.X, elbowPoint.Y, leader.Elbow.Z);&lt;BR /&gt; else&lt;BR /&gt; leader.Elbow = new XYZ(elbowPoint.X, elbowPoint.Y, leader.Elbow.Z);&lt;/PRE&gt;&lt;P&gt;So now the note has a leader using .AddLeader(). However, I don't want to change the endPoint as you showed as an example below. I want to change the Right Attachment property in the object. See the Screenshot I have attached - it shows that the Left Attachment is Top and the Right Attachment is Bottom. This is the default activity of a new leader on a note - I want to override that and make them both Top.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I can't seem to find anything useful beyond the "TopLine" I posted before, but that doesn't work.... Any additional ideas on how to make that work? Thank you for your help!!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 20:05:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738386#M71342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T20:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2016 API Leader Attachment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738413#M71343</link>
      <description>&lt;P&gt;crobertsnc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it is the &lt;STRONG&gt;TextNote &lt;/STRONG&gt;class that has the &lt;STRONG&gt;LeaderLeftAttachement&lt;/STRONG&gt; and &lt;STRONG&gt;LeaderRightAtachement&lt;/STRONG&gt; properties you are looking for.&lt;/P&gt;
&lt;P&gt;(With the updated API we tried to follow the UI features as closely as possible).&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 20:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738413#M71343</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-07-23T20:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2016 API Leader Attachment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738484#M71344</link>
      <description>&lt;P&gt;Oof. So all I ended up needing was a slight tweak to the original declarations and to use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  // Set the left and right leader attachments to Top
      
            note.LeaderRightAttachment = LeaderAtachement.TopLine;
            note.LeaderLeftAttachment = LeaderAtachement.TopLine;&lt;/PRE&gt;&lt;P&gt;Thank you as always for your help - I've learned a lot on this seemingly simple project. Works now, as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 21:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/5738484#M71344</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T21:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Revit 2016 API Leader Attachment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/12873904#M71345</link>
      <description>&lt;P&gt;What node goes into the LeaderAttachment input when you use this in Dynamo? It isn't working when I pull the leaders using a Rhythm node.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BethEvanoo_0-1719929450706.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1382404iF7745C30E54E5C82/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BethEvanoo_0-1719929450706.png" alt="BethEvanoo_0-1719929450706.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 14:11:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/revit-2016-api-leader-attachment/m-p/12873904#M71345</guid>
      <dc:creator>BethEvanoo</dc:creator>
      <dc:date>2024-07-02T14:11:26Z</dc:date>
    </item>
  </channel>
</rss>

