Copying assembly with relative paths

Whenever I copy and assembly with all its parts to another directory, it still links to the old part files.

How can I link to the parts in the new (copied) directory?

SolidworksAssemblies
Answers 5
GS
GS 2012-09-30 Best Answer

Instead of copying the assembly, do Pack and Go.  With the assembly open, choose File > Pack and Go.  That will bring up a dialog box where you select a location to copy the assembly and all its components.  You can also re-name the files in this dialog box if you want.  And that operation will break the links to the old files.

You can also do Pack and Go with a drawing to move a copy of the drawing and all the files it's referencing to a new location.

The Pack and Go operation is really nice if you want to make some changes to an assembly, but you also want to save the original.

SF
SF 2012-09-30

Thanks, this sound like a good solution for the future.

But for now I have an assembly with some parts in the current dir. and other in the old one.

Can I determine where is each one?

And will the pack and go keep the dir. structure? (subdirs etc.)

GS
GS 2012-09-30
<p>or Cohen wrote:</p><p></p><p><br> But for now I have an assembly with some parts in the current dir. and other in the old one.</p><p>Can I determine where is each one?</p>

Go to SolidWorks Explorer and find the assembly.  Click on it to highlight it, then click the References tab.  You will get a list of parts (or sub-assemblies, if any) with their location, that are referenced by the assembly.  You can RMB on any of them and choose "Replace" from the list, which will take you to a dialog box where you can choose a new file to replace the one you've chosen.

<p>or Cohen wrote:</p><p></p><p> <br>And will the pack and go keep the dir. structure? (subdirs etc.)</p>

If you mean folder structure, with sub-folders, the normal procedure is to place the new main assembly and all it's components in a single folder.  I've never tried it, but I believe you can save components to different folders by double clicking on the box beside the component in the "Save to Folder" column (see my post in this discussion for a picture) to change this.  I know that you can use this procedure to give the new components different names while maintaining the link to the main assembly so I assume it's the same for saving them to a different folder.

SF
SF 2012-10-01

did u try this ?

- GetDependencies and then copy

        Dim retVal As Long

        Dim Copyopt As Long

        Copyopt = SwConst.swMoveCopyOptions_e.swMoveCopyOptionsOverwriteExistingDocs

        retVal = swApp.CopyDocument(sourceFile, destFile, "", "", Copyopt)

LM
LM 2016-09-23

Hi Cohen,

I usually do these:

1) Close Solidworks if opened.

2) Copy and paste the folder with the the assembly and the linked parts

3) Move the old folder to a new position, I usually move it to the desktop.

4) Open the assembly in the new folder and save it and all the links are moved to your new folder.

5) Move back the old folder to its original position.

To check the model document path of a part in the assembly i do these:

1) open the assembly

2) right click on the part

3) select component properties (icon top right)

4) 5th line: model document path