diff --git a/Output/2020.01.19_Setup_RevitPythonShell_2020.exe b/Output/2020.01.19_Setup_RevitPythonShell_2020.exe new file mode 100644 index 0000000..7de2384 Binary files /dev/null and b/Output/2020.01.19_Setup_RevitPythonShell_2020.exe differ diff --git a/PythonConsoleControl/Properties/AssemblyInfo.cs b/PythonConsoleControl/Properties/AssemblyInfo.cs deleted file mode 100644 index 9f4ac84..0000000 --- a/PythonConsoleControl/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PythonConsoleControl")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PythonConsoleControl")] -[assembly: AssemblyCopyright("Copyright © Joe Moorhouse 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("799d3277-6903-4a58-bdf8-4984f92993d1")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2017.0.0.0")] -[assembly: AssemblyFileVersion("2017.0.0.0")] diff --git a/PythonConsoleControl/PythonCompletionData.cs b/PythonConsoleControl/PythonCompletionData.cs index 9132e98..aa13b51 100644 --- a/PythonConsoleControl/PythonCompletionData.cs +++ b/PythonConsoleControl/PythonCompletionData.cs @@ -1,14 +1,10 @@ // Copyright (c) 2010 Joe Moorhouse -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using ICSharpCode.AvalonEdit.CodeCompletion; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Editing; using Microsoft.Scripting.Hosting.Shell; -using Microsoft.Scripting; +using System; namespace PythonConsoleControl { @@ -17,8 +13,8 @@ namespace PythonConsoleControl /// public class PythonCompletionData : ICompletionData { - CommandLine commandLine; - + private CommandLine commandLine; + public PythonCompletionData(string text, string stub, CommandLine commandLine, bool isInstance) { this.Text = text; @@ -46,7 +42,8 @@ public object Content public object Description { - get { + get + { // Do nothing: description now updated externally and asynchronously. return "Not available"; } @@ -59,4 +56,4 @@ public void Complete(TextArea textArea, ISegment completionSegment, EventArgs in textArea.Document.Replace(completionSegment, this.Text); } } -} +} \ No newline at end of file diff --git a/PythonConsoleControl/PythonConsoleControl.csproj b/PythonConsoleControl/PythonConsoleControl.csproj index fe184c0..11c030a 100644 --- a/PythonConsoleControl/PythonConsoleControl.csproj +++ b/PythonConsoleControl/PythonConsoleControl.csproj @@ -1,124 +1,116 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {F1152D68-346B-4F48-8DB7-BE67B5CB1F49} - Library - Properties - PythonConsoleControl - PythonConsoleControl - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - v4.7.2 + Debug;Debug One;Release - - v4.5 - - - v4.5 + + + + net40;net45;net451;net452;net46;net47;net471 + win + true - - v4.5 + + + + net40 - - v4.6 + + + 2014 - - v4.6 + + 2015 - - true - full - false - ..\..\bin\ - DEBUG;TRACE - prompt - 4 - false + + 2016 - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Debug 2015\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2017 - - true - bin\Debug 2016\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2018 - - true - bin\Debug 2017\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2019 - - true - bin\Debug 2018\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2020 - - false + + + + x64 + x64 + None + + + {351668CC-8477-4fbf-BFE3-5F1006E4DB1F} + + + false + false + + + REVIT$(RevitVersion);WINFORMS + $(DefineConstants) + + + false + + + false + ..\bin\$(Configuration)\$(RevitVersion) - - true - bin\Debug 2019\ - DEBUG;TRACE + + + $(DefineConstants);DEBUG full - AnyCPU - prompt - MinimumRecommendedRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + + + + - - ..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll - ..\RequiredLibraries\IronPython.dll @@ -134,6 +126,10 @@ ..\RequiredLibraries\Microsoft.Scripting.Metadata.dll + + + + @@ -150,7 +146,6 @@ - PythonConsoleControl.xaml @@ -172,35 +167,15 @@ - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - + + + - - None - + + net40;net45;net451;net452;net46;net47;net471 + win + true + true - - v4.7.2 + + + + net471 - - v4.5 + + + 2014 - - v4.5 + + 2015 - - v4.6 + + 2016 - - v4.6 + + 2017 - - v4.7.2 + + 2018 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Debug 2014\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2019 - - true - bin\Debug 2015\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - - - true - bin\Debug 2016\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2020 - - true - bin\Debug 2017\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + + + x64 + x64 + None + + + {351668CC-8477-4fbf-BFE3-5F1006E4DB1F} + + + false + false + + + REVIT$(RevitVersion);WINFORMS + $(DefineConstants) + + + false + + + false + .\bin\$(Configuration)\$(RevitVersion) + 3a7a1d24-51ed-462b-949f-1ddcca12008d + RevitPythonShell + RIPS + Revit Python Shell addin for Revit - - true - bin\Debug 2018\ - DEBUG;TRACE + + + TRACE;REVIT2020;WINFORMS;DEBUG full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + .\bin\$(Configuration)\$(RevitVersion) - - true - bin\Debug 2019\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset + + + false - - - ..\RequiredLibraries\Revit2016\RevitAPI.dll - - - ..\RequiredLibraries\Revit2016\RevitAPIUI.dll - - - - - ..\RequiredLibraries\Revit2017\RevitAPI.dll - - - ..\RequiredLibraries\Revit2017\RevitAPIUI.dll - - - - - ..\RequiredLibraries\Revit2018\RevitAPI.dll - - - ..\RequiredLibraries\Revit2018\RevitAPIUI.dll - + + + + - - - ..\RequiredLibraries\Revit2019\RevitAPI.dll - - - ..\RequiredLibraries\Revit2019\RevitAPIUI.dll - + + + + + + + + + + + + + + + + + + - - ..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll - ..\RequiredLibraries\IronPython.dll - True ..\RequiredLibraries\IronPython.Modules.dll - True ..\RequiredLibraries\Microsoft.Dynamic.dll - True ..\RequiredLibraries\Microsoft.Scripting.dll - True ..\RequiredLibraries\Microsoft.Scripting.Metadata.dll - True + + + - - ..\PythonConsoleControl\bin\Debug 2018\PythonConsoleControl.dll - - - 3.5 - + - - ..\RequiredLibraries\System.Windows.Controls.WpfPropertyGrid.dll - - - 3.5 - - - 3.5 - + + @@ -236,7 +170,6 @@ - True True @@ -254,7 +187,12 @@ - + + MSDataSetGenerator + AddinTemplate.Designer.cs + Never + + @@ -268,9 +206,14 @@ - + + PreserveNewest + + - + + PreserveNewest + @@ -285,26 +228,10 @@ Designer + PreserveNewest - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - Designer @@ -313,21 +240,95 @@ - {f1152d68-346b-4f48-8db7-be67b5cb1f49} - PythonConsoleControl + true + true + all - {c8446636-c663-409f-82d0-72c0d55bba1c} - RpsRuntime + true + true + all - - - + + + + + - + + + + + + + - --> \ No newline at end of file diff --git a/RevitPythonShell/RevitPythonShell.csproj.user b/RevitPythonShell/RevitPythonShell.csproj.user new file mode 100644 index 0000000..3456e8d --- /dev/null +++ b/RevitPythonShell/RevitPythonShell.csproj.user @@ -0,0 +1,15 @@ + + + + ProjectDebugger + + + Revit 2020 W Drive + false + + + + Designer + + + \ No newline at end of file diff --git a/RevitPythonShell/RevitPythonShellApplication.cs b/RevitPythonShell/RevitPythonShellApplication.cs index 86143ae..22abea5 100644 --- a/RevitPythonShell/RevitPythonShellApplication.cs +++ b/RevitPythonShell/RevitPythonShellApplication.cs @@ -20,7 +20,9 @@ namespace RevitPythonShell [Transaction(TransactionMode.Manual)] class RevitPythonShellApplication : IExternalApplication { + private const string APP_NAME = "RevitPythonShell"; private static string versionNumber; + private static string dllfolder; /// /// Hook into Revit to allow starting a command. @@ -35,9 +37,14 @@ Result IExternalApplication.OnStartup(UIControlledApplication application) { versionNumber = "_Vasari"; } - var dllfolder = Path.Combine( + +#if DEBUG + dllfolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); +#else + dllfolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), - "RevitPythonShell" + versionNumber); + $"{APP_NAME}/{versionNumber}"); +#endif var assemblyName = "CommandLoaderAssembly"; var dllfullpath = Path.Combine(dllfolder, assemblyName + ".dll"); @@ -87,11 +94,11 @@ private static void BuildRibbonPanel(UIControlledApplication application, string var largeImage = GetEmbeddedPng(assembly, "RevitPythonShell.Resources.Python-32.png"); - RibbonPanel ribbonPanel = application.CreateRibbonPanel("RevitPythonShell"); - var splitButton = ribbonPanel.AddItem(new SplitButtonData("splitButtonRevitPythonShell", "RevitPythonShell")) as SplitButton; + RibbonPanel ribbonPanel = application.CreateRibbonPanel(APP_NAME); + var splitButton = ribbonPanel.AddItem(new SplitButtonData("splitButtonRevitPythonShell", APP_NAME)) as SplitButton; PushButtonData pbdOpenPythonShell = new PushButtonData( - "RevitPythonShell", + APP_NAME, "Interactive\nPython Shell", assembly.Location, "RevitPythonShell.IronPythonConsoleCommand"); @@ -316,7 +323,11 @@ private static string GetSettingsFile() /// private static string GetSettingsFolder() { - return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RevitPythonShell" + versionNumber); +#if DEBUG + return Path.Combine(dllfolder, "DefaultConfig"); +#else + return dllfolder; +#endif } /// diff --git a/RevitPythonShell/Views/IronPythonConsole.xaml.cs b/RevitPythonShell/Views/IronPythonConsole.xaml.cs index 81e8dc5..f9023b7 100644 --- a/RevitPythonShell/Views/IronPythonConsole.xaml.cs +++ b/RevitPythonShell/Views/IronPythonConsole.xaml.cs @@ -1,27 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using Microsoft.Scripting.Hosting.Shell; -using ICSharpCode.AvalonEdit; +using ICSharpCode.AvalonEdit; using ICSharpCode.AvalonEdit.Highlighting; -using System.IO; -using System.Xml; using Microsoft.Win32; -using Autodesk.Revit.UI; -using Autodesk.Revit.DB; -using Microsoft.Scripting; -using System.Threading; +using System; +using System.IO; using System.Reflection; +using System.Windows; +using System.Windows.Input; +using System.Xml; namespace RevitPythonShell { @@ -62,13 +47,13 @@ public IronPythonConsole() // get application version and show in title Title = String.Format("RevitPythonShell | {0}", Assembly.GetExecutingAssembly().GetName().Version.ToString()); } - - void MainWindow_Initialized(object sender, EventArgs e) + + private void MainWindow_Initialized(object sender, EventArgs e) { //propertyGridComboBox.SelectedIndex = 1; } - void openFileClick(object sender, RoutedEventArgs e) + private void openFileClick(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.CheckFileExists = true; @@ -80,7 +65,7 @@ void openFileClick(object sender, RoutedEventArgs e) } } - void saveFileClick(object sender, EventArgs e) + private void saveFileClick(object sender, EventArgs e) { if (currentFileName == null) { @@ -98,17 +83,17 @@ void saveFileClick(object sender, EventArgs e) textEditor.Save(currentFileName); } - void runClick(object sender, EventArgs e) + private void runClick(object sender, EventArgs e) { RunStatements(); } - void textEditor_PreviewKeyDown(object sender, KeyEventArgs e) + private void textEditor_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.F5) RunStatements(); } - void RunStatements() + private void RunStatements() { string statementsToRun = ""; if (textEditor.TextArea.Selection.Length > 0) @@ -128,7 +113,7 @@ private void textEditor_GotFocus(object sender, RoutedEventArgs e) // Remove the handler from the list otherwise this handler will clear // editor contents every time the editor gains focus. tb.GotFocus -= textEditor_GotFocus; - } + } } } -} +} \ No newline at end of file diff --git a/RevitPythonShell/packages.config b/RevitPythonShell/packages.config deleted file mode 100644 index 207adf6..0000000 --- a/RevitPythonShell/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/RpsRuntime/Properties/AssemblyInfo.cs b/RpsRuntime/Properties/AssemblyInfo.cs deleted file mode 100644 index 8c746d9..0000000 --- a/RpsRuntime/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RpsRuntime")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RpsRuntime")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bb210dd4-3bd6-4865-abb2-03e1bf29481f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2017.0.0.0")] -[assembly: AssemblyFileVersion("2017.0.0.0")] diff --git a/RpsRuntime/RpsRuntime.csproj b/RpsRuntime/RpsRuntime.csproj index 7e99d95..f90c8d4 100644 --- a/RpsRuntime/RpsRuntime.csproj +++ b/RpsRuntime/RpsRuntime.csproj @@ -1,164 +1,141 @@ - - + + - 8.0.30703 - 2.0 - {C8446636-C663-409F-82D0-72C0D55BBA1C} - Library - Properties - RevitPythonShell.RpsRuntime - RpsRuntime - 512 + Debug;Debug One;Release + - - - None - + + net40;net45;net451;net452;net46;net47;net471 + win - - v4.7.2 + + + + net471 - - v4.5 + + + 2014 - - v4.5 + + 2015 - - v4.5 + + 2016 - - v4.6 + + 2017 - - v4.7.2 + + 2018 - - true - bin\Debug 2014\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - - - true - bin\Debug 2015\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false - - - true - bin\Debug 2016\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2019 - - true - bin\Debug 2017\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + 2020 - - true - bin\Debug 2018\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - false + + + + x64 + x64 + None + + + {351668CC-8477-4fbf-BFE3-5F1006E4DB1F} + + + false + false + + + REVIT$(RevitVersion);WINFORMS + $(DefineConstants) + + + false + + + false + ..\bin\$(Configuration)\$(RevitVersion) - - true - bin\Debug 2019\ - DEBUG;TRACE + + + $(DefineConstants);DEBUG full - AnyCPU - prompt - MinimumRecommendedRules.ruleset + - - - ..\RequiredLibraries\Revit2016\RevitAPI.dll - - - ..\RequiredLibraries\Revit2016\RevitAPIUI.dll - - - - - ..\RequiredLibraries\Revit2017\RevitAPI.dll - - - ..\RequiredLibraries\Revit2017\RevitAPIUI.dll - + + + + + - - - ..\RequiredLibraries\Revit2018\RevitAPI.dll - - - ..\RequiredLibraries\Revit2018\RevitAPIUI.dll - + + + - - - ..\RequiredLibraries\Revit2019\RevitAPI.dll - - - ..\RequiredLibraries\Revit2019\RevitAPIUI.dll - + + + + + + + + + + + + + + + + + + - - ..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll - - - False + ..\RequiredLibraries\IronPython.dll - - False + ..\RequiredLibraries\IronPython.Modules.dll - - - False + ..\RequiredLibraries\Microsoft.Dynamic.dll - - False + ..\RequiredLibraries\Microsoft.Scripting.dll - - False + ..\RequiredLibraries\Microsoft.Scripting.Metadata.dll - - - ..\RequiredLibraries\Revit2019\RevitAPI.dll - False - - - ..\RequiredLibraries\Revit2019\RevitAPIUI.dll - False + + ..\RequiredLibraries\Microsoft.CSharp.dll + + + + @@ -173,7 +150,6 @@ - @@ -204,9 +180,9 @@ - + - +