Skip to content

Commit

Permalink
Merge pull request #100 from bvn-architecture/v1.9.0-beta
Browse files Browse the repository at this point in the history
v1.9.0 beta
  • Loading branch information
petersmithfromengland authored Nov 20, 2022
2 parents 0f6a2fd + 4e4acf1 commit 40cdc5c
Show file tree
Hide file tree
Showing 21 changed files with 309,510 additions and 90 deletions.
4 changes: 4 additions & 0 deletions AddinDeployment/RemoveAddinAllVersions.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ echo.
echo Removing BatchRvt addin for Revit 2022
call RemoveAddin.bat 2022

echo.
echo Removing BatchRvt addin for Revit 2023
call RemoveAddin.bat 2023

echo Done.
echo.

Expand Down
3 changes: 2 additions & 1 deletion BatchRevitDynamo/RevitBatchProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ public enum UseRevitVersion {
Revit2019 = 5,
Revit2020 = 6,
Revit2021 = 7,
Revit2022 = 8
Revit2022 = 8,
Revit2023 = 9
}
public enum RevitSessionOption { UseSeparateSessionPerFile = 0, UseSameSessionForFilesOfSameVersion = 1 }
public enum CentralFileOpenOption { Detach = 0, CreateNewLocal = 1 }
Expand Down
1 change: 1 addition & 0 deletions BatchRvt/BatchRvt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<HintPath>..\References\IronPython-2.7.3\Microsoft.Scripting.Metadata.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Win32.Registry, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\JSON.NET\Newtonsoft.Json.dll</HintPath>
Expand Down
10 changes: 10 additions & 0 deletions BatchRvtAddin2023/BatchRvtAddin2023.addin
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>BatchRvtAddin</Name>
<Assembly>.\BatchRvt\BatchRvtAddin2023.dll</Assembly>
<AddInId>b57d22c8-5e1f-407a-86ea-a8615fd8df34</AddInId>
<FullClassName>BatchRvt.Addin.Revit2023.BatchRvtAddinApplication</FullClassName>
<VendorId>BATCHRVT</VendorId>
</AddIn>
</RevitAddIns>
90 changes: 90 additions & 0 deletions BatchRvtAddin2023/BatchRvtAddin2023.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{60C3C457-D35A-4343-A906-01CF666DC75E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BatchRvt.Addin.Revit2023</RootNamespace>
<AssemblyName>BatchRvtAddin2023</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="IronPython, Version=2.7.0.40, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\IronPython-2.7.3\IronPython.dll</HintPath>
</Reference>
<Reference Include="IronPython.Modules, Version=2.7.0.40, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\IronPython-2.7.3\IronPython.Modules.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\IronPython-2.7.3\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\IronPython-2.7.3\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting.Metadata, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\References\IronPython-2.7.3\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
<Reference Include="RevitAPI">
<HintPath>..\References\Revit\2023\RevitAPI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI">
<HintPath>..\References\Revit\2023\RevitAPIUI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Common\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="BatchRvtAddinApplication.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BatchRvtScriptHost\BatchRvtScriptHost.csproj">
<Project>{673d1fb5-cfb2-4bdf-9609-c43979dd7197}</Project>
<Name>BatchRvtScriptHost</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="BatchRvtAddin2023.addin" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>call "$(ProjectDir)..\AddinDeployment\DeployAddin.bat" "$(ProjectDir)" "$(TargetDir)" "2023"</PostBuildEvent>
</PropertyGroup>
</Project>
96 changes: 96 additions & 0 deletions BatchRvtAddin2023/BatchRvtAddinApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
//
// Revit Batch Processor
//
// Copyright (c) 2020 Daniel Rumery, BVN
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.IO;
using WinForms = System.Windows.Forms;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.ApplicationServices;

using BatchRvt.ScriptHost;

namespace BatchRvt.Addin.Revit2023
{
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
[DisplayName("BatchRvtAddin")]
[Description("BatchRvtAddin")]
public class BatchRvtAddinApplication : IExternalApplication
{
private static void SetupBatchScriptHost(ControlledApplication controlledApplication)
{
var pluginFolderPath = Path.GetDirectoryName(typeof(BatchRvtAddinApplication).Assembly.Location);

var batchRvtExternalEventHandler = new BatchRvtExternalEventHandler(pluginFolderPath);

batchRvtExternalEventHandler.Raise();
}

public Result OnStartup(UIControlledApplication uiApplication)
{
SetupBatchScriptHost(uiApplication.ControlledApplication);

return Result.Succeeded;
}

public Result OnShutdown(UIControlledApplication application)
{
return Result.Succeeded;
}
}

public class BatchRvtExternalEventHandler : IExternalEventHandler
{
private readonly ExternalEvent externalEvent_;
private readonly string pluginFolderPath_;

public BatchRvtExternalEventHandler(string pluginFolderPath)
{
this.externalEvent_ = ExternalEvent.Create(this);
this.pluginFolderPath_ = pluginFolderPath;
}

public void Execute(UIApplication uiApp)
{
try
{
ScriptHostUtil.ExecuteBatchScriptHost(this.pluginFolderPath_, uiApp);
}
catch (Exception e)
{
WinForms.MessageBox.Show(e.ToString(), ScriptHostUtil.BATCH_RVT_ERROR_WINDOW_TITLE);
}
}

public string GetName()
{
return "BatchRvt_ExternalEventHandler";
}

public ExternalEventRequest Raise()
{
return this.externalEvent_.Raise();
}
}
}

23 changes: 23 additions & 0 deletions BatchRvtAddin2023/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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("BatchRvtAddin2023")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("BVN")]
[assembly: AssemblyProduct("BatchRvtAddin2023")]
[assembly: AssemblyCopyright("Copyright © BVN 2022")]
[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("60c3c457-d35a-4343-a906-01cf666dc75e")]
Binary file added BatchRvtGUI/BVN32NewBrand.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion BatchRvtGUI/BatchRvtGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>BVN32new.ico</ApplicationIcon>
<ApplicationIcon>BVN32NewBrand.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -149,6 +149,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="BVN32new.ico" />
<Content Include="BVN32NewBrand.ico" />
<EmbeddedResource Include="Images\BVN16new.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
3 changes: 2 additions & 1 deletion BatchRvtUtil/BatchRvt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public enum WorksetConfigurationOption { CloseAllWorksets = 0, OpenAllWorksets =
{ RevitVersion.SupportedRevitVersion.Revit2019, "BatchRvtAddin2019.addin" },
{ RevitVersion.SupportedRevitVersion.Revit2020, "BatchRvtAddin2020.addin" },
{ RevitVersion.SupportedRevitVersion.Revit2021, "BatchRvtAddin2021.addin" },
{ RevitVersion.SupportedRevitVersion.Revit2022, "BatchRvtAddin2022.addin" }
{ RevitVersion.SupportedRevitVersion.Revit2022, "BatchRvtAddin2022.addin" },
{ RevitVersion.SupportedRevitVersion.Revit2023, "BatchRvtAddin2023.addin" }
};

private static string ConstructCommandLineArguments(IEnumerable<KeyValuePair<string, string>> arguments)
Expand Down
7 changes: 5 additions & 2 deletions BatchRvtUtil/BatchRvtTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ string testModeFolderPath
RevitVersion.SupportedRevitVersion.Revit2020 :
useRevitVersion == UseRevitVersion.Revit2021 ?
RevitVersion.SupportedRevitVersion.Revit2021 :
RevitVersion.SupportedRevitVersion.Revit2022
useRevitVersion == UseRevitVersion.Revit2022 ?
RevitVersion.SupportedRevitVersion.Revit2022 :
RevitVersion.SupportedRevitVersion.Revit2023

);

Expand Down Expand Up @@ -308,7 +310,8 @@ public enum UseRevitVersion {
Revit2019 = 5,
Revit2020 = 6,
Revit2021 = 7,
Revit2022 = 8
Revit2022 = 8,
Revit2023 = 9
}
}
}
Loading

0 comments on commit 40cdc5c

Please sign in to comment.