Hello. I want to batch process a number of 3dm files, and as i load them I want to know if the object type is a picture frame.
for example, if i want to extract all the surfaces from a file using this:
List<GeometryBase> result = new List<GeometryBase>();
try
{
File3dm rhinoFile = File3dm.Read(FilePath);
if (rhinoFile == null)
{
Print("Failed to open the Rhino file.");
return;
}
foreach (var obj in rhinoFile.Objects)
{
GeometryBase geometry = obj.Geometry;
if (geometry is Surface)result.Add(geometry);
else if (geometry is Brep) {
var brep = (Brep)geometry;
var bfaces = brep.Faces;
foreach (var srf in bfaces) if (srf is Surface) result.Add(srf);
}
}
}
catch (Exception ex) {Print ("Could not return objects");}
it also adds all the picture frames, which is not desireable. IsPictureFrame() can only be called on DocObjects.RhinoObject, and I failed to find a workaround or an alternative.