Updating file references in assembly's components

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?
Reply to
What-a-Tool
Loading thread data ...
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?
Reply to
TOP
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)
Reply to
What-a-Tool
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"
Reply to
Jerry Steiger
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.
Reply to
TOP
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.
Reply to
What-a-Tool
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?
Reply to
TOP
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
Reply to
What-a-Tool
One additional problem you might run into. I have noticed that references (especially the defunct kind) can hang around for a long time if there is a configuration that is never resolved in any level assembly or if a part or assembly is suppressed. It can be a real pain to flush out this kind of defunct toe-lint.
What-a-Tool wrote:
Reply to
P.
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...
Reply to
Krister L

Site Timeline

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.