<?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: Question on how to grab filepath for linked Excel Spreadsheets in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023536#M17561</link>
    <description>&lt;P&gt;I think you posted in CORRECT forum, because, as I said, you CANNOT have access to DataLink via AUtoCAD COM API.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2021 20:08:56 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2021-01-22T20:08:56Z</dc:date>
    <item>
      <title>Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10022913#M17556</link>
      <description>&lt;P&gt;Hello there, I have a question concerning extracting information from a AutoCAD Drawing. This drawing has a link to an Excel Spreadsheet, and my company wants to automate a way to grab data from that excel file and place it in a database. I can do that part, but I'm not all the familiar with using vb.net code to find things within the drawings; my question is there a way through VB to find out if a drawing has anything linked to a outside Excel file and if so, to grab that Excel file's filepath?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 16:18:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10022913#M17556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-22T16:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023015#M17557</link>
      <description>&lt;P&gt;There are multiple ways to "link" Excel sheet to a drawing:&lt;/P&gt;
&lt;P&gt;1. The old fashion of OLE linked/embedded; which is not recommended any longer years ago, but we could still see people use it to show data in drawing as a table.&lt;/P&gt;
&lt;P&gt;2. DataLink, which sets up the drawing to link a Excel sheet/sheet region, and then the data link is used as data source of AutoCAD table.&lt;/P&gt;
&lt;P&gt;3. An Excel sheet can be connected to a drawing with ODBC via "DBConnect" command (Data template/Label template). This approach is also not very popular lately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me assume you are talking "linked" by either 1, or 2, but more likely be 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. For Ole linked, you would write code to search drawing for Old2Frame entity, once found, you can test its peoprties "LinkName" and "LinkPath"&lt;/P&gt;
&lt;P&gt;2. For DataLink, you loop through DataLinkDictionary of the drawing database to gain access to each DataLink object, which has a "ConnectionString" property, which provides the information about the Excel sheet file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 16:54:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023015#M17557</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-01-22T16:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023209#M17558</link>
      <description>&lt;P&gt;Thank you for replying!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example then, if I open&amp;nbsp;a drawing in VB with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; cadApp &lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;As&lt;/FONT&gt; &lt;FONT face="Consolas" size="2" color="#2b91af"&gt;AcadApplication&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = &lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;New&lt;/FONT&gt; &lt;FONT face="Consolas" size="2" color="#2b91af"&gt;AcadApplication&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; dwg &lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;As&lt;/FONT&gt; &lt;FONT face="Consolas" size="2" color="#2b91af"&gt;AcadDocument&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = cadApp.Documents.Open(filename, &lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;False&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;I'd do something like &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;For each DataLinkDictory in dwg&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;to loop to find if any ConnectionStrings end in .xls and then grab that Excel filepath to open?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 18:04:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023209#M17558</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-22T18:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023513#M17559</link>
      <description>&lt;P&gt;Firstly, this forum's main focus is on AutoCAD .NET API, which can only be used INSIDE AutoCAD (DLLs netloaded into AutoCAD).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are to access data in drawings from EXE/stand-alone app, you can only use AutoCAD's COM API, which, unfortunately, does not have direct API access to DataLink. So, if your task is to deal with DataLink, you need to write AutoCAD plugin DLL using AutoCAD .NET API, which runs inside AutoCAD. I also feel you may need to firstly learn basic AutoCAD .NET API programming, to begin with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I am not sure how much you understand DataLink in AutoCAD. A DataLink set up in AutoCAD does not necessarily mean that the data in a Excel sheet is actually presented in the drawing, as Table entity, it is just a data link configuration. The data in Excel sheet would only be loaded into drawing and presented if one or more tables use the DataLink (also a table could use more than one DataLinks). So, depending on your actual business needs, you might actually want to search tables in AutoCAD drawing, and then to see if each table uses a DataLink or not. Again, you need to be able to write/test .NET API code to search drawing, for table entities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have rethink your solution's structure/workflow, now that you cannot directly have access to DataLink from extenal app via AutoCAD COM API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There were a couple of previous discussions on this topic that may be of help:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/get-datalink-path-from-closed-drawing-c/m-p/6349525#M48773" target="_self"&gt;https://forums.autodesk.com/t5/net/get-datalink-path-from-closed-drawing-c/m-p/6349525#M48773&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/autocad-table-and-datalink/m-p/9473409#M65469" target="_self"&gt;https://forums.autodesk.com/t5/net/autocad-table-and-datalink/m-p/9473409#M65469&lt;/A&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 20:02:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023513#M17559</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-01-22T20:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023529#M17560</link>
      <description>&lt;P&gt;I apologize, I think I posted this topic in the wrong section, I'm sorry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think now the more appropriate place for this topic is AutoCAD Customization.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 20:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023529#M17560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-22T20:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023536#M17561</link>
      <description>&lt;P&gt;I think you posted in CORRECT forum, because, as I said, you CANNOT have access to DataLink via AUtoCAD COM API.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 20:08:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023536#M17561</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-01-22T20:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023553#M17562</link>
      <description>&lt;P&gt;Hmm...must be another way then within VB to just simply grab the connectionstring without going into DataLink. I did use earlier code to do ATTOUT and extracted information that way, is there a command I can give AutoCAD to make a .txt with the connectionstrings from the DataLink in it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or a more simple way with vb code to get to it?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 20:17:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023553#M17562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-22T20:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Question on how to grab filepath for linked Excel Spreadsheets</title>
      <link>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023721#M17563</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hmm...must be another way then within VB to just simply grab ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You seem to think that VB (or whatever programming language) can do anything to AutoCAD without using/understanding AutoCAD exposed APIs (be it COM API, or .NET API). Think again: with knowing/using AutoCAD API, VB as programming language can do nothing meaningful with AutoCAD/AutoCAD drawing. DataLink in AutoCAD is exposed as DataLink class with .NET API, but is not exposed in AutoCAD COM API, so your said VB app (which is very vague/confusing way to call your app: it should be either EXE app, or DLL loaded into AutoCAD) cannot have access to DataLink, because you use AutoCAD COM API.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 21:25:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/question-on-how-to-grab-filepath-for-linked-excel-spreadsheets/m-p/10023721#M17563</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2021-01-22T21:25:20Z</dc:date>
    </item>
  </channel>
</rss>

