I tried this program, but I cannot read the path of 3dm file.
protected override void ReadDocument(RhinoDoc doc, BinaryArchiveReader archive, FileReadOptions options)
{
// Read plug-in document data.
// If our document data is found in a 3DM file, we are
// required to read it. But, we don't necessarily want
// to use it.
// If the user is creating a new model, or opening an existing
// model, we'll want to keep the document data that we read.
// Otherwise, we'll read the data, but not use it. This way,
// we won't overwrite out data if the user is importing geometry,
// from another 3DM file.
// bool bKeepData = (options.NewMode || options.OpenMode) ? true : false;
// if (bKeepData)
// _stringTable.Clear();
// Read the major and minor version of the document data
int major = 0, minor = 0;
archive.Read3dmChunkVersion(out major, out minor);
string pathname="rh$";
// At this point, if we've changed the format of
// our document data, we'll want to compare the
// major and minor revision numbers and read our
// data accordingly.
try
{
pathname = archive.ReadString();
string nomefile = System.IO.Path.GetFileName(pathname);
string document = Rhino.RhinoDoc.ActiveDoc.Path;
//
// Here document =’’ <-----
//
var type = typeof(MainPanel);
MainPanel ppp = (MainPanel)Rhino.UI.Panels.GetPanel(type.GUID);
if ((pathname != null) && (System.IO.File.Exists(pathname)))
ppp.LoadJobsFile(pathname);
}
catch (System.Exception ex)
{
if (pathname.Contains("rh$") == false)
Rhino.RhinoApp.WriteLine("File jobs: {0} read failed!", ex.Message);
}
}