mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-27 13:06:57 +00:00
integrate Revit 2025 SDK
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
// (C) Copyright 2003-2023 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,
|
||||
@@ -34,7 +34,7 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -79,3 +79,5 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("windows7.0")]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
// (C) Copyright 2003-2023 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,
|
||||
@@ -165,7 +165,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
if (!Init())
|
||||
{
|
||||
// there must be exactly one beam, column or brace selected
|
||||
TaskDialog.Show("Revit", "You should select only one beam, structural column or brace.");
|
||||
Autodesk.Revit.UI.TaskDialog.Show("Revit", "You should select only one beam, structural column or brace.");
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
}
|
||||
catch
|
||||
{
|
||||
TaskDialog.Show("Revit", "Sorry that your command failed.");
|
||||
Autodesk.Revit.UI.TaskDialog.Show("Revit", "Sorry that your command failed.");
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
documentTransaction.Commit();
|
||||
|
||||
@@ -1,144 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project Sdk="">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4AD14A32-1CFA-4843-A645-E34FA2868F57}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>MaterialProperties</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>MaterialProperties</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<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>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>true</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>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<!--Added [false] deterministic property to prevent CS8357 when AssemblyInfo.cs contains wildcard in version string-->
|
||||
<Deterministic>false</Deterministic>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.props" />
|
||||
<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>
|
||||
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.targets" />
|
||||
<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.Drawing">
|
||||
<Name>System.Drawing</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="MaterialProperties.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MaterialPropertiesForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="MaterialPropertiesForm.resx">
|
||||
<DependentUpon>MaterialPropertiesForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(SolutionDir)VSProps\SDKSamples.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.py"
|
||||
if exist %25FILEFORSAMPLEREG%25 py -3 %25FILEFORSAMPLEREG%25 "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
// (C) Copyright 2003-2023 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,
|
||||
@@ -45,7 +45,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.Button applyButton;
|
||||
private System.Windows.Forms.Button changeButton;
|
||||
private System.Windows.Forms.DataGrid parameterDataGrid;
|
||||
private System.Windows.Forms.DataGridView parameterDataGridView;
|
||||
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@@ -66,8 +66,8 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
parameterDataGrid.PreferredColumnWidth = parameterDataGrid.Width / 2 - 2;
|
||||
|
||||
//parameterDataGrid.PreferredColumnWidth = parameterDataGrid.Width / 2 - 2;
|
||||
|
||||
m_dataBuffer = dataBuffer;
|
||||
}
|
||||
|
||||
@@ -79,10 +79,24 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
if (disposing)
|
||||
{
|
||||
if (components != null)
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
components.Dispose();
|
||||
if (typeLable != null)
|
||||
typeLable.Dispose();
|
||||
if (typeComboBox != null)
|
||||
typeComboBox.Dispose();
|
||||
if (subTypeComboBox != null)
|
||||
subTypeComboBox.Dispose();
|
||||
if (okButton != null)
|
||||
okButton.Dispose();
|
||||
if (cancelButton != null)
|
||||
cancelButton.Dispose();
|
||||
if (applyButton != null)
|
||||
applyButton.Dispose();
|
||||
if (changeButton != null)
|
||||
changeButton.Dispose();
|
||||
if (parameterDataGridView != null)
|
||||
parameterDataGridView.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
@@ -98,12 +112,12 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
this.typeLable = new System.Windows.Forms.Label();
|
||||
this.typeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.subTypeComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.parameterDataGrid = new System.Windows.Forms.DataGrid();
|
||||
this.parameterDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.applyButton = new System.Windows.Forms.Button();
|
||||
this.changeButton = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.parameterDataGrid)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.parameterDataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// typeLable
|
||||
@@ -136,16 +150,16 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
//
|
||||
// parameterDataGrid
|
||||
//
|
||||
this.parameterDataGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.parameterDataGrid.CaptionVisible = false;
|
||||
this.parameterDataGrid.DataMember = "";
|
||||
this.parameterDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.parameterDataGrid.Location = new System.Drawing.Point(16, 88);
|
||||
this.parameterDataGrid.Name = "parameterDataGrid";
|
||||
this.parameterDataGrid.ReadOnly = true;
|
||||
this.parameterDataGrid.RowHeadersVisible = false;
|
||||
this.parameterDataGrid.Size = new System.Drawing.Size(480, 380);
|
||||
this.parameterDataGrid.TabIndex = 4;
|
||||
this.parameterDataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
//this.parameterDataGrid.CaptionVisible = false;
|
||||
this.parameterDataGridView.DataMember = "";
|
||||
//this.parameterDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.parameterDataGridView.Location = new System.Drawing.Point(16, 88);
|
||||
this.parameterDataGridView.Name = "parameterDataGrid";
|
||||
this.parameterDataGridView.ReadOnly = true;
|
||||
this.parameterDataGridView.RowHeadersVisible = false;
|
||||
this.parameterDataGridView.Size = new System.Drawing.Size(480, 380);
|
||||
this.parameterDataGridView.TabIndex = 4;
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
@@ -197,7 +211,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
this.Controls.Add(this.applyButton);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.Controls.Add(this.parameterDataGrid);
|
||||
this.Controls.Add(this.parameterDataGridView);
|
||||
this.Controls.Add(this.subTypeComboBox);
|
||||
this.Controls.Add(this.typeComboBox);
|
||||
this.Controls.Add(this.typeLable);
|
||||
@@ -208,7 +222,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Material Properties";
|
||||
this.Load += new System.EventHandler(this.MaterialPropFrm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.parameterDataGrid)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.parameterDataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -239,7 +253,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
subTypeComboBox.DataSource = m_dataBuffer.SteelCollection;
|
||||
subTypeComboBox.DisplayMember = "MaterialName";
|
||||
subTypeComboBox.ValueMember = "Material";
|
||||
parameterDataGrid.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
parameterDataGridView.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
}
|
||||
else if ((StructuralAssetClass)typeComboBox.SelectedIndex == StructuralAssetClass.Concrete)
|
||||
{
|
||||
@@ -249,7 +263,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
subTypeComboBox.DataSource = m_dataBuffer.ConcreteCollection;
|
||||
subTypeComboBox.DisplayMember = "MaterialName";
|
||||
subTypeComboBox.ValueMember = "Material";
|
||||
parameterDataGrid.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
parameterDataGridView.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -257,7 +271,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
changeButton.Enabled = false;
|
||||
subTypeComboBox.DataSource = new ArrayList();
|
||||
subTypeComboBox.Enabled = false;
|
||||
parameterDataGrid.DataSource = new DataTable();
|
||||
parameterDataGridView.DataSource = new DataTable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +288,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
m_dataBuffer.UpdateMaterial(subTypeComboBox.SelectedValue);
|
||||
}
|
||||
|
||||
parameterDataGrid.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
parameterDataGridView.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -326,11 +340,11 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
/// <param name="e"></param>
|
||||
private void changeButton_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
TaskDialog.Show("Revit", "This will change the unit weight of all instances that use this material in current document.");
|
||||
Autodesk.Revit.UI.TaskDialog.Show("Revit", "This will change the unit weight of all instances that use this material in current document.");
|
||||
|
||||
if (!m_dataBuffer.ChangeUnitWeight())
|
||||
{
|
||||
TaskDialog.Show("Revit", "Failed to change the unit weight.");
|
||||
Autodesk.Revit.UI.TaskDialog.Show("Revit", "Failed to change the unit weight.");
|
||||
return;
|
||||
}
|
||||
LoadCurrentMaterial();
|
||||
@@ -355,7 +369,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
return;
|
||||
|
||||
subTypeComboBox.SelectedValue = tmp;
|
||||
parameterDataGrid.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
parameterDataGridView.DataSource = m_dataBuffer.GetParameterTable(subTypeComboBox.SelectedValue, (StructuralAssetClass)typeComboBox.SelectedIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user