<?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: Cannot find attachmentType correctly in link tree. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973572#M68682</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Dear Pmeigneux,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I cleaned up your sample code and created a full minimal sample add-in solution for it, attached below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It now produces the same treeview form and also lists the result in the debug output window:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Det1AssemblyA2.rvt-&amp;gt;Attachment
Det1AssemblyA2.rvt-&amp;gt;Attachment
Det1AssemblyA2.rvt-&amp;gt;Attachment
Sub1AssemblyA2.rvt-&amp;gt;Attachment
  Det1AssemblyA2.rvt-&amp;gt;Overlay
Sub1AssemblyA2.rvt-&amp;gt;Attachment
  Det1AssemblyA2.rvt-&amp;gt;Overlay
Sub1AssemblyA2.rvt-&amp;gt;Attachment
  Det1AssemblyA2.rvt-&amp;gt;Overlay&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are the nested links not overlays?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How should they be classified?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess a defect should be registered for this, then?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2016 12:28:58 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2016-01-05T12:28:58Z</dc:date>
    <item>
      <title>Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5964184#M68678</link>
      <description>&lt;P&gt;I rebuild tree link but attachmenttype is incorrect..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code :&lt;/P&gt;&lt;P&gt;public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit,&lt;BR /&gt;ref string message, ElementSet elements)&lt;BR /&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;// get active document&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Document mainDoc = revit.Application.ActiveUIDocument.Document;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;// prepare to show the results...&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;TreeNode mainNode = new TreeNode();&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;mainNode.Text = mainDoc.PathName;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;// start by the root links (no parent node)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;FilteredElementCollector coll = new FilteredElementCollector(mainDoc);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;coll.OfClass(typeof(RevitLinkInstance));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;foreach (RevitLinkInstance inst in coll)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;RevitLinkType type = mainDoc.GetElement(inst.GetTypeId()) as RevitLinkType;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;if (type.GetParentId() == ElementId.InvalidElementId)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;TreeNode parentNode = new TreeNode(type.Name+"-&amp;gt;"+type.AttachmentType.ToString());&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;mainNode.Nodes.Add(parentNode);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;GetChilds(mainDoc, type.GetChildIds(), parentNode);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;// show the results in a form&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;System.Windows.Forms.Form resultForm = new System.Windows.Forms.Form();&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;TreeView treeView = new TreeView();&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;treeView.Size = resultForm.Size;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;treeView.Anchor |= AnchorStyles.Bottom | AnchorStyles.Top;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;treeView.Nodes.Add(mainNode);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;resultForm.Controls.Add(treeView);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;resultForm.ShowDialog();&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;return Result.Succeeded;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private void GetChilds(Document mainDoc, ICollection&amp;lt;ElementId&amp;gt; ids,&lt;BR /&gt;TreeNode parentNode)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; foreach (ElementId id in ids)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;// get the child information&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;RevitLinkType type = mainDoc.GetElement(id) as RevitLinkType;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;TreeNode subNode = new TreeNode(type.Name + "-&amp;gt;" + type.AttachmentType.ToString());&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;parentNode.Nodes.Add(subNode);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;// then go to the next level&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;GetChilds(mainDoc, type.GetChildIds(), subNode);&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/208336i214291406BA52B58/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Screenshot_1.png" title="Screenshot_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 08:05:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5964184#M68678</guid>
      <dc:creator>pmeigneux</dc:creator>
      <dc:date>2015-12-24T08:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5964439#M68679</link>
      <description>&lt;P&gt;Dear Pmeigneux,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume this is a follow-up to your previous questions on retrieving the hierrchy of linked Revit files, and the sample code that Augusto provided for you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;&lt;A href="http://stackoverflow.com/questions/34336797/how-to-get-list-hierarchy-of-linked-and-sub-linked-revit-files" target="_blank"&gt;http://stackoverflow.com/questions/34336797/how-to-get-list-hierarchy-of-linked-and-sub-linked-revit-files&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;&lt;A href="http://forums.autodesk.com/t5/revit-api/how-to-get-list-amp-hierarchy-of-linked-and-sub-linked-revit/td-p/5955989" target="_blank"&gt;http://forums.autodesk.com/t5/revit-api/how-to-get-list-amp-hierarchy-of-linked-and-sub-linked-revit/td-p/5955989&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;&lt;A href="http://adndevblog.typepad.com/aec/2015/12/reading-revit-links-hierarchy.html" target="_blank"&gt;http://adndevblog.typepad.com/aec/2015/12/reading-revit-links-hierarchy.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest that you debug the code and step through it statement by statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pay particular atention to the statement that sets the attachment type string on the tree node.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it performing correctly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If no, fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, you can submit a much simpler reproducible case which is independent of the rest of the hierarchy and simply demonstrates that the&amp;nbsp;AttachmentType property returns a wrong value on a specific linked file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide that as a &lt;U&gt;minimal&lt;/U&gt; reproducible case that we can pass on to the development team for further analysis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it the problem is as simple as it appears, your sample code just needs one single line of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;print type.AttachmentType.ToString()&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you just need to submit one single Revit model file, or possibly two: the main project file and the linked file reporting the erroneous attachment type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 15:04:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5964439#M68679</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-12-24T15:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5966434#M68680</link>
      <description>&lt;P&gt;Hello Jeremy&lt;/P&gt;&lt;P&gt;This is the sample code used as well as files:&lt;/P&gt;&lt;P&gt;public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get active document&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Document mainDoc = revit.Application.ActiveUIDocument.Document;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // prepare to show the results...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNode mainNode = new TreeNode();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainNode.Text = mainDoc.PathName;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // start by the root links (no parent node)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FilteredElementCollector coll = new FilteredElementCollector(mainDoc);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; coll.OfClass(typeof(RevitLinkInstance));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (RevitLinkInstance inst in coll)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RevitLinkType type = mainDoc.GetElement(inst.GetTypeId()) as RevitLinkType;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (type.GetParentId() == ElementId.InvalidElementId)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNode parentNode = new TreeNode(type.Name+"-&amp;gt;"+type.AttachmentType.ToString());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainNode.Nodes.Add(parentNode);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetChilds(mainDoc, type.GetChildIds(), parentNode);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // show the results in a form&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.Form resultForm = new System.Windows.Forms.Form();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeView treeView = new TreeView();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; treeView.Size = resultForm.Size;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; treeView.Anchor |= AnchorStyles.Bottom | AnchorStyles.Top;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; treeView.Nodes.Add(mainNode);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resultForm.Controls.Add(treeView);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resultForm.ShowDialog();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Autodesk.Revit.UI.Result.Succeeded;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;private void GetChilds(Document mainDoc, ICollection&amp;lt;ElementId&amp;gt; ids, TreeNode parentNode)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (ElementId id in ids)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the child information&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RevitLinkType type = mainDoc.GetElement(id) as RevitLinkType;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNode subNode = new TreeNode(type.Name + "-&amp;gt;" + type.AttachmentType.ToString());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parentNode.Nodes.Add(subNode);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // then go to the next level&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetChilds(mainDoc, type.GetChildIds(), subNode);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obtained Result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2015 18:21:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5966434#M68680</guid>
      <dc:creator>pmeigneux</dc:creator>
      <dc:date>2015-12-28T18:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973536#M68681</link>
      <description>&lt;P&gt;Dear Pmeigneux,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your sample code and model structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I compiled and ran your sample successfully in Revit 2016 and see the same as you show above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/209603iA2F34ABFD78C4264/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="treeview_result.png" title="treeview_result.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now what is the problem, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What result would you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 12:03:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973536#M68681</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-01-05T12:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973572#M68682</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Pmeigneux,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I cleaned up your sample code and created a full minimal sample add-in solution for it, attached below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It now produces the same treeview form and also lists the result in the debug output window:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Det1AssemblyA2.rvt-&amp;gt;Attachment
Det1AssemblyA2.rvt-&amp;gt;Attachment
Det1AssemblyA2.rvt-&amp;gt;Attachment
Sub1AssemblyA2.rvt-&amp;gt;Attachment
  Det1AssemblyA2.rvt-&amp;gt;Overlay
Sub1AssemblyA2.rvt-&amp;gt;Attachment
  Det1AssemblyA2.rvt-&amp;gt;Overlay
Sub1AssemblyA2.rvt-&amp;gt;Attachment
  Det1AssemblyA2.rvt-&amp;gt;Overlay&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are the nested links not overlays?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How should they be classified?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess a defect should be registered for this, then?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 12:28:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973572#M68682</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-01-05T12:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973585#M68683</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All Links are in Attachment... No Overlay in this Example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm use revit 2015.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Philippe Meigneux.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 12:37:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973585#M68683</guid>
      <dc:creator>pmeigneux</dc:creator>
      <dc:date>2016-01-05T12:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973615#M68684</link>
      <description>&lt;P&gt;Dear Philippe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for confirming that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I logged the issue &lt;U&gt;&lt;STRONG&gt;REVIT-83477&lt;/STRONG&gt;&lt;/U&gt; [AttachmentType returns wrong value -- 11363552] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are welcome to request an update on the status of this issue or to provide us with additional information at any time by submitting a new case quoting the change request number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This issue is important to me. What can I do to help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This issue needs to be assessed by our engineering team, and prioritised against all of the other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;Impact on your application and/or your development.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;The number of users affected.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;The potential revenue impact to you.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;The potential revenue impact to Autodesk.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;Realistic timescale over which a fix would help you.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 12:52:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/5973615#M68684</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-01-05T12:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/6011045#M68685</link>
      <description>While we are fixing the issue, the workaround can be:&lt;BR /&gt;nested links are always Attachments. (If the nested link was an overlay, then we wouldn't have brought it into the main file, so its existence demonstrates that it's an attachment.) - by development team.</description>
      <pubDate>Thu, 28 Jan 2016 08:11:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/6011045#M68685</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2016-01-28T08:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/6019637#M68686</link>
      <description>&lt;P&gt;Dear Philippe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you check whether the following sample Revit add-in implements the workarou8hnd suggested by Aaron and the development team?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/ListLinkType" target="_blank"&gt;https://github.com/jeremytammik/ListLinkType&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The relevant code is basically this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  /// &amp;lt;summary&amp;gt;
  /// Return a label to display for a link type.
  /// Nested links are always attachments.
  /// &amp;lt;/summary&amp;gt;
  static string LinkLabel( 
    RevitLinkType type, 
    int level )
  {
    AttachmentType a = type.AttachmentType;
    AttachmentType b = 0 &amp;lt; level
      ? AttachmentType.Attachment
      : a;

    Debug.Print(
      "AttachmentType {0} at level {1} -&amp;gt; {2}", 
      a, level, b );

    return type.Name + "-&amp;gt;" + b.ToString();
  }&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 14:15:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/6019637#M68686</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-02-02T14:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/6030628#M68687</link>
      <description>&lt;P&gt;The development team report that the issue that I raised for this and the follow-up code fixing issue REVIT-84580 [AttachmentType returns wrong value -- 11363552] have&amp;nbsp;been addressed&amp;nbsp;and the problem is now resolved -- in the development stream, that is &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 09:35:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/6030628#M68687</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-02-09T09:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/7071058#M68688</link>
      <description>&lt;P&gt;Dear Philippe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This issue has been resolved via the two development issues:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;REVIT-83477 [AttachmentType returns wrong value -- 11363552]&lt;/LI&gt;
&lt;LI&gt;REVIT-84580 [AttachmentType returns wrong value -- 11363552]&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please verify that it works as expected for you too now in Revit 2018?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 07:57:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/7071058#M68688</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-05-09T07:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find attachmentType correctly in link tree.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/12687430#M68689</link>
      <description>&lt;P&gt;Hello, Jeremy. I guess the problem is still not solved (Revit 2022) because I tried to change AttachmentType of rvt-link via Revit API too. The property value in the Type properties of a rvt-link changes via Revit API, but the icon of a rvt-link in a Project Browser does not change....&lt;BR /&gt;However, if we do this operations&amp;nbsp;&lt;SPAN&gt;by hands as standard (not via Revit API), a link icon in Project Browser&amp;nbsp;changes only after press Apply or OK buttons in Type properties window.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 19:18:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/cannot-find-attachmenttype-correctly-in-link-tree/m-p/12687430#M68689</guid>
      <dc:creator>gnab</dc:creator>
      <dc:date>2024-04-04T19:18:07Z</dc:date>
    </item>
  </channel>
</rss>

