<?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: VB.NET EQUIVALENT FOR THISDRAWING.PATH in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145806#M43361</link>
    <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;But are there two different properties that returns the Filename seperate from the path?</description>
    <pubDate>Thu, 10 Jul 2014 22:23:01 GMT</pubDate>
    <dc:creator>TTIII</dc:creator>
    <dc:date>2014-07-10T22:23:01Z</dc:date>
    <item>
      <title>VB.NET EQUIVALENT FOR THISDRAWING.PATH</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145672#M43359</link>
      <description>&lt;P&gt;Hello Everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first post here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a bunch of code working just fine in VBA, Im trying to migrate this over to VB.NET.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting FATAL ERRORS on&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MsgBox(ThisDrawing.Path)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHY??????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked in the online help in "AutoCAD .NET Developer's Guide 2015".&lt;/P&gt;&lt;P&gt;I saw the line on "VBA to VB.NET and C# Comparison (.NET)" that mentions Thisdrawing but it still doesnt help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have also searched the .NET section of this forum (Yes I actually use the Search function)&lt;BR /&gt;Below is my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Option Explicit On

'************Imports******************
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
'*************************************
Imports Autodesk.AutoCAD.ApplicationServices
'Imports Autodesk.AutoCAD.Interop
'*************************************
Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension

Namespace myTest
    Public Class myTest
        Public ThisDrawing As AutoCAD.AcadDocument                                                     
        &amp;lt;CommandMethod("myTest")&amp;gt;
        Sub myTest()
            MsgBox(ThisDrawing.ActiveDocument.Path)
        End Sub
   End Class
End Namespace&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2014 21:16:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145672#M43359</guid>
      <dc:creator>TTIII</dc:creator>
      <dc:date>2014-07-10T21:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: VB.NET EQUIVALENT FOR THISDRAWING.PATH</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145770#M43360</link>
      <description>&lt;P&gt;The .NET equivalent of ThisDrawing is Application.DocumentManager.mdiActiveDocument.Database. The Database class has a Filename property that returns the DWG filepath and name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're new to the AutoCAD .NET API, I'd recommend you review the learning resources available on &lt;A href="http://www.autodesk.com/developautocad" target="_blank"&gt;www.autodesk.com/developautocad&lt;/A&gt; - My First Plugin and the Training Labs.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2014 22:06:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145770#M43360</guid>
      <dc:creator>StephenPreston</dc:creator>
      <dc:date>2014-07-10T22:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: VB.NET EQUIVALENT FOR THISDRAWING.PATH</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145806#M43361</link>
      <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;But are there two different properties that returns the Filename seperate from the path?</description>
      <pubDate>Thu, 10 Jul 2014 22:23:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5145806#M43361</guid>
      <dc:creator>TTIII</dc:creator>
      <dc:date>2014-07-10T22:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: VB.NET EQUIVALENT FOR THISDRAWING.PATH</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5146274#M43362</link>
      <description>You can use the System.Io.Path functions to extract name and path from a fullpathname</description>
      <pubDate>Fri, 11 Jul 2014 07:04:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5146274#M43362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-11T07:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: VB.NET EQUIVALENT FOR THISDRAWING.PATH</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5147092#M43363</link>
      <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;For everyone else that might have this issue, this is what I did;&lt;BR /&gt;&lt;BR /&gt;Public ThisDrawing as Document = Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;&lt;BR /&gt;For the name I used fso (as FileSystemObject) and did this:&lt;BR /&gt;&lt;BR /&gt;Dim MyDrawingName as String&lt;BR /&gt;MyDrawingName = fso.GetFileName(ThisDrawing.Name)</description>
      <pubDate>Fri, 11 Jul 2014 13:55:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5147092#M43363</guid>
      <dc:creator>TTIII</dc:creator>
      <dc:date>2014-07-11T13:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: VB.NET EQUIVALENT FOR THISDRAWING.PATH</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5148106#M43364</link>
      <description>&lt;P&gt;Using FileSystemObject (from Scripting COM component) is bad choice unless you want to limit your CAD application to run only on your computer or computers that has the exactly the same configuration as yours. Using FileSystemObject Introduces unnecessary external dependency (Scripting COM library, which may not present in other computers, or may have different version of the libarray), not to mention that there is also a .NET interop DLL is to be distributed if other computers need to run your app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;,NET framework provided built-in file handling functionaliy as mcicognani suggested (System.IO.Path).&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 19:05:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-equivalent-for-thisdrawing-path/m-p/5148106#M43364</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2014-07-11T19:05:16Z</dc:date>
    </item>
  </channel>
</rss>

