<?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 - copy drawing sheet from one drawing to another in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047620#M154267</link>
    <description>&lt;P&gt;Here is a similar iLogic rule that will either silently open the template drawing, without using an open file dialog, or can use the open file dialog, depending on which lines you leave commented out.&amp;nbsp; If not using the open file dialog, make sure the path and name of the template drawing are correct in the rule before running it.&amp;nbsp; Since I am not sure which 'named' sheets you want to copy over, I removed the 'filter' question, and the code will now try to copy all sheets over.&amp;nbsp; If you need it to be more specific, I would need to know how to filter for which sheets to copy.&amp;nbsp; If there is a list of specific sheet names, we could include them into the rule, as the filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
		MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
		Exit Sub
	End If
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim sTemplatesPath As String = ThisApplication.DesignProjectManager.ActiveDesignProject.TemplatesPath
	Dim sTemplateFile As String = sTemplatesPath &amp;amp; "\Drawing.idw" '&amp;lt;&amp;lt;&amp;lt; EDIT THIS &amp;gt;&amp;gt;&amp;gt;&amp;gt;
	'Dim sTemplateFile As String = BrowseForDrawing 'calls the custom Function below
	'If sTemplateFile = "" Then Exit Sub
	Dim oTemplate As DrawingDocument = ThisApplication.Documents.Open(sTemplateFile, False)
	For Each oSheet As Sheet In oTemplate.Sheets
		oSheet.CopyTo(oDDoc)
	Next
	oDDoc.Update2(True)
End Sub

Function BrowseForDrawing() As String
	Dim oFileDialog As Inventor.FileDialog
	ThisApplication.CreateFileDialog(oFileDialog)
	oFileDialog.DialogTitle = "Select Source Template Drawing."
	oFileDialog.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
	oFileDialog.Filter = "Autodesk Inventor Drawings (*.dwg;*.idw) | *.dwg;*.idw"
	oFileDialog.MultiSelectEnabled = False
	oFileDialog.OptionsEnabled = False
	oFileDialog.CancelError = True
	oFileDialog.InsertMode = False
	Try
		oFileDialog.ShowOpen
	Catch
	End Try
	Return oFileDialog.FileName
End Function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2023 18:51:49 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2023-06-20T18:51:49Z</dc:date>
    <item>
      <title>Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/9651542#M113647</link>
      <description>&lt;P&gt;Good Day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to copy a drawing sheet to a main drawing.&lt;/P&gt;&lt;P&gt;I would like my main drawing to be a machine GA,&amp;nbsp; but from this drawing I would like to run a rule to search for the shop detailing drawings and copy their relevant sheets to my main GA drawing to create an all in one drawing file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this silently (without visibly opening the the shop detail drawing)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 14:19:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/9651542#M113647</guid>
      <dc:creator>shaun59G6W</dc:creator>
      <dc:date>2020-07-23T14:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/9651821#M113660</link>
      <description>&lt;P&gt;Here's one way of doing it.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Drawing Documents.",vbOK, "WRONG DOCUMENT TYPE")
	Return
End If

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oOtherDocPath As String = "C:\Temp\MasterDrawing.idw"
Dim oOtherDrawing As DrawingDocument = ThisApplication.Documents.Open(oOtherDocPath,False)
For Each oSheet As Sheet In oDDoc.Sheets
	If oSheet.Name.Contains("Shop") Then
		oSheet.CopyTo(oOtherDrawing)
	End If
Next&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Jul 2020 16:14:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/9651821#M113660</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-07-23T16:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/9658977#M113805</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With a couple of tweaks to suit my application your solution worked perfectly&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 07:33:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/9658977#M113805</guid>
      <dc:creator>shaun59G6W</dc:creator>
      <dc:date>2020-07-28T07:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047534#M154263</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is possible to change:&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;from:&lt;/STRONG&gt;&lt;/U&gt; adresse&amp;nbsp; fixe&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;to:&lt;/STRONG&gt;&lt;/U&gt; Open drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I like to copy sheets from tamplate withs notes and details to new drawing&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 18:09:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047534#M154263</guid>
      <dc:creator>denis.semeniuc</dc:creator>
      <dc:date>2023-06-20T18:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047570#M154265</link>
      <description>&lt;P&gt;Sure.&amp;nbsp; Which way would you prefer the rule to work:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The 'new' drawing will be the 'active' drawing when you run the rule, then you open the template drawing (using open dialog) and copy sheets from the template into the new/active drawing.&lt;/LI&gt;
&lt;LI&gt;The template drawing will be the 'active' drawing when you run the rule, then you open the 'other' drawing (using open dialog), and copy the sheets from the template to the 'other' drawing.&lt;/LI&gt;
&lt;LI&gt;The 'new' drawing will be the 'active' drawing when you run the rule, and the template file's full file name is hard coded into the rule (no open dialog needed), so it will invisibly open the template in the background, and copies the sheets to the active drawing.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 20 Jun 2023 18:22:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047570#M154265</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-20T18:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047584#M154266</link>
      <description>le chois #3 et prefereble.&lt;BR /&gt;Quand je suis dans nouv dessin et execut la regle, les pages nomée va apparetre sur mon nouv dessin.</description>
      <pubDate>Tue, 20 Jun 2023 18:26:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047584#M154266</guid>
      <dc:creator>denis.semeniuc</dc:creator>
      <dc:date>2023-06-20T18:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic - copy drawing sheet from one drawing to another</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047620#M154267</link>
      <description>&lt;P&gt;Here is a similar iLogic rule that will either silently open the template drawing, without using an open file dialog, or can use the open file dialog, depending on which lines you leave commented out.&amp;nbsp; If not using the open file dialog, make sure the path and name of the template drawing are correct in the rule before running it.&amp;nbsp; Since I am not sure which 'named' sheets you want to copy over, I removed the 'filter' question, and the code will now try to copy all sheets over.&amp;nbsp; If you need it to be more specific, I would need to know how to filter for which sheets to copy.&amp;nbsp; If there is a list of specific sheet names, we could include them into the rule, as the filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
		MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
		Exit Sub
	End If
	Dim oDDoc As DrawingDocument = ThisDoc.Document
	Dim sTemplatesPath As String = ThisApplication.DesignProjectManager.ActiveDesignProject.TemplatesPath
	Dim sTemplateFile As String = sTemplatesPath &amp;amp; "\Drawing.idw" '&amp;lt;&amp;lt;&amp;lt; EDIT THIS &amp;gt;&amp;gt;&amp;gt;&amp;gt;
	'Dim sTemplateFile As String = BrowseForDrawing 'calls the custom Function below
	'If sTemplateFile = "" Then Exit Sub
	Dim oTemplate As DrawingDocument = ThisApplication.Documents.Open(sTemplateFile, False)
	For Each oSheet As Sheet In oTemplate.Sheets
		oSheet.CopyTo(oDDoc)
	Next
	oDDoc.Update2(True)
End Sub

Function BrowseForDrawing() As String
	Dim oFileDialog As Inventor.FileDialog
	ThisApplication.CreateFileDialog(oFileDialog)
	oFileDialog.DialogTitle = "Select Source Template Drawing."
	oFileDialog.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
	oFileDialog.Filter = "Autodesk Inventor Drawings (*.dwg;*.idw) | *.dwg;*.idw"
	oFileDialog.MultiSelectEnabled = False
	oFileDialog.OptionsEnabled = False
	oFileDialog.CancelError = True
	oFileDialog.InsertMode = False
	Try
		oFileDialog.ShowOpen
	Catch
	End Try
	Return oFileDialog.FileName
End Function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 18:51:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-copy-drawing-sheet-from-one-drawing-to-another/m-p/12047620#M154267</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-06-20T18:51:49Z</dc:date>
    </item>
  </channel>
</rss>

