<?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: Copy Assembly (Similar to PACK AND GO) in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651811#M144343</link>
    <description>Look up ReferencedDocuments in the API Help.  I'm pretty sure it will recurse the entire structure.</description>
    <pubDate>Fri, 19 Mar 2010 17:05:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-03-19T17:05:53Z</dc:date>
    <item>
      <title>Copy Assembly (Similar to PACK AND GO)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651810#M144342</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
Does anybody know if I can copy an assembly from the API to another folder, with all the referenced components including an excel spreadsheet. Something like doing the PACK AND GO but within the API.&lt;BR /&gt;
I have an intelligent model driven by one master part with a linked excel spreadsheet, I want to to use this assembly just as a read only,  and to make the changes in the new one.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Daniela</description>
      <pubDate>Fri, 19 Mar 2010 17:01:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651810#M144342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T17:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Assembly (Similar to PACK AND GO)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651811#M144343</link>
      <description>Look up ReferencedDocuments in the API Help.  I'm pretty sure it will recurse the entire structure.</description>
      <pubDate>Fri, 19 Mar 2010 17:05:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651811#M144343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T17:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Assembly (Similar to PACK AND GO)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651812#M144344</link>
      <description>Do you want to rename the files?  If not, then you can just copy the files &lt;BR /&gt;
as-is and make sure that your project only points to the new files.  If you &lt;BR /&gt;
want to rename the files then you'll need to update the references so they &lt;BR /&gt;
use the new names.  If you search back through this group for references to &lt;BR /&gt;
the FileSaveAs object in Apprentice I think you'll find some information. &lt;BR /&gt;
This object makes it relatively easy to do.&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Ekins&lt;BR /&gt;
Inventor API Product Designer&lt;BR /&gt;
http://blogs.autodesk.com/modthemachine</description>
      <pubDate>Fri, 19 Mar 2010 18:11:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651812#M144344</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T18:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Assembly (Similar to PACK AND GO)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651813#M144345</link>
      <description>Thank you very much Brian, I was getting too complicated with the code and it is just the basics of Inventor. I always read your blog and it is great.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Daniela Dubois</description>
      <pubDate>Fri, 19 Mar 2010 18:31:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651813#M144345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-19T18:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Assembly (Similar to PACK AND GO)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651814#M144346</link>
      <description>you can do this with the copy design tool in the SDK tools folder, I have redone this to work the way I want it to and it is very quick since it uses apprentice.&lt;BR /&gt;
&lt;BR /&gt;
this is how I have done this:&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
   Public Sub CopyAssembly()&lt;BR /&gt;
        Dim count As Integer = 0&lt;BR /&gt;
&lt;BR /&gt;
        Dim apprenticeServer As New Inventor.ApprenticeServerComponent&lt;BR /&gt;
        Dim oDoc As Inventor.ApprenticeServerDocument = apprenticeServer.Open(tbSelectedFile.Text)&lt;BR /&gt;
        Dim fileSaveAs As Inventor.FileSaveAs = apprenticeServer.FileSaveAs&lt;BR /&gt;
        fileSaveAs.AddFileToSave(oDoc, tbFullPathWName.Text)&lt;BR /&gt;
        Dim newFileNameWPath = FileNameWithoutExtension(tbFullPathWName.Text).Replace(FileExtension(tbSelectedFile.Text), Nothing)&lt;BR /&gt;
        'MsgBox(newFileNameWPath) 'for testing&lt;BR /&gt;
        count += 1&lt;BR /&gt;
        Try&lt;BR /&gt;
            ' Get all of the documents referenced by this document.&lt;BR /&gt;
            For Each referencedDoc As Inventor.ApprenticeServerDocument In oDoc.AllReferencedDocuments&lt;BR /&gt;
                Dim ext As String = FileExtension(referencedDoc.FullFileName)&lt;BR /&gt;
                If count &amp;lt; 10 Then&lt;BR /&gt;
                    fileSaveAs.AddFileToSave(referencedDoc, newFileNameWPath &amp;amp; "-0" &amp;amp; count &amp;amp; ext)&lt;BR /&gt;
                    'MsgBox(newFileNameWPath &amp;amp; "-0" &amp;amp; count &amp;amp; ext)&lt;BR /&gt;
                Else&lt;BR /&gt;
                    fileSaveAs.AddFileToSave(referencedDoc, newFileNameWPath &amp;amp; "-" &amp;amp; count &amp;amp; ext)&lt;BR /&gt;
                    ' MsgBox(newFileNameWPath &amp;amp; "-" &amp;amp; count &amp;amp; ext)&lt;BR /&gt;
                End If&lt;BR /&gt;
                count += 1&lt;BR /&gt;
            Next&lt;BR /&gt;
&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
&lt;BR /&gt;
        End Try&lt;BR /&gt;
&lt;BR /&gt;
        fileSaveAs.ExecuteSaveAs()&lt;BR /&gt;
        oDoc.Close()&lt;BR /&gt;
        apprenticeServer.Close()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
    Public Function FileNameWithoutExtension(ByVal FullPath As String) As String&lt;BR /&gt;
        Return System.IO.Path.GetFullPath(FullPath)&lt;BR /&gt;
    End Function&lt;BR /&gt;
    Public Function FileExtension(ByVal FullPath As String) As String&lt;BR /&gt;
        Return System.IO.Path.GetExtension(FullPath)&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
good luck..</description>
      <pubDate>Fri, 19 Mar 2010 23:00:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651814#M144346</guid>
      <dc:creator>Mike.Wohletz</dc:creator>
      <dc:date>2010-03-19T23:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Assembly (Similar to PACK AND GO)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651815#M144347</link>
      <description>Some times collection MainAssembly.AllReferencedDocuments (used in CopyDesign utility) really contains NOT all needed references.&lt;BR /&gt;
&lt;BR /&gt;
E.g., references to the linked Excel files can be found in the ReferencedOLEFileDescriptors collection of the specified document (master file in your case),&lt;BR /&gt;
References to the substitute parts (if they exist) can be found in either ReferencedFileDescriptors collection or ReferencedDocumentDescriptors collection of the main or referenced assembly documents.&lt;BR /&gt;
&lt;BR /&gt;
Who knows other exceptions?&lt;BR /&gt;
What else we need to consider to do the same as Pack’n’Go procedure?</description>
      <pubDate>Sat, 20 Mar 2010 12:15:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/copy-assembly-similar-to-pack-and-go/m-p/2651815#M144347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-20T12:15:58Z</dc:date>
    </item>
  </channel>
</rss>

