本文整理汇总了C#中Rhino.Read3dmChunkVersion方法的典型用法代码示例。如果您正苦于以下问题:C# Rhino.Read3dmChunkVersion方法的具体用法?C# Rhino.Read3dmChunkVersion怎么用?C# Rhino.Read3dmChunkVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino
的用法示例。
在下文中一共展示了Rhino.Read3dmChunkVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadDocument
//Called whenever a Rhino document is being loaded and plug-in user data was
//encountered written by a plug-in with this plug-in's GUID.
//
//If any ON_BinaryArchive::Read*() functions return false than you should
//immediately return false otherwise return true when all data was read.
protected override void ReadDocument(Rhino.RhinoDoc doc, Rhino.FileIO.BinaryArchiveReader archive, Rhino.FileIO.FileReadOptions options)
{
//Always read data in the EXACT same order you wrote it
int major, minor;
archive.Read3dmChunkVersion(out major, out minor);
//If you've changed your reading/writing code over time,
//you can use the version number of what you read
//to figure out what can be read from the archive
if ((major > 1 | minor > 0)) return;
//the data you read/write will probably be member variables of your plug-in class,
//but for simplicity this sample is just using locally defined strings
string date_string = archive.ReadString();
string time_string = archive.ReadString();
//Get the commands for "Insert_Source" and "Insert_Receiver". This is where the Source and Receiver conduits are stored.
UI.Pach_Source_Object S_command = Pach_Source_Object.Instance;
UI.Pach_Receiver_Object R_command = Pach_Receiver_Object.Instance;
System.Guid objectId = default(System.Guid);
string Type = null;
do
{
try
{
objectId = archive.ReadGuid();
Type = archive.ReadString();
if (Type == "Source")
{
Rhino.DocObjects.RhinoObject Source = doc.Objects.Find(objectId);
if (Source != null)
{
SourceConduit.Instance.SetSource(Source);
doc.Views.Redraw();
}
}
else if (Type == "Receiver")
{
Rhino.DocObjects.RhinoObject Receiver = doc.Objects.Find(objectId);
if (Receiver != null)
{
ReceiverConduit.Instance.SetReceiver(Receiver);
doc.Views.Redraw();
}
}
Type = null;
}catch(Exception)
{
break;
}
}
while (objectId != null);
}