| Article | 60000710 |
| Type | HowTo |
| Product | Engine |
| Date Added | 12/15/2008 12:00:00 AM |
| Fixed | (12/15/2008 12:00:00 AM) |
| Submitted by | Leif Andersson |
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")
}
