<?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: How to find pathname of linked dwg files ? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063441#M67278</link>
    <description>&lt;P&gt;Sorry, DaLe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know very well, but somehow my fingers went off on their own accord, with no consultation with 'higher' instances.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They think they are Satoshi, too, you know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All ten of them, even though I only use index plus middle for typing, and thumbs for some spaces or upper case... but they all insist regardless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry about that!&amp;nbsp;&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, 01 Mar 2016 12:07:41 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2016-03-01T12:07:41Z</dc:date>
    <item>
      <title>How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6061793#M67272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using this code to find AutoCAD Dwg Links (3D or 2D) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (Category c in Doc1.Settings.Categories)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if (c.Name.ToLower().EndsWith(".dwg"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TaskDialog.Show("debug", "New ==&amp;gt;" + c.Name);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot find the pathname.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if a dwg link is in a A.rvt linked to the&amp;nbsp;Main.rvt, How to find the related&amp;nbsp;father A.rvt file ? Actually we have a way to find all linked .dwg files at different levels, but we don&amp;lt;t know how to get their respective parents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Philippe Meigneux.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:55:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6061793#M67272</guid>
      <dc:creator>pmeigneux</dc:creator>
      <dc:date>2016-02-29T15:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063188#M67273</link>
      <description>&lt;P&gt;Dear Philippe,&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;For the DWG files, one simple possible solution would be to use the operating system directory traversal tools to find the DWG file, assuming that you know that it is located within or underneath some specific directory, or collection of directories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am afraid that I am not aware of any other possibility right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am somewhat surprised that I could not find a wish list item for this functionality, so I created one and asked the development team for ideas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I submitted the wish list item &lt;U&gt;&lt;STRONG&gt;CF-4080&lt;/STRONG&gt;&lt;/U&gt; [API wish: determine full pathname of linked dwg file] on your behalf for the functionality you suggest, as this issue requires 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 quoting the wish list item number or this thread.&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;Impact on your application and/or your development.&lt;/LI&gt;
&lt;LI&gt;The number of users affected.&lt;/LI&gt;
&lt;LI&gt;The potential revenue impact to you.&lt;/LI&gt;
&lt;LI&gt;The potential revenue impact to Autodesk.&lt;/LI&gt;
&lt;LI&gt;Realistic timescale over which a fix would help you.&lt;/LI&gt;
&lt;LI&gt;In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;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;</description>
      <pubDate>Tue, 01 Mar 2016 08:48:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063188#M67273</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-03-01T08:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063373#M67274</link>
      <description>&lt;P&gt;Unless I am misundertanding the question, this returns DWG link paths.&amp;nbsp;I haven't looked at nested links. Dale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// collect all (immediate) external references in the model
                ICollection&amp;lt;ElementId&amp;gt; externalReferences = transData.GetAllExternalFileReferenceIds();
                int n = externalReferences.Count;

                // content += string.Format("has {0} external reference{1}{2}", n, PluralSuffix(n), DotOrColon(n));
                links = new List&amp;lt;string&amp;gt;(n);
                // DWG
                foreach (ElementId refId in externalReferences)
                {
                    ExternalFileReference extRef = transData.GetLastSavedReferenceData(refId);
                    // DWG
                    if (extRef.ExternalFileReferenceType == ExternalFileReferenceType.CADLink)
                    {
                        // get absolute path to check for validity
                        string lstrLinkFileNameAbsolute = ModelPathUtils.ConvertModelPathToUserVisiblePath(extRef.GetAbsolutePath());
                        links.Add(lstrLinkFileNameAbsolute);
                    }
                }&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2016 11:16:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063373#M67274</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2016-03-01T11:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063378#M67275</link>
      <description>&lt;P&gt;Cool!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you, Dave!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please confirm, Philippe.&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, 01 Mar 2016 11:18:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063378#M67275</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-03-01T11:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063387#M67276</link>
      <description>DaLe</description>
      <pubDate>Tue, 01 Mar 2016 11:24:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063387#M67276</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2016-03-01T11:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063433#M67277</link>
      <description>&lt;P&gt;sorry, mistake.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 12:04:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063433#M67277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T12:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063441#M67278</link>
      <description>&lt;P&gt;Sorry, DaLe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know very well, but somehow my fingers went off on their own accord, with no consultation with 'higher' instances.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They think they are Satoshi, too, you know!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All ten of them, even though I only use index plus middle for typing, and thumbs for some spaces or upper case... but they all insist regardless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry about that!&amp;nbsp;&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, 01 Mar 2016 12:07:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063441#M67278</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-03-01T12:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063565#M67279</link>
      <description>Thank you Dale..&lt;BR /&gt;&lt;BR /&gt;Philippe Meigneux.</description>
      <pubDate>Tue, 01 Mar 2016 13:16:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6063565#M67279</guid>
      <dc:creator>pmeigneux</dc:creator>
      <dc:date>2016-03-01T13:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6067613#M67280</link>
      <description>I suspect the code was originally from Jeremy, but I will accept kudos on his behalf...</description>
      <pubDate>Thu, 03 Mar 2016 09:13:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6067613#M67280</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2016-03-03T09:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to find pathname of linked dwg files ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6253928#M67281</link>
      <description>&lt;P&gt;To round off this, here is another code snippet demonstrating an equivalent solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;  FilteredElementCollector fec1 = new FilteredElementCollector(doc);
  fec1.OfClass(typeof(ImportInstance));
  
  Element element = fec1.FirstElement();            
  Element elementType = doc.GetElement(element.GetTypeId());
  
  ExternalFileReference exRefType = null;
  
  try 
  {
    exRefType = elementType.GetExternalFileReference();
  }
  catch (Exception e)
  {
  }
  
  TaskDialog.Show("ExtFileRef", "Type: "
    + ModelPathUtils.ConvertModelPathToUserVisiblePath(
      exRefType.GetPath()));&lt;/PRE&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>Wed, 06 Apr 2016 08:48:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-find-pathname-of-linked-dwg-files/m-p/6253928#M67281</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-04-06T08:48:59Z</dc:date>
    </item>
  </channel>
</rss>

