mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-18 02:21:33 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{F554DDCD-744E-4192-9448-0447A06E8AA9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ASCE_7_10</RootNamespace>
|
||||
<AssemblyName>ASCE-7-10</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CodeChecking">
|
||||
<HintPath>..\..\..\..\..\References\CodeChecking\Platform\CodeChecking.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="CodeChecking.Storage">
|
||||
<HintPath>..\..\..\..\..\References\CodeChecking\Platform\CodeChecking.Storage.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="CodeChecking.UI">
|
||||
<HintPath>..\..\..\..\..\References\CodeChecking\Platform\CodeChecking.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ExtensibleStorageFramework">
|
||||
<HintPath>..\..\..\..\..\References\ExtensibleStorageFramework\ExtensibleStorageFramework.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ExtensibleStorageFramework.UI">
|
||||
<HintPath>..\..\..\..\..\References\ExtensibleStorageFramework\ExtensibleStorageFramework.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RevitAPI">
|
||||
<HintPath>..\..\..\..\..\References\Revit\RevitAPI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RevitAPIUI">
|
||||
<HintPath>..\..\..\..\..\References\Revit\RevitAPIUI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main\LoadCombination.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Main\RevitApplicationDB.cs" />
|
||||
<Compile Include="Main\RevitApplicationUI.cs" />
|
||||
<Compile Include="Server\Server.cs" />
|
||||
<Compile Include="Server\ServerUI.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Addin\ASCE_7_10DB.addin" />
|
||||
<Content Include="Addin\ASCE_7_10UI.addin" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>if exist ..\..\..\..\..\..\..\Tools\BuildEvents\BuildEvents.exe (
|
||||
..\..\..\..\..\..\..\Tools\BuildEvents\BuildEvents.exe prepare_example $(ProjectDir) $(TargetPath) ..\..\..\..\..\Bin\SDK\CodeChecking\VisualStudio\Examples\$(ProjectName)
|
||||
)</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>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="DBApplication">
|
||||
<Name>ASCE_7_10</Name>
|
||||
<Assembly>AssemblyPath</Assembly>
|
||||
<AddInId>0908381c-1a11-48ee-9d3d-a5ddf0152903</AddInId>
|
||||
<FullClassName>ASCE_7_10.RevitApplicationDB</FullClassName>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk,www.Autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Application">
|
||||
<Name>ASCE_7_10UI</Name>
|
||||
<Assembly>AssemblyPath</Assembly>
|
||||
<AddInId>acb459a9-5620-4297-9718-41f987a0c0b8</AddInId>
|
||||
<FullClassName>ASCE_7_10.RevitApplicationUI</FullClassName>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk,www.Autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
|
||||
|
||||
namespace ASCE_7_10
|
||||
{
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("LoadCombination", "68d87b7c-410e-4d19-a59f-1b6f0ded206a")]
|
||||
public class LoadCombination : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
[SchemaProperty()]
|
||||
[EnumControl(Presentation=PresentationMode.OptionList,
|
||||
Item=PresentationItem.Text,
|
||||
Category="General",
|
||||
Description="Generation method"
|
||||
)]
|
||||
public GenerationMethod Method{get;set;}
|
||||
|
||||
public LoadCombination()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public enum GenerationMethod
|
||||
{
|
||||
ASD,
|
||||
LRFD
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace ASCE_7_10
|
||||
{
|
||||
public class RevitApplicationDB : Autodesk.Revit.DB.IExternalDBApplication
|
||||
{
|
||||
#region IExternalDBApplication Members
|
||||
|
||||
public Autodesk.Revit.DB.ExternalDBApplicationResult OnShutdown(Autodesk.Revit.ApplicationServices.ControlledApplication application)
|
||||
{
|
||||
return Autodesk.Revit.DB.ExternalDBApplicationResult.Succeeded;
|
||||
}
|
||||
|
||||
public Autodesk.Revit.DB.ExternalDBApplicationResult OnStartup(Autodesk.Revit.ApplicationServices.ControlledApplication application)
|
||||
{
|
||||
application.ApplicationInitialized += new EventHandler<Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs>(application_ApplicationInitialized);
|
||||
|
||||
|
||||
return Autodesk.Revit.DB.ExternalDBApplicationResult.Succeeded;
|
||||
}
|
||||
|
||||
void application_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e)
|
||||
{
|
||||
Server server = new Server();
|
||||
|
||||
Autodesk.Revit.DB.CodeChecking.LoadCombination.Service.AddServer(server);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ASCE_7_10
|
||||
{
|
||||
class RevitApplicationUI : Autodesk.Revit.UI.IExternalApplication
|
||||
{
|
||||
#region IExternalApplication Members
|
||||
|
||||
public Autodesk.Revit.UI.Result OnShutdown(Autodesk.Revit.UI.UIControlledApplication application)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
public Autodesk.Revit.UI.Result OnStartup(Autodesk.Revit.UI.UIControlledApplication application)
|
||||
{
|
||||
ServerUI server = new ServerUI();
|
||||
Autodesk.Revit.UI.CodeChecking.LoadCombination.ServiceUI.BindUIServerWithDBServer(Server.ID, server);
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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("ASCE_7_10")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("ASCE_7_10")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2011")]
|
||||
[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("a723a5fb-f3f9-48ca-8a1a-96026e50ccf6")]
|
||||
|
||||
// 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("2015.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("2015.0.0.2464")]
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ASCE_7_10.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCE_7_10.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,175 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.CodeChecking;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Storage.LoadCombination;
|
||||
using Autodesk.Revit.DB.CodeChecking.LoadCombination;
|
||||
using Autodesk.Revit.DB.Structure;
|
||||
|
||||
namespace ASCE_7_10
|
||||
{
|
||||
public class Server : Autodesk.Revit.DB.CodeChecking.LoadCombination.Server<LoadCombination>
|
||||
{
|
||||
public static readonly Guid ID = new Guid("34ce88f1-b265-4ab3-a8c2-ff6a49aef797");
|
||||
#region ICodeCheckingServer Members
|
||||
|
||||
public override List<LoadCombinationPreview> GeneratePreview(Autodesk.Revit.DB.CodeChecking.LoadCombination.ServiceData data)
|
||||
{
|
||||
LoadCombinationManager manager = LoadCombinationManager.GetManager(data.Document);
|
||||
|
||||
LoadCombination loadCombination = manager.LoadCombinationParams.GetEntity<LoadCombination>(data.Document);
|
||||
|
||||
if (loadCombination != null)
|
||||
{
|
||||
List<LoadCombinationPreview> combinations = new List<LoadCombinationPreview>();
|
||||
|
||||
LoadCaseArray selectedCases = manager.LoadCombinationParams.GetLoadCasesArray(ID);
|
||||
|
||||
Dictionary<BuiltInCategory,LoadCaseArray> groups = LoadCombinationUtils.GroupLoadCasesDueToCategory(selectedCases);
|
||||
|
||||
List<LoadCaseArray> dead = LoadCombinationUtils.PerformAnd(groups[BuiltInCategory.OST_LoadCasesDead]);
|
||||
List<LoadCaseArray> earthquake = LoadCombinationUtils.PerformOrExlusive(groups[BuiltInCategory.OST_LoadCasesSeismic]);
|
||||
List<LoadCaseArray> live = LoadCombinationUtils.PerformOrInclusive(groups[BuiltInCategory.OST_LoadCasesLive]);
|
||||
List<LoadCaseArray> roof = LoadCombinationUtils.PerformOrInclusive(groups[BuiltInCategory.OST_LoadCasesRoofLive]);
|
||||
List<LoadCaseArray> snow = LoadCombinationUtils.PerformOrExlusive(groups[BuiltInCategory.OST_LoadCasesSnow]);
|
||||
List<LoadCaseArray> wind = LoadCombinationUtils.PerformOrExlusive(groups[BuiltInCategory.OST_LoadCasesWind]);
|
||||
|
||||
List<LoadCombinationPreview> previews;
|
||||
|
||||
if (loadCombination.Method == GenerationMethod.LRFD)
|
||||
{
|
||||
//1.4D
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.4D", dead, 1.4);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
//1.2D+1.6l+0.5(Lr or S)
|
||||
//+ 1.2D+1.6L+0.5Lr
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.6L+0.5Lr", dead, 1.2, live, 1.6, roof, 0.5);
|
||||
combinations.AddRange(previews);
|
||||
//+ 1.2D+1.6L+0.5S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.6L+0.5S", dead, 1.2, live, 1.6, snow, 0.5);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
//1.2D+1.6(Lr or S) + (L or 0.5W)
|
||||
//+1.2D+1.6Lr + L
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.6Lr + L",dead, 1.2, roof, 1.6, live, 1.0);
|
||||
combinations.AddRange(previews);
|
||||
//+1.2D+1.6Lr + 0.5W
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.6Lr + 0.5W",dead, 1.2, roof, 1.6, wind, 0.5);
|
||||
combinations.AddRange(previews);
|
||||
//+1.2D+1.6S + L
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.6S + L",dead, 1.2, snow, 1.6, live, 1.0);
|
||||
combinations.AddRange(previews);
|
||||
//+1.2D+1.6S + 0.5W
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.6S + 0.5W", dead, 1.2, snow, 1.6, wind, 0.5);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
//1.2D+1.0W+L+0.5(Lr or S)
|
||||
//+1.2D+1.0W+L+0.5Lr
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.0W+L+0.5Lr",dead, 1.2, wind, 1.0, live, 1.0,roof,0.5);
|
||||
combinations.AddRange(previews);
|
||||
//+1.2D+1.0W+L+0.5S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.0W+L+0.5S",dead, 1.2, wind, 1.0, live, 1.0, snow, 0.5);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
//1.2D+1.0E+L+0.2S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("1.2D+1.0E+L+0.2S", dead, 1.2, earthquake, 1.0, live, 1.0, snow, 0.2);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
//0.9D+1.0W
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("0.9D+1.0W",dead, 0.9, wind, 1.0);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
//0.9D+1.0E
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("0.9D+1.0E", dead, 0.9, earthquake, 1.0);
|
||||
combinations.AddRange(previews);
|
||||
}
|
||||
else
|
||||
{
|
||||
//D
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D", dead, 1.0);
|
||||
combinations.AddRange(previews);
|
||||
//D+L
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+L", dead, 1.0,live,1.0);
|
||||
combinations.AddRange(previews);
|
||||
//D+(Lr or S)
|
||||
//+D+Lr
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+Lr", dead, 1.0, roof,1.0);
|
||||
combinations.AddRange(previews);
|
||||
//+D+S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+S", dead, 1.0, snow, 1.0);
|
||||
combinations.AddRange(previews);
|
||||
//D+0.75L+0.75(Lr or S)
|
||||
//+D+0.75L+0.75Lr
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.75L+0.75Lr", dead, 1.0, live, 0.75,roof,0.75);
|
||||
combinations.AddRange(previews);
|
||||
//+D+0.75L+0.75S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.75L+0.75S", dead, 1.0, live, 0.75, snow, 0.75);
|
||||
combinations.AddRange(previews);
|
||||
//D+(0.6W or 0.7E)
|
||||
//D+0.6W
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.6W", dead, 1.0, wind, 0.6);
|
||||
combinations.AddRange(previews);
|
||||
//D+0.7E
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.7E", dead, 1.0, earthquake, 0.7);
|
||||
combinations.AddRange(previews);
|
||||
//D+0.75(0.6W)+0.75L+0.75(Lr or S)
|
||||
//+D+0.75(0.6W)+0.75L+0.75Lr
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.75(0.6W)+0.75L+0.75Lr", dead, 1.0, wind, 0.75*0.6,live,0.75,roof,0.75);
|
||||
combinations.AddRange(previews);
|
||||
//+D+0.75(0.6W)+0.75L+0.75S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.75(0.6W)+0.75L+0.75S", dead, 1.0, wind, 0.75 * 0.6, live, 0.75, snow, 0.75);
|
||||
combinations.AddRange(previews);
|
||||
//D+0.75(0.7E)+0.75L+0.75S
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("D+0.75(0.7E)+0.75L+0.75S", dead, 1.0, earthquake, 0.75 * 0.7, live, 0.75, snow, 0.75);
|
||||
combinations.AddRange(previews);
|
||||
//0.6D+0.6W
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("0.6D+0.6W", dead, 0.6, wind, 0.6);
|
||||
combinations.AddRange(previews);
|
||||
//0.6D+0.7E
|
||||
previews = LoadCombinationUtils.CreateLoadCombinations("0.6D+0.7E", dead, 0.6, earthquake, 0.7);
|
||||
combinations.AddRange(previews);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return combinations;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override bool RemoveLoadCombinations()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IExternalServer Members
|
||||
|
||||
public override string GetDescription()
|
||||
{
|
||||
return "This is the code which generate load combinations according ASCE-7-10";
|
||||
}
|
||||
|
||||
public override string GetName()
|
||||
{
|
||||
return "ASCE-7-10";
|
||||
}
|
||||
|
||||
public override Guid GetServerId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override string GetVendorId()
|
||||
{
|
||||
return "John Smith";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
|
||||
namespace ASCE_7_10
|
||||
{
|
||||
public class ServerUI : Autodesk.Revit.UI.CodeChecking.LoadCombination.Server<LoadCombination>
|
||||
{
|
||||
#region ICodeCheckingServerUI Members
|
||||
|
||||
public override string GetResource(string key, string context)
|
||||
{
|
||||
string txt = ASCE_7_10.Properties.Resources.ResourceManager.GetString(key);
|
||||
|
||||
if (!string.IsNullOrEmpty(txt))
|
||||
return txt;
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
public override Uri GetResourceImage(string key, string context)
|
||||
{
|
||||
return new Uri(@"pack://application:,,,/ASCE_7_10;component/" + key);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user