Import parcial file obj


I have a question (maybe dummy).

I create one file with some objetcs inside and save it like “test.3dm”, so I know all
guid id inside the teste.3dm.

The dummy question:is it possible to import only one specific guid and not all?


        string guid = "C934BBDD-BD73-48A6-A35A-7C5F8B0EDE82";

        var allObj = Get all objetcs inside teste.3dm;

        foreach (var item in allObj)
            if (item==guid)
                Import item;


This is possible?

Hi Ricardo

This could be done with

Does that help?

Thank you,

Can you give me some pratical example?


Hi @MatrixRatrix,

This should work:

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
  var guid = new Guid("49e96c23-6ab7-4ad2-a299-37099665d241");

  var dialog = new OpenFileDialog
    Filter = @"Rhino 3D Models (*.3dm)|*.3dm",
    DefaultExt = "3dm"
  var rc = dialog.ShowDialog();
  if (rc != DialogResult.OK)
    return Result.Cancel;

  var filename = dialog.FileName;
  if (string.IsNullOrEmpty(filename) || !File.Exists(filename))
    return Result.Failure;

    var f = File3dm.Read(filename);
    foreach (var obj in f.Objects)
      if (obj.Attributes.ObjectId == guid)
        doc.Objects.Add(obj.Geometry, obj.Attributes);
    RhinoApp.WriteLine("Error reading {0}.", filename);

  return Result.Success;

– Dale

Hello @dale,

Yes this work.

If I want add the intire group?

One more thing, I make a small example with only two geometry, seams that
this mode is a bit slow, there is some more fast way?

Thank you