Updating file references in assembly's components

Jun 04, 2005 10 Replies

I have assemblies that were created in my work computer. I have copies of these assemblies that I am working with at home.



I have code that gets all components from each configuration in a selected assembly. Then I compare the path name of this component (Component2.GetPathName) to a stored path reference in a database.



This is where the problem arises - because the components are stored in a different location on my home computer, the location that is pointed to by Component2.GetPathName doesn't exist - it is still showing the location it was saved in at work, even when I manually open my assembly in SW and resave it.



Is there a way to update my component path names programatically?



Yet when I "SaveAS" and go into Edit referenced Paths, the correct paths show up

A question:

What is the status of TOOLS/OPTIONS/EXTERNAL REFERENCES Search References on both systems?

What do you have in TOOLS/OPTIONS/FILE LOCATIONS/REFERENCES on both systems?

External References:

Load referenced documents : All Update out of date linked design tables: Prompt Search File Locations for external references: Checked Update component names when documents are replaced: Checked All else: Unchecked

TOOLS/OPTIONS/FILE LOCATIONS/REFERENCED DOCUMENTS : Nothing set(Blank list)

Warning! I know nothing about macros and the real guts of SolidWorks. I am just reporting what we have observed while working with SofTech on some ProductCenter issues. It seems that the path name for a part or assembly doesn't change in the ways that you might expect. It seems to be more or less permanently set when the part is initially made or saved as a copy.

Jerry Steiger Tripod Data Systems "take the garbage out, dear"

You might want to read the documentation on External References in help. You will have to read it carefully several time to really understand it.

If you can create the same directory structure on your home system and the one at work and use search references it is possible to get some measure of consistency. XCopy can duplicate a directory structure.

You also have to be very careful about the "lineage" of your files. Once you modify a file at home you must either never allow it to get back to work or ensure that nobody at work has grabbed a copy and worked with it when there is a possibility they will save it over the one you had changed.

There is a really important principal with SW and that is that there should be one part with one filename.

The files I am using at home are for nothing but to test my code on, which I AM changing at home. These SW files are never going to make it back to work, so any changes won't really matter.

I am/was just hoping for a way to change/update these external references that I am getting with "Component2.GetpathName". Having this give an incorrect path makes it impossble to go any farther with my programming at home at this point.

On the TOOLS/OPTIONS/SYSTEM/PERFORMANCE dialog what are the settings in the assemblies area? Are they the same at work and at home?

What I am getting at is to ask whether the components were / are lightweight?

Funny - I was just coming back to say that I had solved my problem : Yes - the components I was having the problem with were lightweight. Changing their suppression state to fully-resolved before reading the path name gives me the correct and up to date path. Should have seen that earlier.

Thanks for the help

~Sean

Can't You put the assembly You're working on in a briefcase. Then you just need to update when You're back at the office. I do like this all the time and it works quite all right as long as I update before anyone else start working on the files.

Krister L

"What-a-Tool" skrev i meddelandet news:nq9oe.9380$%Z2.3834@lakeread08...

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required