Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bin/netcore/engines/IPY2712PR/pyRevitAssemblyBuilder.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY2712PR/pyRevitExtensionParser.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/netcore/engines/IPY2712PR/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY2712PR/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitAssemblyBuilder.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitExtensionParser.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2025.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2026.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2027.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/netcore/engines/IPY342/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.Common.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.CommonCLI.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.CommonWPF.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.DeffrelDB.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.Emojis.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.Language.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.PyRevit.Runtime.Shared.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.PyRevit.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.TargetApps.AutoCAD.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.TargetApps.Navisworks.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.TargetApps.Revit.dll
Binary file not shown.
Binary file modified bin/netcore/pyRevitLabs.UnitTests.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitAssemblyBuilder.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitExtensionParser.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2017.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2018.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2019.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2020.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2021.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2022.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2023.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLabs.PyRevit.Runtime.2024.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY2712PR/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitAssemblyBuilder.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitExtensionParser.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2017.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2018.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2019.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2020.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2021.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2022.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2023.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLabs.PyRevit.Runtime.2024.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/netfx/engines/IPY342/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.Common.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.CommonCLI.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.CommonWPF.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.DeffrelDB.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.Emojis.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.Language.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.PyRevit.Runtime.Shared.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.PyRevit.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.TargetApps.AutoCAD.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.TargetApps.Navisworks.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.TargetApps.Revit.dll
Binary file not shown.
Binary file modified bin/netfx/pyRevitLabs.UnitTests.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Common.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.CommonCLI.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.CommonWPF.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Language.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.PyRevit.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.TargetApps.Revit.dll
Binary file not shown.
Binary file modified bin/pyrevit-autocomplete.exe
Binary file not shown.
Binary file modified bin/pyrevit-doctor.dll
Binary file not shown.
Binary file modified bin/pyrevit-doctor.exe
Binary file not shown.
Binary file modified bin/pyrevit.dll
Binary file not shown.
Binary file modified bin/pyrevit.exe
Binary file not shown.
52 changes: 26 additions & 26 deletions dev/pyRevitLabs/pyRevitCLIAutoComplete/pyrevit-autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ func main() {
"env": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--help": complete.PredictNothing,
"--json": complete.PredictNothing,
"--help": complete.PredictNothing,
"--log": complete.PredictNothing,
},
},
Expand All @@ -48,12 +48,12 @@ func main() {
"clone": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--image": complete.PredictNothing,
"--token": complete.PredictNothing,
"--password": complete.PredictNothing,
"--dest": complete.PredictNothing,
"--log": complete.PredictNothing,
"--help": complete.PredictNothing,
"--log": complete.PredictNothing,
"--password": complete.PredictNothing,
"--image": complete.PredictNothing,
"--branch": complete.PredictNothing,
},
},
Expand Down Expand Up @@ -119,16 +119,16 @@ func main() {
"origin": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--reset": complete.PredictNothing,
"--log": complete.PredictNothing,
"--reset": complete.PredictNothing,
},
},
"update": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--password": complete.PredictNothing,
"--token": complete.PredictNothing,
"--log": complete.PredictNothing,
"--password": complete.PredictNothing,
},
},
"deployments": complete.Command{
Expand All @@ -149,17 +149,17 @@ func main() {
"default": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--allusers": complete.PredictNothing,
"--installed": complete.PredictNothing,
"--attached": complete.PredictNothing,
"--allusers": complete.PredictNothing,
},
},
},
Flags: complete.Flags{
"--help": complete.PredictNothing,
"--allusers": complete.PredictNothing,
"--installed": complete.PredictNothing,
"--attached": complete.PredictNothing,
"--help": complete.PredictNothing,
"--allusers": complete.PredictNothing,
},
},
"attached": complete.Command{
Expand All @@ -186,28 +186,28 @@ func main() {
"ui": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--password": complete.PredictNothing,
"--token": complete.PredictNothing,
"--password": complete.PredictNothing,
"--log": complete.PredictNothing,
"--dest": complete.PredictNothing,
},
},
"lib": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--password": complete.PredictNothing,
"--token": complete.PredictNothing,
"--password": complete.PredictNothing,
"--log": complete.PredictNothing,
"--dest": complete.PredictNothing,
},
},
},
Flags: complete.Flags{
"--token": complete.PredictNothing,
"--password": complete.PredictNothing,
"--dest": complete.PredictNothing,
"--log": complete.PredictNothing,
"--help": complete.PredictNothing,
"--log": complete.PredictNothing,
"--password": complete.PredictNothing,
},
},
"extensions": complete.Command{
Expand Down Expand Up @@ -237,17 +237,17 @@ func main() {
"origin": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--reset": complete.PredictNothing,
"--log": complete.PredictNothing,
"--reset": complete.PredictNothing,
},
},
"paths": complete.Command{
Sub: complete.Commands{
"forget": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--all": complete.PredictNothing,
"--log": complete.PredictNothing,
"--all": complete.PredictNothing,
},
},
"add": complete.Command{
Expand Down Expand Up @@ -279,8 +279,8 @@ func main() {
"forget": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--all": complete.PredictNothing,
"--log": complete.PredictNothing,
"--all": complete.PredictNothing,
},
},
"add": complete.Command{
Expand All @@ -298,9 +298,9 @@ func main() {
"update": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--password": complete.PredictNothing,
"--token": complete.PredictNothing,
"--log": complete.PredictNothing,
"--password": complete.PredictNothing,
},
},
},
Expand Down Expand Up @@ -366,15 +366,15 @@ func main() {
"fileinfo": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--csv": complete.PredictNothing,
"--rte": complete.PredictNothing,
"--rft": complete.PredictNothing,
"--rte": complete.PredictNothing,
"--csv": complete.PredictNothing,
},
},
},
Flags: complete.Flags{
"--help": complete.PredictNothing,
"--installed": complete.PredictNothing,
"--help": complete.PredictNothing,
"--supported": complete.PredictNothing,
},
},
Expand All @@ -387,11 +387,11 @@ func main() {
},
Flags: complete.Flags{
"--models": complete.PredictNothing,
"--allowdialogs": complete.PredictNothing,
"--import": complete.PredictNothing,
"--revit": complete.PredictNothing,
"--import": complete.PredictNothing,
"--help": complete.PredictNothing,
"--purge": complete.PredictNothing,
"--allowdialogs": complete.PredictNothing,
},
},
"caches": complete.Command{
Expand All @@ -415,8 +415,8 @@ func main() {
"config": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--help": complete.PredictNothing,
"--from": complete.PredictNothing,
"--help": complete.PredictNothing,
},
},
"configs": complete.Command{
Expand Down Expand Up @@ -846,18 +846,18 @@ func main() {
"doctor": complete.Command{
Sub: complete.Commands{},
Flags: complete.Flags{
"--help": complete.PredictNothing,
"--list": complete.PredictNothing,
"--help": complete.PredictNothing,
"--dryrun": complete.PredictNothing,
},
},
},
Flags: complete.Flags{
"--version": complete.PredictNothing,
"--verbose": complete.PredictNothing,
"--debug": complete.PredictNothing,
"--help": complete.PredictNothing,
"--usage": complete.PredictNothing,
"--version": complete.PredictNothing,
"--verbose": complete.PredictNothing,
},
}
complete.New("pyrevit", pyrevit).Run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using pyRevitExtensionParser;
using static pyRevitExtensionParser.ExtensionParser;
// using static pyRevitExtensionParser.ExtensionParser; // not currently used - all calls use fully qualified ExtensionParser.*

namespace pyRevitAssemblyBuilder.SessionManager
{
Expand All @@ -11,14 +11,36 @@ namespace pyRevitAssemblyBuilder.SessionManager
/// </summary>
public class ExtensionManagerService : IExtensionManagerService
{
private readonly int _revitYear;
// Logger is retained for potential direct use in this class (e.g. ClearParserCaches, future methods).
// Note: ExtensionParser logger is set by ServiceFactory before this service is constructed —
// do NOT call ExtensionParser.SetLogger() here as that would reset it.
private readonly ILogger _logger;
private List<ParsedExtension>? _cachedExtensions;

/// <summary>
/// Initialises the service with the running Revit version year for version-compatibility filtering.
/// </summary>
/// <param name="revitYear">
/// The four-digit Revit release year (e.g. 2024). Pass 0 to disable version filtering.
/// </param>
/// <param name="logger">The logger instance.</param>
public ExtensionManagerService(int revitYear = 0, ILogger? logger = null)
{
_revitYear = revitYear;
_logger = logger ?? new LoggingHelper(null);
}

/// <summary>
/// Gets all parsed extensions (cached).
/// </summary>
private List<ParsedExtension> GetAllExtensionsCached()
{
return _cachedExtensions ??= ExtensionParser.ParseInstalledExtensions().ToList();
if (_cachedExtensions != null)
return _cachedExtensions;

_cachedExtensions = ExtensionParser.ParseInstalledExtensions(_revitYear).ToList();
return _cachedExtensions;
}

/// <summary>
Expand All @@ -28,7 +50,7 @@ public void ClearCache()
{
_cachedExtensions = null;
}

/// <summary>
/// Clears all parser caches including the static caches in ExtensionParser.
/// This ensures newly installed or enabled extensions are discovered on reload.
Expand Down Expand Up @@ -56,7 +78,7 @@ public IEnumerable<ParsedExtension> GetInstalledExtensions()
public IEnumerable<ParsedExtension> GetInstalledUIExtensions()
{
return GetAllExtensionsCached()
.Where(ext => ext.Config?.Disabled != true &&
.Where(ext => ext.Config?.Disabled != true &&
ext.Directory.EndsWith(ExtensionConstants.UI_EXTENSION_SUFFIX, System.StringComparison.OrdinalIgnoreCase));
}

Expand All @@ -67,8 +89,8 @@ public IEnumerable<ParsedExtension> GetInstalledUIExtensions()
public IEnumerable<ParsedExtension> GetInstalledLibraryExtensions()
{
return GetAllExtensionsCached()
.Where(ext => ext.Config?.Disabled != true &&
.Where(ext => ext.Config?.Disabled != true &&
ext.Directory.EndsWith(ExtensionConstants.LIBRARY_EXTENSION_SUFFIX, System.StringComparison.OrdinalIgnoreCase));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ public static IAssemblyBuilderService CreateAssemblyBuilderService(string revitV
/// <summary>
/// Creates an ExtensionManagerService instance.
/// </summary>
/// <param name="revitVersion">The Revit version number (e.g., "2024"). Used to filter extensions by version compatibility.</param>
/// <returns>A new IExtensionManagerService instance.</returns>
public static IExtensionManagerService CreateExtensionManagerService()
public static IExtensionManagerService CreateExtensionManagerService(string revitVersion, ILogger logger)
{
return new ExtensionManagerService();
int.TryParse(revitVersion, out var revitYear);

// log if parsing fails, but still create the service with revitYear = 0 which will be treated as "no version filter"
if (revitYear == 0)
{
logger.Warning($"Failed to parse Revit version: {revitVersion}");
}

return new ExtensionManagerService(revitYear, logger);
}

/// <summary>
Expand Down Expand Up @@ -135,7 +144,7 @@ public static IButtonBuilderFactory CreateButtonBuilderFactory(UIApplication uiA
{
// Create script initializers
var smartButtonScriptInitializer = new SmartButtonScriptInitializer(uiApplication, logger);

// Create individual button builders
var linkButtonBuilder = new LinkButtonBuilder(logger, buttonPostProcessor);
var pushButtonBuilder = new PushButtonBuilder(logger, buttonPostProcessor, smartButtonScriptInitializer);
Expand Down Expand Up @@ -169,7 +178,7 @@ public static IStackBuilder CreateStackBuilder(UIApplication uiApplication, ILog
var linkButtonBuilder = new LinkButtonBuilder(logger, buttonPostProcessor);
var pulldownButtonBuilder = new PulldownButtonBuilder(logger, buttonPostProcessor, linkButtonBuilder, smartButtonScriptInitializer);
var splitButtonBuilder = new SplitButtonBuilder(logger, buttonPostProcessor, linkButtonBuilder);

return new StackBuilder(logger, buttonPostProcessor, linkButtonBuilder, pulldownButtonBuilder, splitButtonBuilder, smartButtonScriptInitializer);
}

Expand Down Expand Up @@ -247,25 +256,25 @@ public static ISessionManagerService CreateSessionManagerService(
// Create logger first - it's used by all other services
var logger = CreateLogger(pythonLogger);
ExtensionParser.SetLogger(new ExtensionParserLoggerAdapter(logger));

// Create core services
var assemblyBuilder = CreateAssemblyBuilderService(revitVersion, buildStrategy, logger);
var extensionManager = CreateExtensionManagerService();
var extensionManager = CreateExtensionManagerService(revitVersion, logger);
var hookManager = CreateHookManager(logger);

// Create icon and tooltip managers
var iconManager = CreateIconManager(logger);
var tooltipManager = CreateTooltipManager(logger);
var buttonPostProcessor = CreateButtonPostProcessor(logger, iconManager, tooltipManager);

// Create UI builders
var panelStyleManager = CreatePanelStyleManager(logger);
var tabBuilder = CreateTabBuilder(uiApplication, logger);
var panelBuilder = CreatePanelBuilder(uiApplication, logger, panelStyleManager);
var buttonBuilderFactory = CreateButtonBuilderFactory(uiApplication, logger, buttonPostProcessor);
var stackBuilder = CreateStackBuilder(uiApplication, logger, buttonPostProcessor);
var comboBoxBuilder = CreateComboBoxBuilder(uiApplication, logger, buttonPostProcessor);

// Create ribbon scanner for UI cleanup
var ribbonScanner = CreateUIRibbonScanner(logger);

Expand All @@ -289,7 +298,7 @@ public static ISessionManagerService CreateSessionManagerService(
ribbonScanner,
logger);
}

/// <summary>
/// Creates a SessionManagerService instance with custom service implementations.
/// Use this overload for testing or when custom implementations are needed.
Expand Down Expand Up @@ -319,4 +328,4 @@ public static ISessionManagerService CreateSessionManagerService(
logger);
}
}
}
}
Loading