mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-30 00:23:01 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>AnalyticalSupportData_Info.dll</Assembly>
|
||||
<ClientId>4367318e-3965-422c-887f-554694376067</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.AnalyticalSupportData_Info.CS.Command</FullClassName>
|
||||
<Text>Analytical SupportData Information</Text>
|
||||
<Description>Displays the element's support information</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -0,0 +1,260 @@
|
||||
//
|
||||
// (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.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.DB.Structure;
|
||||
|
||||
namespace Revit.SDK.Samples.AnalyticalSupportData_Info.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// get element's id and type information and its supported information.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command: IExternalCommand
|
||||
{
|
||||
|
||||
ExternalCommandData m_revit = null; // application of Revit
|
||||
DataTable m_elementInformation = null; // store all required information
|
||||
|
||||
/// <summary>
|
||||
/// property to get private member variable m_elementInformation.
|
||||
/// </summary>
|
||||
public DataTable ElementInformation
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_elementInformation;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implement this method as an external command for Revit.
|
||||
/// </summary>
|
||||
/// <param name="revit">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(Autodesk.Revit.UI.ExternalCommandData revit,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
// Set currently executable application to private variable m_revit
|
||||
m_revit = revit;
|
||||
|
||||
ElementSet selectedElements = new ElementSet();
|
||||
foreach (ElementId elementId in m_revit.Application.ActiveUIDocument.Selection.GetElementIds())
|
||||
{
|
||||
selectedElements.Insert(m_revit.Application.ActiveUIDocument.Document.GetElement(elementId));
|
||||
}
|
||||
|
||||
// get all the required information of selected elements and store them in a data table.
|
||||
m_elementInformation = StoreInformationInDataTable(selectedElements);
|
||||
|
||||
// show UI
|
||||
AnalyticalSupportData_InfoForm displayForm = new AnalyticalSupportData_InfoForm(this);
|
||||
displayForm.ShowDialog();
|
||||
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get all the required information of selected elements and store them in a data table
|
||||
/// </summary>
|
||||
/// <param name="selectedElements">
|
||||
/// all selected elements in Revit main program
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// a data table which store all the required information
|
||||
/// </returns>
|
||||
private DataTable StoreInformationInDataTable(ElementSet selectedElements)
|
||||
{
|
||||
DataTable informationTable = CreatDataTable();
|
||||
|
||||
foreach (Element element in selectedElements)
|
||||
{
|
||||
// Get
|
||||
AnalyticalModel analyticalModel = element.GetAnalyticalModel();
|
||||
if (null == analyticalModel) // skip no AnalyticalModel element
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
DataRow newRow = informationTable.NewRow();
|
||||
string idValue = element.Id.IntegerValue.ToString();// store element Id value
|
||||
string typeName = ""; // store element type name
|
||||
string[] supportInformation = GetSupportInformation(analyticalModel);// store support information
|
||||
|
||||
// get element type information
|
||||
switch (element.GetType().Name)
|
||||
{
|
||||
case "WallFoundation":
|
||||
WallFoundation wallFound = element as WallFoundation;
|
||||
ElementType wallFootSymbol =m_revit.Application.ActiveUIDocument.Document.GetElement(wallFound.GetTypeId()) as ElementType;// get element Type
|
||||
typeName = wallFootSymbol.Category.Name + ": " + wallFootSymbol.Name;
|
||||
break;
|
||||
|
||||
case "FamilyInstance":
|
||||
FamilyInstance familyInstance = element as FamilyInstance;
|
||||
FamilySymbol symbol = m_revit.Application.ActiveUIDocument.Document.GetElement(familyInstance.GetTypeId()) as FamilySymbol;
|
||||
typeName = symbol.Family.Name + ": " + symbol.Name;
|
||||
break;
|
||||
|
||||
case "Floor":
|
||||
Floor slab = element as Floor;
|
||||
FloorType slabType = m_revit.Application.ActiveUIDocument.Document.GetElement(slab.GetTypeId()) as FloorType; // get element type
|
||||
typeName = slabType.Category.Name + ": " + slabType.Name;
|
||||
break;
|
||||
|
||||
case "Wall":
|
||||
Wall wall = element as Wall;
|
||||
WallType wallType = m_revit.Application.ActiveUIDocument.Document.GetElement(wall.GetTypeId()) as WallType; // get element type
|
||||
typeName = wallType.Kind.ToString() + ": " + wallType.Name;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// set the relative information of current element into the table.
|
||||
newRow["Id"] = idValue;
|
||||
newRow["Element Type"] = typeName;
|
||||
newRow["Support Type"] = supportInformation[0];
|
||||
newRow["Remark"] = supportInformation[1];
|
||||
informationTable.Rows.Add(newRow);
|
||||
}
|
||||
|
||||
return informationTable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// create a empty DataTable
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private DataTable CreatDataTable()
|
||||
{
|
||||
// Create a new DataTable.
|
||||
DataTable elementInformationTable = new DataTable("ElementInformationTable");
|
||||
|
||||
// Create element id column and add to the DataTable.
|
||||
DataColumn idColumn = new DataColumn();
|
||||
idColumn.DataType = typeof(System.String);
|
||||
idColumn.ColumnName = "Id";
|
||||
idColumn.Caption = "Id";
|
||||
idColumn.ReadOnly = true;
|
||||
elementInformationTable.Columns.Add(idColumn);
|
||||
|
||||
// Create element type column and add to the DataTable.
|
||||
DataColumn typeColumn = new DataColumn();
|
||||
typeColumn.DataType = typeof(System.String);
|
||||
typeColumn.ColumnName = "Element Type";
|
||||
typeColumn.Caption = "Element Type";
|
||||
typeColumn.ReadOnly = true;
|
||||
elementInformationTable.Columns.Add(typeColumn);
|
||||
|
||||
// Create support column and add to the DataTable.
|
||||
DataColumn supportColumn = new DataColumn();
|
||||
supportColumn.DataType = typeof(System.String);
|
||||
supportColumn.ColumnName = "Support Type";
|
||||
supportColumn.Caption = "Support Type";
|
||||
supportColumn.ReadOnly = true;
|
||||
elementInformationTable.Columns.Add(supportColumn);
|
||||
|
||||
// Create a column which can note others information
|
||||
DataColumn remarkColumn = new DataColumn();
|
||||
remarkColumn.DataType = typeof(System.String);
|
||||
remarkColumn.ColumnName = "Remark";
|
||||
remarkColumn.Caption = "Remark";
|
||||
remarkColumn.ReadOnly = true;
|
||||
elementInformationTable.Columns.Add(remarkColumn);
|
||||
|
||||
return elementInformationTable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get element's support information
|
||||
/// </summary>
|
||||
/// <param name="analyticalModel"> element's analytical model</param>
|
||||
/// <returns></returns>
|
||||
private string[] GetSupportInformation(AnalyticalModel analyticalModel)
|
||||
{
|
||||
// supportInformation[0] store supportType
|
||||
// supportInformation[1] store other informations
|
||||
string[] supportInformations = new string[2] { "", "" };
|
||||
|
||||
IList<AnalyticalModelSupport> supports = analyticalModel.GetAnalyticalModelSupports();
|
||||
|
||||
// "Supported" flag indicates if the Element is completely supported.
|
||||
// AnalyticalModel Support list keeps track of all supports.
|
||||
if (!analyticalModel.IsElementFullySupported())// judge if supported
|
||||
{
|
||||
if (0 == supports.Count)
|
||||
{
|
||||
supportInformations[0] = "not supported";
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (AnalyticalModelSupport support in supports)
|
||||
{
|
||||
supportInformations[0] = supportInformations[0] +
|
||||
support.GetSupportType().ToString() + ", ";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 == supports.Count)
|
||||
{
|
||||
supportInformations[1] = "supported but no more information";
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (AnalyticalModelSupport support in supports)
|
||||
{
|
||||
supportInformations[0] = supportInformations[0] +
|
||||
support.GetSupportType().ToString() + ", ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return supportInformations;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F2A2735F-CE2A-4F76-89E2-A358122F5B02}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AnalyticalSupportData_Info</RootNamespace>
|
||||
<AssemblyName>AnalyticalSupportData_Info</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<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>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
</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>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<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>
|
||||
<Optimize>true</Optimize>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AnalyticalSupportData_Info.cs" />
|
||||
<Compile Include="AnalyticalSupportData_InfoForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AnalyticalSupportData_InfoForm.Designer.cs">
|
||||
<DependentUpon>AnalyticalSupportData_InfoForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="AnalyticalSupportData_InfoForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>AnalyticalSupportData_InfoForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(SolutionDir)VSProps\SDKSamples.targets" />
|
||||
<!-- 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>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<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>
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// (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.
|
||||
//
|
||||
|
||||
|
||||
namespace Revit.SDK.Samples.AnalyticalSupportData_Info.CS
|
||||
{
|
||||
partial class AnalyticalSupportData_InfoForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.closeButton = new System.Windows.Forms.Button();
|
||||
this.elementInfoDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.typeName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.support = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.elementInfoDataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// closeButton
|
||||
//
|
||||
this.closeButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.closeButton.Location = new System.Drawing.Point(690, 342);
|
||||
this.closeButton.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.closeButton.Name = "closeButton";
|
||||
this.closeButton.Size = new System.Drawing.Size(68, 24);
|
||||
this.closeButton.TabIndex = 0;
|
||||
this.closeButton.Text = "&Close";
|
||||
this.closeButton.UseVisualStyleBackColor = true;
|
||||
this.closeButton.Click += new System.EventHandler(this.closeButton_Click);
|
||||
//
|
||||
// elementInfoDataGridView
|
||||
//
|
||||
this.elementInfoDataGridView.AllowUserToAddRows = false;
|
||||
this.elementInfoDataGridView.AllowUserToDeleteRows = false;
|
||||
this.elementInfoDataGridView.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
this.elementInfoDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||
this.elementInfoDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.id,
|
||||
this.typeName,
|
||||
this.support,
|
||||
this.remark});
|
||||
this.elementInfoDataGridView.Location = new System.Drawing.Point(15, 10);
|
||||
this.elementInfoDataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.elementInfoDataGridView.Name = "elementInfoDataGridView";
|
||||
this.elementInfoDataGridView.ReadOnly = true;
|
||||
this.elementInfoDataGridView.RowHeadersVisible = false;
|
||||
this.elementInfoDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
|
||||
this.elementInfoDataGridView.RowTemplate.Height = 24;
|
||||
this.elementInfoDataGridView.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.elementInfoDataGridView.Size = new System.Drawing.Size(743, 324);
|
||||
this.elementInfoDataGridView.TabIndex = 1;
|
||||
//
|
||||
// id
|
||||
//
|
||||
this.id.HeaderText = "Element ID";
|
||||
this.id.Name = "id";
|
||||
this.id.ReadOnly = true;
|
||||
this.id.Width = 90;
|
||||
//
|
||||
// typeName
|
||||
//
|
||||
this.typeName.HeaderText = "Element Type";
|
||||
this.typeName.Name = "typeName";
|
||||
this.typeName.ReadOnly = true;
|
||||
this.typeName.Width = 250;
|
||||
//
|
||||
// support
|
||||
//
|
||||
this.support.HeaderText = "Support Type";
|
||||
this.support.Name = "support";
|
||||
this.support.ReadOnly = true;
|
||||
this.support.Width = 200;
|
||||
//
|
||||
// remark
|
||||
//
|
||||
this.remark.HeaderText = "Remark";
|
||||
this.remark.Name = "remark";
|
||||
this.remark.ReadOnly = true;
|
||||
this.remark.Width = 200;
|
||||
//
|
||||
// AnalyticalSupportData_InfoForm
|
||||
//
|
||||
this.AcceptButton = this.closeButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.closeButton;
|
||||
this.ClientSize = new System.Drawing.Size(772, 370);
|
||||
this.Controls.Add(this.elementInfoDataGridView);
|
||||
this.Controls.Add(this.closeButton);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AnalyticalSupportData_InfoForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Analytical Support Data";
|
||||
((System.ComponentModel.ISupportInitialize)(this.elementInfoDataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button closeButton;
|
||||
private System.Windows.Forms.DataGridView elementInfoDataGridView;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn id;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn typeName;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn support;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// (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.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Revit.SDK.Samples.AnalyticalSupportData_Info.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// UI which display the information
|
||||
/// </summary>
|
||||
public partial class AnalyticalSupportData_InfoForm : System.Windows.Forms.Form
|
||||
{
|
||||
// an instance of Command class which is prepared the displayed data.
|
||||
Command m_dataBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
AnalyticalSupportData_InfoForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
/// <param name="dataBuffer"></param>
|
||||
public AnalyticalSupportData_InfoForm(Command dataBuffer) : this()
|
||||
{
|
||||
m_dataBuffer = dataBuffer;
|
||||
// display the elements information, which is prepared by Command class, in a grid.
|
||||
// set data source
|
||||
elementInfoDataGridView.AutoGenerateColumns = false;
|
||||
elementInfoDataGridView.DataSource = m_dataBuffer.ElementInformation;
|
||||
|
||||
id.DataPropertyName = "Id";
|
||||
typeName.DataPropertyName = "Element Type";
|
||||
support.DataPropertyName = "Support Type";
|
||||
remark.DataPropertyName = "Remark";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// exit
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void closeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
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">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<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" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="id.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="typeName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="support.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="id.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="typeName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="support.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// (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;
|
||||
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("AnalyticalSupportData_Info")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AnalyticalSupportData_Info")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("0d70dc06-c0ff-424a-9d41-36a4f5dffba9")]
|
||||
|
||||
// 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.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
Reference in New Issue
Block a user