diff --git a/Directory.Build.props b/Directory.Build.props index 41095c6..2e1e3cc 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ Extensions - 1.0.0 + 1.0.1 Assorted components for Grasshopper. Extensions Authors Copyright (c) 2021 $(Authors) diff --git a/RELEASE b/RELEASE index ae535a5..f08ef15 100644 --- a/RELEASE +++ b/RELEASE @@ -1,3 +1,6 @@ +- version: 1.0.1 + changes: + - Fix check for Robots plugin when loaded after Extensions. - version: 1.0.0 changes: - Updated to work with the latest Robots plugin. diff --git a/src/Extensions.Grasshopper/ExtensionsInfo.cs b/src/Extensions.Grasshopper/ExtensionsInfo.cs index 0bd681c..e209bc4 100644 --- a/src/Extensions.Grasshopper/ExtensionsInfo.cs +++ b/src/Extensions.Grasshopper/ExtensionsInfo.cs @@ -11,24 +11,16 @@ public class ExtensionsInfo : GH_AssemblyInfo public ExtensionsInfo() { - var componentServer = Instances.ComponentServer; - - if (componentServer.Libraries.Any(l => l.Name == "Robots")) + foreach (var folder in Folders.AssemblyFolders) { - IsRobotsInstalled = true; - return; - } - - componentServer.GHAFileLoaded += CheckLoadrobots; - } + var files = Directory.EnumerateFiles(folder.Folder, "Robots.gha", SearchOption.TopDirectoryOnly); - void CheckLoadrobots(object sender, GH_GHALoadingEventArgs e) - { - if (e.Name != "Robots") - return; - - IsRobotsInstalled = true; - Instances.ComponentServer.GHAFileLoaded -= CheckLoadrobots; + if (files.Any()) + { + IsRobotsInstalled = true; + break; + } + } } public override string Name => GetInfo().Product;