I’m import one or more 3dm files.
I want to get those importing rhinoobjects, mesh, face, line and so on.
How to do it ?
How do you import the file? Do you use the import command or do you open the file in code using File3dm.Read
?
I import the file by Runscript.
Like below.
String sScript = String.Format("! _-Import {0} _S=_N _Enter", openFileDlg.FileName);
uint FirstSN = RhinoObject.NextRuntimeSerialNumber;
RhinoApp.RunScript( sScript, false );
uint LastSN = RhinoObject.NextRuntimeSerialNumber;
I guess you could do, after import:
List<RhinoObject> imported = new List<RhinoObject>();
foreach(RhinoObject obj in doc.Objects)
{
if (obj.RuntimeSerialNumber >= FirstSN && obj.RuntimeSerialNumber < LastSN)
imported.Add(obj);
}
Then, test the imported objects to see what they represent:
foreach(RhinoObject obj in imported)
{
switch(obj.ObjectType)
{
case (ObjectType.Mesh):
//handle mesh
break;
case (ObjectType.Curve):
// handle curve
break;
default: // unhandled types
break;
}
}
Thank you for help.
It’s been a while.