<?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: iLogic SaveAs Autocad DWG only one sheet in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453744#M92234</link>
    <description>&lt;P&gt;Searching the Programmers API, for these options to be spelled out, use the Index and search for Translator Options page (or ShowSaveCopyAsOptions Method\TranslatorAddIn Object\Translator Options in Remarks - how I found it).&lt;/P&gt;
&lt;P&gt;Scroll down to the Export options for DWG and Definition of Export Values, and Sheets is listed as an option to manipulate.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Dec 2018 21:29:11 GMT</pubDate>
    <dc:creator>JamieVJohnson2</dc:creator>
    <dc:date>2018-12-07T21:29:11Z</dc:date>
    <item>
      <title>iLogic SaveAs Autocad DWG only one sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453236#M92222</link>
      <description>&lt;P&gt;I would like to know what the illogic code is to save an inventor drawing as an AutoCAD .dwg. However I only want to save the one sheet I specify. The current code I have below will save all the sheets, I want to specify which sheet it saves.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Version:1.0 StartHTML:00000145 EndHTML:00002174 StartFragment:00000294 EndFragment:00002142 StartSelection:00000294 EndSelection:00000294SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"1202_GLASS PRINT:30"&lt;/SPAN&gt;).&lt;SPAN&gt;Activate&lt;/SPAN&gt;

&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN&gt;"H:\EngCustomProducts\CustomGlass\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"1202-GateASM.iam.JobNo"&lt;/SPAN&gt;) &amp;amp; &lt;SPAN&gt;"-MG12CF.dwg"&lt;/SPAN&gt; , &lt;SPAN&gt;True&lt;/SPAN&gt;)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 17:18:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453236#M92222</guid>
      <dc:creator>josiah_pekary</dc:creator>
      <dc:date>2018-12-07T17:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic SaveAs Autocad DWG only one sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453697#M92232</link>
      <description>&lt;P&gt;When working this problem by hand, there is a checkbox in the options wizard, that allows you to select a specific sheet or sheets.&amp;nbsp; When I saved that configuration into a *.ini file, I noticed an option that says "ALL SHEETS=No" under [EXPORT DESTINATION], however that file did not mention the sheet I selected.&amp;nbsp; So at least I know there is access to this option.&lt;/P&gt;
&lt;P&gt;In this code, I export with a bit more direct control over the actual translator.&amp;nbsp; I suspect your answer lies in the oNameValueMap including something for the sheets to be printed.&lt;/P&gt;
&lt;PRE&gt;    Public Sub ExportACAD(settingsFile As String, isDWG As Boolean)
        Dim invApp As Inventor.Application = TTSInventorTools.GetInventorApplication
        ' Set a reference to the DWG translator add-in.
        Dim oDWGAddIn As TranslatorAddIn = Nothing
        'USE DWG OR DXF FIND "DESTNATION DXF=Yes or No" in ini file (text file)
        Dim ClassID As String = "{C24E3AC4-122E-11D5-8E91-0010B541CD80}"
        Dim ext As String = ".dxf"
        If isDWG Then
            ClassID = "{C24E3AC2-122E-11D5-8E91-0010B541CD80}" ' = DWG TRANSLATOR
            ext = ".dwg"
        End If
        Dim i As Long
        For i = 1 To invApp.ApplicationAddIns.Count()
            If invApp.ApplicationAddIns.Item(i).ClassIdString = ClassID Then
                oDWGAddIn = invApp.ApplicationAddIns.Item(i)
                Exit For
            End If
        Next
        If oDWGAddIn Is Nothing Then
            MsgBox("DWG add-in not found.", MsgBoxStyle.SystemModal)
            Exit Sub
        End If
        ' Check to make sure the add-in is activated.
        If Not oDWGAddIn.Activated Then
            oDWGAddIn.Activate()
        End If
        ' Create a name-value map to supply informationto the translator.
        Dim oNameValueMap As NameValueMap
        oNameValueMap = invApp.TransientObjects.CreateNameValueMap()
        ' Create the name-value that specifiesthe ini file to use.
        Call oNameValueMap.Add("Export_Acad_IniFile", settingsFile)
        ' Create a translation context and define that we want to output to a file.
        Dim oContext As TranslationContext
        oContext = invApp.TransientObjects.CreateTranslationContext()
        oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
        ' Define the type of output by specifying the filename.
        Dim oOutputFile As DataMedium
        oOutputFile = invApp.TransientObjects.CreateDataMedium()
        oOutputFile.FileName = ACADFilePath &amp;amp; "\" &amp;amp; Name &amp;amp; ext
        ' Call the SaveCopyAs method of the add-in.
        If Not System.IO.File.Exists(oOutputFile.FileName) Then
            System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(oOutputFile.FileName))
            oDWGAddIn.SaveCopyAs(docINV, oContext, oNameValueMap, oOutputFile)
        End If
    End Sub&lt;/PRE&gt;
&lt;P&gt;Not a complete answer but likely a point into the correct direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 20:59:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453697#M92232</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-12-07T20:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic SaveAs Autocad DWG only one sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453744#M92234</link>
      <description>&lt;P&gt;Searching the Programmers API, for these options to be spelled out, use the Index and search for Translator Options page (or ShowSaveCopyAsOptions Method\TranslatorAddIn Object\Translator Options in Remarks - how I found it).&lt;/P&gt;
&lt;P&gt;Scroll down to the Export options for DWG and Definition of Export Values, and Sheets is listed as an option to manipulate.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 21:29:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453744#M92234</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-12-07T21:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic SaveAs Autocad DWG only one sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453803#M92240</link>
      <description>&lt;P&gt;Thank you this works.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 21:58:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-saveas-autocad-dwg-only-one-sheet/m-p/8453803#M92240</guid>
      <dc:creator>josiah_pekary</dc:creator>
      <dc:date>2018-12-07T21:58:22Z</dc:date>
    </item>
  </channel>
</rss>

