Skip to content

Refactoring of assembly resolver to make it more reusable - #573

Open
adecler wants to merge 12 commits into
developfrom
BHoM_UI-#563-RefactorAssemblyResolver
Open

adecler wants to merge 12 commits into
developfrom
BHoM_UI-#563-RefactorAssemblyResolver

Conversation

@adecler

@adecler adecler commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Issues addressed by this PR

Closes #563

Makes the AssemblyResolver reusable by other UIs so that Revit_UI can stop front-loading all its assemblies, and keeps it working with the new BHoM_Engine serialiser. Grasshopper and Excel behaviour is unchanged apart from the points below.

  • AssemblyResolver can be inherited and extended at run time; its maps are built from IEnumerable<CodeElementRecord> and the helpers live in UI_Engine.
  • One assembly content file per UI (AssemblyContent_<UIName>.tsv) instead of a shared one, so a UI that cannot reflect part of an assembly cannot leave gaps for the others.
  • The assembly logic moves from Initialisation into the AssemblyResolver and reusable methods in UI_Engine.
  • Three fixes of the resolver for the new serialisation: first parameter type of methods (empty extension-method map), generic type lookup, commas in type strings (more details on those in the document attached below).
  • Assemblies are loaded before the toolkit settings so that the settings types resolve on the first launch.
  • The UI's own component types are registered with the resolver, which removes a "no assembly found for GetInfoCaller" warning.

Each commit is actually fairly simple (except maybe the first one) but it can be quite hard to decipher due the amount of code that is moved around. Here's a document that should hopefully help better understand the changes when going through each commit:
46_BHoM_UI_PR_Summary.md.

Test files

Not applicable. Checked by hand on Rhino 7, Rhino 8 and Excel (first and second start, with and without content file) and on Revit through the Revit_UI PR.

Changelog

  • AssemblyResolver can be inherited and extended more easily.
  • Each UI now keeps its own assembly content file (AssemblyContent_<UIName>.tsv); the first start after the update rebuilds it (slower once).
  • New public methods in UI_Engine: RefreshAssemblyContent, ReadCodeElementsFromFile, Merge, ExtensionMethodDictionary, TypeKey, AssemblyNamesInType; LoadNewAssemblies and CodeElements take an assembly name filter.

Additional comments

@adecler
adecler requested a review from IsakNaslundBh November 5, 2026 14:37
@adecler adecler self-assigned this Nov 5, 2026
@adecler adecler added the type:feature New capability or enhancement label Nov 5, 2026
@adecler adecler changed the title B ho m UI #563 refactor assembly resolver Refactoring of assembly resolver to make it more reusable Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the .tsv-based reflection system more flexible

1 participant