Expose 'Copy Path' while editing components
This commit is contained in:
parent
fd2c880704
commit
7957eed0db
1 changed files with 12 additions and 0 deletions
|
|
@ -174,6 +174,18 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedItem.Ancestors().OfType<ComponentObject3D>().FirstOrDefault() is ComponentObject3D componentAncestor
|
||||
&& !componentAncestor.Finalized)
|
||||
{
|
||||
var button = popupMenu.CreateMenuItem("Copy Path".Localize());
|
||||
button.Click += (s, e) =>
|
||||
{
|
||||
var selector = "$." + string.Join(".", selectedItem.AncestorsAndSelf().TakeWhile(o => !(o is ComponentObject3D)).Select(o => $"Children<{o.GetType().Name.ToString()}>").Reverse().ToArray());
|
||||
|
||||
Clipboard.Instance.SetText(selector);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return popupMenu;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue