-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
969 changed files
with
172,483 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
using Microsoft.VisualBasic.ApplicationServices; | ||
using System; | ||
using System.IO; | ||
using System.Net; | ||
using System.Net.NetworkInformation; | ||
using System.Reflection; | ||
|
||
namespace Case.ApplySysOrient.API | ||
{ | ||
class clsApi | ||
{ | ||
|
||
#region "Private Members" | ||
|
||
/// <summary> | ||
/// Full Qualifying Domain Name | ||
/// </summary> | ||
/// <returns></returns> | ||
/// <remarks></remarks> | ||
private static string GetFullDomainName() | ||
{ | ||
|
||
try | ||
{ | ||
// Domain | ||
string m_domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; | ||
|
||
// Host | ||
string m_hostName = Dns.GetHostName(); | ||
|
||
if (!m_hostName.Contains(m_domainName)) | ||
{ | ||
// add the domain name part, if the hostname does not already include the domain name | ||
m_hostName = Convert.ToString(m_hostName + Convert.ToString(".")) + m_domainName; | ||
} | ||
|
||
return m_hostName; | ||
|
||
} | ||
catch | ||
{ | ||
} | ||
|
||
// Failure | ||
return ""; | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Credential | ||
/// </summary> | ||
/// <returns></returns> | ||
/// <remarks></remarks> | ||
private static NetworkCredential GetCred() | ||
{ | ||
return new NetworkCredential("somclient", "f9d4269b718121954503fa58dcb3c18e4dc59c32"); | ||
} | ||
|
||
/// <summary> | ||
/// API Header | ||
/// </summary> | ||
/// <returns></returns> | ||
/// <remarks></remarks> | ||
private static string GetHeader() | ||
{ | ||
return "http://api.addins.case-apps.com/"; | ||
} | ||
|
||
/// <summary> | ||
/// Public IP Address | ||
/// </summary> | ||
/// <returns></returns> | ||
/// <remarks></remarks> | ||
private static string GetPublicIp() | ||
{ | ||
|
||
try | ||
{ | ||
const string c_url = "http://checkip.dyndns.org"; | ||
WebRequest req = WebRequest.Create(c_url); | ||
using (WebResponse resp = req.GetResponse()) | ||
{ | ||
StreamReader sr = new StreamReader(resp.GetResponseStream()); | ||
string response = sr.ReadToEnd().Trim(); | ||
string[] a = response.Split(':'); | ||
string a2 = a[1].Substring(1); | ||
string[] a3 = a2.Split('<'); | ||
string a4 = a3[0]; | ||
return a4; | ||
} | ||
|
||
} | ||
catch { } | ||
|
||
// Failure | ||
return "UNKNOWN"; | ||
|
||
} | ||
|
||
#endregion | ||
|
||
#region "Public Members" | ||
|
||
/// <summary> | ||
/// Record | ||
/// </summary> | ||
/// <param name="useProxy"></param> | ||
/// <remarks></remarks> | ||
public static void RecordUsage(bool useProxy = false) | ||
{ | ||
|
||
// Ignore My Calls | ||
if (Environment.MachineName.ToLower() == "case-platinum" & Environment.UserName.ToLower() == "d.rudder") return; | ||
if (Environment.MachineName.ToLower() == "masterdonpc" & Environment.UserName.ToLower() == "masterdon") return; | ||
|
||
try | ||
{ | ||
|
||
// Assembly Data for Tracking | ||
AssemblyInfo m_a = new AssemblyInfo(Assembly.GetExecutingAssembly()); | ||
|
||
string m_url = GetHeader() + "logusage?ip=" + GetPublicIp(); | ||
m_url += "&mac=" + GetFullDomainName(); | ||
m_url += "&netb=" + Environment.MachineName; | ||
m_url += "&appn=" + m_a.Title; | ||
m_url += "&appv=" + m_a.Version.ToString(); | ||
m_url += "&appf=" + "report"; | ||
m_url += "&user=" + Environment.UserName; | ||
m_url += "&mn=" + ""; | ||
|
||
// The Request Call | ||
HttpWebRequest m_req = (HttpWebRequest)HttpWebRequest.Create(m_url); | ||
m_req.Credentials = GetCred(); | ||
m_req.Method = "POST"; | ||
if (useProxy == false) m_req.Proxy = null; | ||
|
||
// Response String | ||
m_req.GetResponse(); | ||
|
||
} | ||
catch | ||
{ | ||
try | ||
{ | ||
if (useProxy == false) RecordUsage(true); | ||
} | ||
catch { } | ||
} | ||
|
||
} | ||
|
||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no"?> | ||
<RevitAddIns> | ||
<AddIn Type="Command"> | ||
<Text>Command Case.ApplySysOrient - Orient</Text> | ||
<Assembly>Case.ApplySysOrient.dll</Assembly> | ||
<ClientId>F09DC30A-0DB2-4C5A-81E5-22a38361F6C1</ClientId> | ||
<FullClassName>Case.ApplySysOrient.Entry.CmdMain</FullClassName> | ||
<VendorId>CASE</VendorId> | ||
<VendorDescription>Case Design Inc. http://www.case-inc.com</VendorDescription> | ||
</AddIn> | ||
<AddIn Type="Command"> | ||
<Text>Command Case.ApplySysOrient - Branches</Text> | ||
<Assembly>Case.ApplySysOrient.dll</Assembly> | ||
<ClientId>F09DC30A-0DB2-4C5A-81E5-22a38361F6C2</ClientId> | ||
<FullClassName>Case.ApplySysOrient.Entry.CmdTrunkOrBranch</FullClassName> | ||
<VendorId>CASE</VendorId> | ||
<VendorDescription>Case Design Inc. http://www.case-inc.com</VendorDescription> | ||
</AddIn> | ||
</RevitAddIns> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{C22FB38E-F3CF-4DDA-A3A9-2C3636E388AC}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Case.ApplySysOrient</RootNamespace> | ||
<AssemblyName>Case.ApplySysOrient</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<Prefer32Bit>false</Prefer32Bit> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<Prefer32Bit>false</Prefer32Bit> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualBasic" /> | ||
<Reference Include="RevitAPI"> | ||
<HintPath>C:\Program Files\Autodesk\Revit 2017\RevitAPI.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="RevitAPIUI"> | ||
<HintPath>C:\Program Files\Autodesk\Revit 2017\RevitAPIUI.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Windows.Forms" /> | ||
<Reference Include="WindowsBase" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="API\clsAPI.cs" /> | ||
<Compile Include="Data\clsDuct.cs" /> | ||
<Compile Include="Data\clsPipe.cs" /> | ||
<Compile Include="Data\clsSettings.cs" /> | ||
<Compile Include="Entry\CmdMain.cs" /> | ||
<Compile Include="Entry\CmdTrunkOrBranch.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Data\clsUtil.cs" /> | ||
<Compile Include="Properties\Resources.Designer.cs"> | ||
<AutoGen>True</AutoGen> | ||
<DesignTime>True</DesignTime> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
<Compile Include="UI\form_MaxSize.cs"> | ||
<SubType>Form</SubType> | ||
</Compile> | ||
<Compile Include="UI\form_MaxSize.Designer.cs"> | ||
<DependentUpon>form_MaxSize.cs</DependentUpon> | ||
</Compile> | ||
<Compile Include="UI\form_Orient.cs"> | ||
<SubType>Form</SubType> | ||
</Compile> | ||
<Compile Include="UI\form_Orient.Designer.cs"> | ||
<DependentUpon>form_Orient.cs</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Resources\tray_32.png" /> | ||
<None Include="Resources\cond_32.png" /> | ||
<None Include="Resources\duct_32.png" /> | ||
<None Include="Resources\pipe_32.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="Properties\Resources.resx"> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
<EmbeddedResource Include="UI\form_MaxSize.resx"> | ||
<DependentUpon>form_MaxSize.cs</DependentUpon> | ||
</EmbeddedResource> | ||
<EmbeddedResource Include="UI\form_Orient.resx"> | ||
<DependentUpon>form_Orient.cs</DependentUpon> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<PropertyGroup> | ||
<PostBuildEvent>copy "$(TargetDir)\*" "$(SolutionDir)\deploy\2017\" /Y</PostBuildEvent> | ||
</PropertyGroup> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.30110.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Case.ApplySysOrient", "Case.ApplySysOrient.csproj", "{C99D99BA-1AD3-4408-82D7-FF3F5E24821D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C99D99BA-1AD3-4408-82D7-FF3F5E24821D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C99D99BA-1AD3-4408-82D7-FF3F5E24821D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C99D99BA-1AD3-4408-82D7-FF3F5E24821D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C99D99BA-1AD3-4408-82D7-FF3F5E24821D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Autodesk.Revit.DB; | ||
|
||
namespace Case.ApplySysOrient.Data | ||
{ | ||
public class clsDuct | ||
{ | ||
|
||
private Element _e; | ||
|
||
#region Public Properties | ||
|
||
public string Kind { get; set; } | ||
public double SizeWidth { get; set; } | ||
public double SizeHeight { get; set; } | ||
|
||
#endregion | ||
|
||
public clsDuct(Element e) | ||
{ | ||
|
||
// Widen Scope | ||
_e = e; | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Get the Element | ||
/// </summary> | ||
/// <returns></returns> | ||
public Element GetElement() | ||
{ | ||
return _e; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Autodesk.Revit.DB; | ||
|
||
namespace Case.ApplySysOrient.Data | ||
{ | ||
public class clsPipe | ||
{ | ||
|
||
private Element _e; | ||
|
||
#region Public Properties | ||
|
||
public string Kind { get; set; } | ||
public double Size { get; set; } | ||
|
||
#endregion | ||
|
||
public clsPipe(Element e) | ||
{ | ||
|
||
// Widen Scope | ||
_e = e; | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Get the Element | ||
/// </summary> | ||
/// <returns></returns> | ||
internal Element GetElement() | ||
{ | ||
return _e; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.