Hello,
I have a question (maybe dummy).
I create one file 3.dm 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?
Like:
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?
Willem
(Willem Derks)
June 13, 2019, 5:02pm
2
Thank you,
Can you give me some pratical example?
Thanks
dale
(Dale Fugier)
June 13, 2019, 10:34pm
4
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;
try
{
var f = File3dm.Read(filename);
foreach (var obj in f.Objects)
{
if (obj.Attributes.ObjectId == guid)
{
doc.Objects.Add(obj.Geometry, obj.Attributes);
doc.Views.Redraw();
break;
}
}
}
catch
{
RhinoApp.WriteLine("Error reading {0}.", filename);
}
return Result.Success;
}
– Dale
dale:
This should work:
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