<?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: Export - Directory Not Found Exception in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622612#M82403</link>
    <description>Always, try a temp folder created on the root C drive.  Also one other thought, if you have too many slashes, I'm guessing here, but if the last folder name has a final slash does is have a cow with that?</description>
    <pubDate>Tue, 26 Jan 2010 22:31:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-01-26T22:31:13Z</dc:date>
    <item>
      <title>Export - Directory Not Found Exception</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622609#M82400</link>
      <description>I am trying to use the export method to export a view to dwg, but it keeps throwing a directory not found exception. Can someone please tell me what I am doing wrong? Here is my class:&lt;BR /&gt;
&lt;BR /&gt;
Imports System.IO&lt;BR /&gt;
Imports Autodesk.Revit&lt;BR /&gt;
&lt;BR /&gt;
Public Class rvtExport&lt;BR /&gt;
&lt;BR /&gt;
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;
    '  Export View to 2007 DWG&lt;BR /&gt;
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;
&lt;BR /&gt;
    Public Shared Function exportViewDWG(ByVal rvtapp As Autodesk.Revit.Application) As String&lt;BR /&gt;
&lt;BR /&gt;
        Dim str As String = Nothing&lt;BR /&gt;
        Dim viewSet As Autodesk.Revit.Elements.ViewSet = rvtapp.Create.NewViewSet&lt;BR /&gt;
        Dim expOpt As DWGExportOptions = rvtapp.Create.NewDWGExportOptions&lt;BR /&gt;
        Dim pathName As String = rvtapp.ActiveDocument.PathName&lt;BR /&gt;
        Dim folderName As String = Path.GetDirectoryName(pathName)&lt;BR /&gt;
        Dim fileName As String = "Test"&lt;BR /&gt;
&lt;BR /&gt;
        'select view&lt;BR /&gt;
        viewSet.Insert(rvtapp.ActiveDocument.ActiveView)&lt;BR /&gt;
&lt;BR /&gt;
        'set options&lt;BR /&gt;
        expOpt.ExportingAreas = False&lt;BR /&gt;
        expOpt.FileVersion = Enums.ACADVersion.Default&lt;BR /&gt;
        expOpt.ExportOfSolids = Enums.SolidGeometry.ACIS&lt;BR /&gt;
        expOpt.MergedViews = True&lt;BR /&gt;
        expOpt.SharedCoords = False&lt;BR /&gt;
        expOpt.TargetUnit = Autodesk.Revit.Enums.ExportUnit.Inch&lt;BR /&gt;
&lt;BR /&gt;
        Try&lt;BR /&gt;
            If rvtapp.ActiveDocument.Export(folderName, fileName, viewSet, expOpt) Then&lt;BR /&gt;
                str = "Exported " &amp;amp; folderName &amp;amp; fileName &amp;amp; vbCr&lt;BR /&gt;
            Else&lt;BR /&gt;
                str = "Failed to export " &amp;amp; folderName &amp;amp; fileName &amp;amp; vbCr&lt;BR /&gt;
            End If&lt;BR /&gt;
        Catch ex As System.IO.DirectoryNotFoundException&lt;BR /&gt;
            str = "Directory not found: " &amp;amp; ex.Message&lt;BR /&gt;
        End Try&lt;BR /&gt;
&lt;BR /&gt;
        Return str&lt;BR /&gt;
&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
End Class</description>
      <pubDate>Tue, 26 Jan 2010 22:03:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622609#M82400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-26T22:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Export - Directory Not Found Exception</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622610#M82401</link>
      <description>in your error, report to yourself the values for filename and foldername.  The problem is likely the folder path does not exist.  Check for errors such as missing slashes, or misspelled folders.  Make sure the folder in question is 'pre created'.&lt;BR /&gt;
jvj</description>
      <pubDate>Tue, 26 Jan 2010 22:20:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622610#M82401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-26T22:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Export - Directory Not Found Exception</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622611#M82402</link>
      <description>Jamie,&lt;BR /&gt;
&lt;BR /&gt;
I've made sure that the target folder does exist. In fact, I am using the same folder that the project is saved in. I have checked for formatting errors and missing slashes and am a complete loss. Could this be a security issue?</description>
      <pubDate>Tue, 26 Jan 2010 22:26:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622611#M82402</guid>
      <dc:creator>nmeek</dc:creator>
      <dc:date>2010-01-26T22:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Export - Directory Not Found Exception</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622612#M82403</link>
      <description>Always, try a temp folder created on the root C drive.  Also one other thought, if you have too many slashes, I'm guessing here, but if the last folder name has a final slash does is have a cow with that?</description>
      <pubDate>Tue, 26 Jan 2010 22:31:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622612#M82403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-26T22:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Export - Directory Not Found Exception</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622613#M82404</link>
      <description>I hate to think of all of the time I spent on this issue, but it is working. It seems that the exception is thrown only while debugging, and not while using the actual build. Do you know if this behavior is as intended?</description>
      <pubDate>Tue, 26 Jan 2010 23:00:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622613#M82404</guid>
      <dc:creator>nmeek</dc:creator>
      <dc:date>2010-01-26T23:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Export - Directory Not Found Exception</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622614#M82405</link>
      <description>There are several things you can turn on and off for debugging in the Visual Studio environment.  It could be a 'harmless' exception that the code continues without, but the debugger is capturing it just to let you know to write more solid code.  This is in a section called exceptions in the debug menu.  There are countless other places you can watch visual studio behave differently during debug mode vs run mode, some can be found in your project's properties section.  There's a lot to learn there and even I don't know it all.</description>
      <pubDate>Wed, 27 Jan 2010 15:04:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-directory-not-found-exception/m-p/2622614#M82405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-01-27T15:04:07Z</dc:date>
    </item>
  </channel>
</rss>

