Hi,
After the code logic runs, I’m trying to call the rhino “_Export” command to export the currently selected objects, but the save dialog doesn’t appear.
I need the save dialog to appear.
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
bool foundObjectsWithoutCWName = false;
var selectedObjects = doc.Objects.GetSelectedObjects(false, false);
var selectedObjectIds = new List<Guid>();
foreach (var obj in selectedObjects)
{
selectedObjectIds.Add(obj.Id);
}
if (selectedObjects == null)
return Result.Nothing;
foreach (var obj in selectedObjects)
{
if (obj == null)
continue;
var attributes = obj.Attributes.Duplicate();
if (attributes.GetUserString("Test") == null)
{
var layerName = doc.Layers[obj.Attributes.LayerIndex].Name;
attributes.SetUserString("Test", layerName);
obj.Attributes = attributes;
obj.CommitChanges();
foundObjectsWithoutCWName = true;
}
}
if (foundObjectsWithoutCWName)
{
doc.Views.Redraw();
}
RhinoApp.RunScript("_Export ", true);
return Result.Success;
}