View Full Version : Stipping xref files
CadDog
2009-03-17, 09:35 PM
This is a two part question:
Part One:
Is there a way to stip off the path of an xref once it has already be attached.
Part Two:
Is there a way to stip off the path of an xref once it has already be attached using a batch or script file.
I ask the second question because I sure if there is one file there will be more. Our client doesn't want to see drive letter nor relative path on any sheet we are submitting.
Thanks and boy is it hard NOT using relative paths.
rkmcswain
2009-03-18, 01:42 PM
If you remove the path, then AutoCAD will only look for the xref in the current directory and the drawing directory. If the drawing is in one of these two locations, it will be found even if there is a full path saved (unless the drawing is found in the original location). So maybe you don't need to remove the full path...?
1. Yes, in the External References palatte.
2. Yes, using the Reference Manager (Start>Programs>Autodesk>....)
62504
irneb
2009-03-18, 07:03 PM
What you're wanting is exactly what eTransmit does. You need to create a transmittal setup similar to the attached ... ensure the "Place all files in one folder" is selected. Rename the setup to something you can remember later. You don't need to have it combined into a ZIP, the top drop-down does have an option for "Folder (set of files)".
This will create a new copy of the current drawing (as well as any xrefs contained therein). in the folder of your choice. Each will have its xref paths as .\Filename.DWG as they're all in the same folder. If you want to only remove a portion of the full path, then choose the "Use organized folder structure" option and browse to the "root" folder. Everything will then get relative paths from here.
For the 2nd option (scripting), you can then use the command line:FILEDIA 0
-ETRANSMIT CHoose SetupName
Create FileOrFolderToStore
FILEDIA 1
mweaver
2009-03-19, 04:39 AM
This is a two part question:
Part One:
Is there a way to stip off the path of an xref once it has already be attached.
Part Two:
Is there a way to stip off the path of an xref once it has already be attached using a batch or script file.
I ask the second question because I sure if there is one file there will be more. Our client doesn't want to see drive letter nor relative path on any sheet we are submitting.
Thanks and boy is it hard NOT using relative paths.
Part 1 can be accomplished with the following:(defun c:test()
(setq blocks (vla-get-blocks(vla-get-activedocument(vlax-get-acad-object))))
(vlax-for block blocks
(if (= :vlax-true (vlax-property-available-p block 'PATH))
(vla-put-path block (strcat (vla-get-name block) ".dwg"))
)
)
)
Part 2 can be accomplished by calling the routine above in a script. Another way would be with objectdbx but it is more complex, and a whole lot faster.
Part 2.5
After stripping the paths, you can move those xrefs to folders other than the folder with the referencing drawing if you set your projectname system variable and folders appropriately. From the help file:Use Project Names to Define Referenced Drawing Paths
Project names make it easier for you to manage xrefs when drawings are exchanged between customers or if you have different drive mappings to the same location on a server. The project name points to a section in the registry that can contain one or more search paths for each project name defined.
If the program cannot find an xref at the location specified by the search path, the prefix (if any) is stripped from the path. If the drawing has a PROJECTNAME value set and a corresponding entry exists in the registry, the program searches for the file along the project search paths. If the xref still is not located, the program search path is searched again.
You can add, remove, or modify the project names that exist in the registry. The folder search paths beneath the project name can also be added, removed, or modified.
The search paths beneath the project name can be added, removed, or modified in the same manner as the project name. The order in which the folders are searched can also be modified. Projects and their search paths can only be edited through the Files tab in the Options dialog box. You cannot edit project names at the Command prompt. But the project names and their associated paths can be changed via the registry. - mkw
Once you have established a project name and the search paths you want associated with that project name, you can make that project name the currently active project. The program searches the paths associated with that currently active project for xrefs that were not found in the current folder of the host drawing, the full search path, the current drawing folder, or the program support paths.
rkmcswain
2009-03-19, 12:58 PM
Part 2 can be accomplished by calling the routine above in a script. Another way would be with objectdbx but it is more complex, and a whole lot faster.
No need to do either really, that is what the Reference Manager does.
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.