Skip to content
18 changes: 18 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4162,4 +4162,12 @@ To make this file into a new template, save it to a different folder, then move
<data name="PreferencesViewEnableNodeAutoCompleteNewUITooltipText" xml:space="preserve">
<value>Enable the new floating menu for node suggestions for a more streamlined workflow. Turn off to return to the traditional pop-up dialog.</value>
</data>
<data name="DynamoViewDebugMenuDumpNodeIcons" xml:space="preserve">
<value>_Dump Node Icon Data</value>
<comment>Debug menu | Dump all node icon data</comment>
</data>
<data name="NodeIconDataIsDumped" xml:space="preserve">
<value>Node Icon Data is dumped to \"{0}\".</value>
<comment>Debug menu | Dump all node icons</comment>
</data>
</root>
8 changes: 8 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4146,4 +4146,12 @@ To make this file into a new template, save it to a different folder, then move
<data name="GroupFrozenButtonToolTip" xml:space="preserve">
<value>This group is frozen. Click to unfreeze.</value>
</data>
<data name="DynamoViewDebugMenuDumpNodeIcons" xml:space="preserve">
<value>_Dump Node Icon Data</value>
<comment>Debug menu | Dump all node icon data</comment>
</data>
<data name="NodeIconDataIsDumped" xml:space="preserve">
<value>Node Icon Data is dumped to \"{0}\".</value>
<comment>Debug menu | Dump all node icons</comment>
</data>
</root>
4 changes: 4 additions & 0 deletions src/DynamoCoreWpf/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,8 @@ Dynamo.ViewModels.DynamoViewModel.DumpLibraryToXmlCommand.get -> Dynamo.UI.Comma
Dynamo.ViewModels.DynamoViewModel.DumpLibraryToXmlCommand.set -> void
Dynamo.ViewModels.DynamoViewModel.DumpNodeHelpDataCommand.get -> Dynamo.UI.Commands.DelegateCommand
Dynamo.ViewModels.DynamoViewModel.DumpNodeHelpDataCommand.set -> void
Dynamo.ViewModels.DynamoViewModel.DumpNodeIconsCommand.get -> Dynamo.UI.Commands.DelegateCommand
Dynamo.ViewModels.DynamoViewModel.DumpNodeIconsCommand.set -> void
Dynamo.ViewModels.DynamoViewModel.DynamoViewModel(Dynamo.ViewModels.DynamoViewModel.StartConfiguration startConfiguration) -> void
Dynamo.ViewModels.DynamoViewModel.EditName.get -> string
Dynamo.ViewModels.DynamoViewModel.EditName.set -> void
Expand Down Expand Up @@ -4674,6 +4676,7 @@ static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuDebugModes.get -> stri
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuDumpData.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuDumpLibrary.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuDumpNodeHelpData.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuDumpNodeIcons.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuForceReExecute.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuForceUpdate.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewDebugMenuRunMutationTest.get -> string
Expand Down Expand Up @@ -5081,6 +5084,7 @@ static Dynamo.Wpf.Properties.Resources.NodeContextMenuPreview.get -> string
static Dynamo.Wpf.Properties.Resources.NodeContextMenuRenameNode.get -> string
static Dynamo.Wpf.Properties.Resources.NodeContextMenuShowLabels.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpIsDumped.get -> string
static Dynamo.Wpf.Properties.Resources.NodeIconDataIsDumped.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeCategory.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeDescription.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeInput.get -> string
Expand Down
43 changes: 43 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4302,6 +4302,45 @@ internal void DumpNodeHelpData(object parameter)
File.WriteAllText(fullFileName, stat.ToString());
}

internal void DumpNodeIconData(object parameter)
Comment thread
johnpierson marked this conversation as resolved.
{
//set to manual run mode to prevent execution of the nodes as wel place them
this.HomeSpace.RunSettings.RunType = RunType.Manual;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For manual run mode? Because I’m placing real nodes to get their view model which reports the icon source. Node model and node search element don’t report icon source. And placing real nodes causes hangups if on run automatic because of default values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I understand this correctly - you're placing nodes in the canvas that don't have icons to identify them so icons can be added for them?

@johnpierson johnpierson Jun 12, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my knowledge, one of the easiest ways to find if a node has an icon is to get its view model and get ‘IconSource’, so I’m placing the nodes on the canvas to get that and it also serves as a way for the end user to see the nodes themselves.

This is all for a tool to help identify nodes with missing icons.


string nodesWithoutIconsFileName = String.Format("NodesWithoutIcons_{0}.csv", DateTime.Now.ToString("yyyyMMddHmmss"));
string nodesWithoutIconsFullFileName = Path.Combine(Model.PathManager.LogDirectory, nodesWithoutIconsFileName);

//creating a copy to avoid collection changed exceptions
var entriesCopy = Model.SearchModel.Entries.Where(n => n.IsVisibleInSearch).ToList();

StreamWriter sw = File.CreateText(nodesWithoutIconsFullFileName);

sw.WriteLine("NODE ASSEMBLY,NODE NAME");

foreach (var nse in entriesCopy)
{
var newNode = nse.CreateNode();
this.CurrentSpace.AddAndRegisterNode(newNode);
var placedNode = this.CurrentSpaceViewModel.Nodes.Last();
var imageSource = placedNode.ImageSource;

//if image source is null, then no icon is found
if (imageSource is null)
Comment thread
johnpierson marked this conversation as resolved.
{
sw.WriteLine($"{nse.Assembly},{nse.Name}");
}
else
{
this.Model.ExecuteCommand(new DynamoModel.DeleteModelCommand(placedNode.Id));
}
}

sw.Close();

//alert user to new file location
MainGuideManager.CreateRealTimeInfoWindow(string.Format(Resources.NodeIconDataIsDumped, nodesWithoutIconsFullFileName), true);
}

private FileInfo GetMatchingDocFromDirectory(string nodeName, string hash, List<string> suffix, DirectoryInfo dir)
{
FileInfo matchingFile = null;
Expand All @@ -4325,6 +4364,10 @@ internal bool CanDumpNodeHelpData(object obj)
{
return true;
}
internal bool CanDumpNodeIconData(object obj)
{
return true;
}

#region Shutdown related methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private void InitializeDelegateCommands()
ShowAboutWindowCommand = new DelegateCommand(ShowAboutWindow, CanShowAboutWindow);
SetNumberFormatCommand = new DelegateCommand(SetNumberFormat, CanSetNumberFormat);
DumpNodeHelpDataCommand = new DelegateCommand(DumpNodeHelpData, CanDumpNodeHelpData);
DumpNodeIconsCommand = new DelegateCommand(DumpNodeIconData, CanDumpNodeIconData);
DumpLibraryToXmlCommand = new DelegateCommand(model.DumpLibraryToXml, model.CanDumpLibraryToXml);
ShowNewPresetsDialogCommand = new DelegateCommand(ShowNewPresetStateDialogAndMakePreset, CanShowNewPresetStateDialog);
NodeFromSelectionCommand = new DelegateCommand(CreateNodeFromSelection, CanCreateNodeFromSelection);
Expand Down Expand Up @@ -182,6 +183,7 @@ private void InitializeDelegateCommands()
public DelegateCommand CheckForLatestRenderCommand { get; set; }
public DelegateCommand DumpLibraryToXmlCommand { get; set; }
public DelegateCommand DumpNodeHelpDataCommand { get; set; }
public DelegateCommand DumpNodeIconsCommand { get; set; }
public DelegateCommand ShowNewPresetsDialogCommand { get; set; }
public DelegateCommand NodeFromSelectionCommand { get; set; }
public DelegateCommand OpenDocumentationLinkCommand { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,9 @@
<MenuItem Command="{Binding DumpNodeHelpDataCommand}"
Header="{x:Static p:Resources.DynamoViewDebugMenuDumpNodeHelpData}"
IsEnabled="True" />
<MenuItem Command="{Binding DumpNodeIconsCommand}"
Header="{x:Static p:Resources.DynamoViewDebugMenuDumpNodeIcons}"
IsEnabled="True" />
</MenuItem>
<MenuItem Name="DebugModes"
Click="OnDebugModesClick"
Expand Down
Loading