Prod.: Engine, ver.: 6, ID: 60000710, HowTo : Xrefs with relative path do not open

HowTo : Xrefs with relative path do not open

Article60000710
TypeHowTo
ProductEngine
Version6
Date Added12/15/2008
Submitted byLeif Andersson
Keywords

Subject

Xrefs with relative path do not open

Summary

Xrefs with relative path do not open when using the Open, while the open fine when using the OpenEx. For example if the drawing "aaaa.vdml" has an XRef file with path "..\bbbbb.vdml" then the xref will not show.

Solution

This is something that can be bypassed using the System.IO.Directory and set the application's current directory to the folder of the "master file" you need to open, like :

private void btOpen_Click(object sender, EventArgs e)
{
    System.IO.Directory.SetCurrentDirectory(@"C:\Documents and Settings\Administrator\Desktop\Drawings\11111\"); // without this, the "relative" to the master-drawing Xref-file will not open
    vdFramedControl1.BaseControl.ActiveDocument.Open(@"C:\Documents and Settings\Administrator\Desktop\Drawings\11111\aaaa.vdml");  // this is the master drawing
    // with an Xref file the drawing bbbbb.vdml in the  folder Desktop\Drawings (the ExternalReferencePath property has the value "..\bbbbb.vdml")
}