Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaeldeity committed Oct 8, 2024
1 parent 384d8f4 commit 13266e4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 27 deletions.
22 changes: 8 additions & 14 deletions App.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace CurvedInsulation
Expand All @@ -13,17 +9,15 @@ public class App : IExternalApplication
{
static void AddRibbonPanel(UIControlledApplication application)
{
RibbonPanel ribbonPanel = application.CreateRibbonPanel("Insulation");
RibbonPanel panel = application.CreateRibbonPanel("Insulation");

string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
string path = Assembly.GetExecutingAssembly().Location;

PushButtonData b1Data = new PushButtonData("Curved", "Curved", thisAssemblyPath, "CurvedInsulation.Draw");
PushButton pb1 = ribbonPanel.AddItem(b1Data) as PushButton;
pb1.ToolTip = "Draw Curved Insulation. Pick a reference Insulation Batting and then the arc or line be applied to.";
Uri addinImage =
new Uri("pack://application:,,,/CurvedInsulation;component/Resources/CurvedInsulation.png");
BitmapImage pb1Image = new BitmapImage(addinImage);
pb1.LargeImage = pb1Image;
PushButtonData data = new PushButtonData("Curved", "Curved", path, "CurvedInsulation.Draw");
PushButton button = panel.AddItem(data) as PushButton;
button.ToolTip = "Draw Curved Insulation. Pick a reference Insulation Batting and then the arc or line be applied to.";
BitmapImage image = new BitmapImage(new Uri("pack://application:,,,/CurvedInsulation;component/Resources/CurvedInsulation.png"));
button.LargeImage = image;
}
public Result OnStartup(UIControlledApplication application)
{
Expand All @@ -34,6 +28,6 @@ public Result OnStartup(UIControlledApplication application)
public Result OnShutdown(UIControlledApplication application)
{
return Result.Succeeded;
}
}
}
}
29 changes: 19 additions & 10 deletions CurvedInsulation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\..\ProgramData\Autodesk\Revit\Addins\2023\CurvedInsulation\</OutputPath>
<OutputPath>bin/Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -27,7 +27,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>Release\CurvedInsulation\</OutputPath>
<OutputPath>bin/Release</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
Expand All @@ -38,13 +38,20 @@
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="AdWindows, Version=5.0.3.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Revit_All_Main_Versions_API_x64.2024.2.0\lib\net48\AdWindows.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="RevitAPI">
<HintPath>..\..\..\..\..\Program Files\Autodesk\Revit 2023\RevitAPI.dll</HintPath>
<Reference Include="RevitAPI, Version=24.2.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\Revit_All_Main_Versions_API_x64.2024.2.0\lib\net48\RevitAPI.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="RevitAPIUI">
<HintPath>..\..\..\..\..\Program Files\Autodesk\Revit 2023\RevitAPIUI.dll</HintPath>
<Reference Include="RevitAPIUI, Version=24.2.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\Revit_All_Main_Versions_API_x64.2024.2.0\lib\net48\RevitAPIUI.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -55,6 +62,11 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UIFramework, Version=24.2.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\Revit_All_Main_Versions_API_x64.2024.2.0\lib\net48\UIFramework.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App.cs" />
Expand All @@ -65,13 +77,10 @@
<None Include="CurvedInsulation.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\CurvedInsulation.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if exist "$(AppData)\Autodesk\REVIT\Addins\2023" copy "$(ProjectDir)*.addin" "$(AppData)\Autodesk\REVIT\Addins\2023"
if exist "$(AppData)\Autodesk\REVIT\Addins\2023" copy "$(ProjectDir)$(OutputPath)*.dll" "$(AppData)\Autodesk\REVIT\Addins\2023"</PostBuildEvent>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Curved Insulation")]
[assembly: AssemblyCopyright("Copyright © 2023 Mikael Santrolli")]
[assembly: AssemblyCopyright("Copyright © 2024 Mikael Santrolli")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// 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("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
Binary file modified obj/Release/CurvedInsulation.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Revit_All_Main_Versions_API_x64" version="2024.2.0" targetFramework="net48" />
</packages>

0 comments on commit 13266e4

Please sign in to comment.