added Revit 2022 SDK minus except *rvt and *rfa

This commit is contained in:
Jeremy Tammik
2021-04-20 11:36:21 +02:00
parent 1133a82dc5
commit 7e327986e8
3034 changed files with 1245318 additions and 0 deletions
@@ -0,0 +1,80 @@
//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System.Reflection;
using System.Runtime.CompilerServices;
//
// 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("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
+257
View File
@@ -0,0 +1,257 @@
//
// (C) Copyright 2003-2019 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
using System;
using System.Windows.Forms;
using Autodesk.Revit;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
namespace Revit.SDK.Samples.PhysicalProp.CS
{
/// <summary>
/// Define a command to dump physical material properties of
/// a structural element such as column, beam or brace.
/// </summary>
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.ReadOnly)]
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
public class DumpMaterialPhysicalParameters : Autodesk.Revit.UI.IExternalCommand
{
/// <summary>
/// Implement this method as an external command for Revit.
/// </summary>
/// <param name="commandData">An object that is passed to the external application
/// which contains data related to the command,
/// such as the application object and active view.</param>
/// <param name="message">A message that can be set by the external application
/// which will be displayed if a failure or cancellation is returned by
/// the external command.</param>
/// <param name="elements">A set of elements to which the external application
/// can add elements that are to be highlighted in case of failure or cancellation.</param>
/// <returns>Return the status of the external command.
/// A result of Succeeded means that the API external method functioned as expected.
/// Cancelled can be used to signify that the user cancelled the external operation
/// at some point. Failure should be returned if the application is unable to proceed with
/// the operation.</returns>
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
ref string message, ElementSet elements)
{
Autodesk.Revit.UI.Result res = Autodesk.Revit.UI.Result.Succeeded;
try
{
UIDocument activeDoc = commandData.Application.ActiveUIDocument;
string str;
Material materialElement = null;
ElementSet selection = new ElementSet();
foreach (ElementId elementId in activeDoc.Selection.GetElementIds())
{
selection.Insert(activeDoc.Document.GetElement(elementId));
}
if (selection.Size != 1)
{
message = "Please select only one element.";
res = Autodesk.Revit.UI.Result.Failed;
return res;
}
System.Collections.IEnumerator iter;
ElementSet es = new ElementSet();
foreach (ElementId elementId in activeDoc.Selection.GetElementIds())
{
es.Insert(activeDoc.Document.GetElement(elementId));
}
iter = es.ForwardIterator();
iter.MoveNext();
// we need verify the selected element is a family instance
FamilyInstance famIns = iter.Current as FamilyInstance;
if (famIns == null)
{
TaskDialog.Show("Revit", "Not a type of FamilyInsance!");
res = Autodesk.Revit.UI.Result.Failed;
return res;
}
// we need select a column instance
foreach (Parameter p in famIns.Parameters)
{
string parName = p.Definition.Name;
// The "Beam Material" and "Column Material" family parameters have been replaced
// by the built-in parameter "Structural Material".
//if (parName == "Column Material" || parName == "Beam Material")
if (parName == "Structural Material")
{
Autodesk.Revit.DB.ElementId elemId = p.AsElementId();
materialElement = activeDoc.Document.GetElement(elemId) as Material;
break;
}
}
if (materialElement == null)
{
TaskDialog.Show("Revit", "Not a column!");
res = Autodesk.Revit.UI.Result.Failed;
return res;
}
// the PHY_MATERIAL_PARAM_TYPE built in parameter contains a number
// that represents the type of material
Parameter materialType =
materialElement.get_Parameter(BuiltInParameter.PHY_MATERIAL_PARAM_TYPE);
str = "Material type: " +
(materialType.AsInteger() == 0 ?
"Generic" : (materialType.AsInteger() == 1 ? "Concrete" : "Steel")) + "\r\n";
// A material type of more than 0 : 0 = Generic, 1 = Concrete, 2 = Steel
if (materialType.AsInteger() > 0)
{
// Common to all types
// Young's Modulus
double[] youngsModulus = new double[3];
youngsModulus[0] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_YOUNG_MOD1).AsDouble();
youngsModulus[1] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_YOUNG_MOD2).AsDouble();
youngsModulus[2] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_YOUNG_MOD3).AsDouble();
str = str + "Young's modulus: " + youngsModulus[0].ToString() +
"," + youngsModulus[1].ToString() + "," + youngsModulus[2].ToString() +
"\r\n";
// Poisson Modulus
double[] PoissonRatio = new double[3];
PoissonRatio[0] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_POISSON_MOD1).AsDouble();
PoissonRatio[1] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_POISSON_MOD2).AsDouble();
PoissonRatio[2] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_POISSON_MOD3).AsDouble();
str = str + "Poisson modulus: " + PoissonRatio[0].ToString() +
"," + PoissonRatio[1].ToString() + "," + PoissonRatio[2].ToString() +
"\r\n";
// Shear Modulus
double[] shearModulus = new double[3];
shearModulus[0] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_SHEAR_MOD1).AsDouble();
shearModulus[1] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_SHEAR_MOD2).AsDouble();
shearModulus[2] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_SHEAR_MOD3).AsDouble();
str = str + "Shear modulus: " + shearModulus[0].ToString() +
"," + shearModulus[1].ToString() + "," + shearModulus[2].ToString() + "\r\n";
// Thermal Expansion Coefficient
double[] thermalExpCoeff = new double[3];
thermalExpCoeff[0] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_EXP_COEFF1).AsDouble();
thermalExpCoeff[1] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_EXP_COEFF2).AsDouble();
thermalExpCoeff[2] = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_EXP_COEFF3).AsDouble();
str = str + "Thermal expansion coefficient: " + thermalExpCoeff[0].ToString() +
"," + thermalExpCoeff[1].ToString() + "," + thermalExpCoeff[2].ToString() +
"\r\n";
// Unit Weight
double unitWeight;
unitWeight = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_UNIT_WEIGHT).AsDouble();
str = str + "Unit weight: " + unitWeight.ToString() + "\r\n";
// Behavior 0 = Isotropic, 1 = Orthotropic
int behaviour;
behaviour = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_BEHAVIOR).AsInteger();
str = str + "Behavior: " + behaviour.ToString() + "\r\n";
// Concrete Only
if (materialType.AsInteger() == 1)
{
// Concrete Compression
double concreteCompression;
concreteCompression = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_CONCRETE_COMPRESSION).AsDouble();
str = str + "Concrete compression: " + concreteCompression.ToString() + "\r\n";
// Lightweight
double lightWeight;
lightWeight = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_LIGHT_WEIGHT).AsDouble();
str = str + "Lightweight: " + lightWeight.ToString() + "\r\n";
// Shear Strength Reduction
double shearStrengthReduction;
shearStrengthReduction = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_SHEAR_STRENGTH_REDUCTION).AsDouble();
str = str + "Shear strength reduction: " + shearStrengthReduction.ToString() + "\r\n";
}
// Steel only
else if (materialType.AsInteger() == 2)
{
// Minimum Yield Stress
double minimumYieldStress;
minimumYieldStress = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_MINIMUM_YIELD_STRESS).AsDouble();
str = str + "Minimum yield stress: " + minimumYieldStress.ToString() + "\r\n";
// Minimum Tensile Strength
double minimumTensileStrength;
minimumTensileStrength = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_MINIMUM_TENSILE_STRENGTH).AsDouble();
str = str + "Minimum tensile strength: " +
minimumTensileStrength.ToString() + "\r\n";
// Reduction Factor
double reductionFactor;
reductionFactor = materialElement.get_Parameter(
BuiltInParameter.PHY_MATERIAL_PARAM_REDUCTION_FACTOR).AsDouble();
str = str + "Reduction factor: " + reductionFactor.ToString() + "\r\n";
} // end of if/else materialType.Integer == 1
} // end if materialType.Integer > 0
TaskDialog.Show("Physical materials", str);
}
catch (Exception ex)
{
TaskDialog.Show("PhysicalProp", ex.Message);
res = Autodesk.Revit.UI.Result.Failed;
}
finally
{
}
return res;
} // end command
} // end class
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Assembly>PhysicalProp.dll</Assembly>
<ClientId>9d2f90fb-42f4-4923-a99d-65348c2ff4f7</ClientId>
<FullClassName>Revit.SDK.Samples.PhysicalProp.CS.DumpMaterialPhysicalParameters</FullClassName>
<Text>Physical Properties</Text>
<Description>Dump Material Physical Parameters.</Description>
<VisibilityMode>AlwaysVisible</VisibilityMode>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
</RevitAddIns>
@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{40423DF3-F8FE-4BC3-95E8-D4D715313B9B}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>PhysicalProp</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>PhysicalProp</RootNamespace>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<BootstrapperEnabled>true</BootstrapperEnabled>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<FileAlignment>4096</FileAlignment>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<FileAlignment>4096</FileAlignment>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.XML">
<Name>System.XML</Name>
</Reference>
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Command.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(SolutionDir)VSProps\SDKSamples.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
</Project>
Binary file not shown.