mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-28 15:52:54 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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.Diagnostics;
|
||||
using Autodesk.Revit.Attributes;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation;
|
||||
using Autodesk.Revit.UI;
|
||||
using Document = Autodesk.Revit.DB.Document;
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
[Transaction(TransactionMode.Manual)]
|
||||
[Journaling(JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
public static readonly string DefaultLogFilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
|
||||
#region IExternalCommand Members
|
||||
|
||||
public Result Execute(ExternalCommandData commandData,ref string message, ElementSet elements)
|
||||
{
|
||||
Document docRevit = commandData.Application.ActiveUIDocument.Document;
|
||||
// Report main object creation creation
|
||||
var docReport = new Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Document();
|
||||
|
||||
// Content table creation
|
||||
var documentContentTable = new DocumentContentTable(docReport);
|
||||
docReport.Main.Elements.Add(documentContentTable);
|
||||
|
||||
// Fill the using API
|
||||
var reportApi = new ReportApi(docRevit, docReport);
|
||||
reportApi.AddSection("Documentation built using API", 1);
|
||||
reportApi.CreateDocumentApi();
|
||||
reportApi.AddSection("Documentation built using Schemas", 1);
|
||||
|
||||
// Fill the using Schema defined in DocumentationSchema class
|
||||
var reportSchemas = new ReportSchemas(docRevit, docReport);
|
||||
reportSchemas.CreateReportSchema();
|
||||
|
||||
// Build the Content table
|
||||
documentContentTable.Build(DetailLevel.Detail);
|
||||
|
||||
// A Builder object could be a mht, html or text builder based on the output needed
|
||||
var builderMht = new MhtBuilder();
|
||||
|
||||
// Method to build and save the report on a specific location on disk
|
||||
builderMht.BuildDocument(docReport, docRevit, DefaultLogFilePath + "\\Documentation", DetailLevel.Detail);
|
||||
|
||||
// Call Internet Explorer to open the report
|
||||
Process.Start("IEXPLORE.EXE", DefaultLogFilePath + "\\Documentation.mht");
|
||||
return Result.Succeeded;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+237
@@ -0,0 +1,237 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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 Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes;
|
||||
|
||||
|
||||
using Document = Autodesk.Revit.DB.Document;
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
[Schema("SchemaClassDocumentation", "b22a7a96-928b-4ffd-819e-503e275101bd")]
|
||||
public class DocumentationSchema : SchemaClass
|
||||
{
|
||||
public int[] Columns = new[] {20, 30, 40};
|
||||
|
||||
public DocumentationSchema()
|
||||
{
|
||||
Value = "Value";
|
||||
ValueWithName = "ValueWithName";
|
||||
ValueWithDescription = "ValueWithDescription";
|
||||
ValueString = "my simple string";
|
||||
ValueDouble = 10;
|
||||
Ratio1 = 0.9;
|
||||
Ratio2 = 1;
|
||||
Test = "remove canvas";
|
||||
LenghtMeter = 10;
|
||||
Table = new List<string>
|
||||
{"Table 1", "Table 2"};
|
||||
|
||||
ListDoubles = new List<double> {5, 10, 11, 12};
|
||||
TestDictionnary = new Dictionary<double, double>
|
||||
{{1, 1}, {2, 2}, {3, 3}, {4, 4}};
|
||||
SubLabel = new List<SimpleSchema>
|
||||
{new SimpleSchema(), new SimpleSchema(), new SimpleSchema(), new SimpleSchema()};
|
||||
ListSimpleSchemas = new List<SimpleSchema>
|
||||
{new SimpleSchema(), new SimpleSchema(), new SimpleSchema(), new SimpleSchema(), new SimpleSchema()};
|
||||
TestDictionnary2 = new Dictionary<double, SimpleSchema>
|
||||
{{1, new SimpleSchema()}, {2, new SimpleSchema()}, {3, new SimpleSchema()}, {4, new SimpleSchema()}};
|
||||
}
|
||||
|
||||
public DocumentationSchema(Autodesk.Revit.DB.Document document)
|
||||
{
|
||||
Value = "Value";
|
||||
ValueWithName = "ValueWithName";
|
||||
ValueWithDescription = "ValueWithDescription";
|
||||
Table = new List<string> {"Table 1", "Table 2"};
|
||||
}
|
||||
|
||||
public DocumentationSchema(Entity entity, Autodesk.Revit.DB.Document document)
|
||||
: base(entity, document)
|
||||
{
|
||||
Value = "Value";
|
||||
ValueWithName = "ValueWithName";
|
||||
ValueWithDescription = "ValueWithDescription";
|
||||
Table = new List<string> {"Table 1", "Table 2"};
|
||||
}
|
||||
|
||||
[SchemaProperty(FieldName = "SimpleDoubleFieldName", Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Value(
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1
|
||||
)]
|
||||
public Double ValueDouble { get; set; }
|
||||
|
||||
[SchemaProperty(FieldName = "SimpleStringFieldName")]
|
||||
[Value(
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1
|
||||
)]
|
||||
public String ValueString { get; set; }
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Table(
|
||||
Name = "ADictionnary",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1
|
||||
)]
|
||||
public Dictionary<Double, Double> TestDictionnary { get; set; }
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Table(
|
||||
Name = "ADictionnary2",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1
|
||||
)]
|
||||
public Dictionary<Double, SimpleSchema> TestDictionnary2 { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Table(
|
||||
Name = "ListDoublesName",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1
|
||||
)]
|
||||
public List<Double> ListDoubles { get; set; }
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Table(
|
||||
Name = "ListSimpleSchemas",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1
|
||||
)]
|
||||
public List<SimpleSchema> ListSimpleSchemas { get; set; }
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Value(
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 5
|
||||
)]
|
||||
public Double LenghtMeter { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty]
|
||||
[Value(
|
||||
LocalizableValue = true,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = true,
|
||||
Index = 1
|
||||
)]
|
||||
public String Value { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty]
|
||||
[ValueWithName(
|
||||
LocalizableValue = true,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = true,
|
||||
Name = "ValueWithName",
|
||||
Index = 3
|
||||
)]
|
||||
public String ValueWithName { get; set; }
|
||||
|
||||
[SchemaProperty]
|
||||
[ValueWithDescription(
|
||||
LocalizableValue = true,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = true,
|
||||
Name = "ValueWithName",
|
||||
Description = "ValueWithNameDescription",
|
||||
Note = "ValueWithNameNote",
|
||||
Index = 6
|
||||
)]
|
||||
public String ValueWithDescription { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty]
|
||||
[Table(
|
||||
Level = DetailLevel.General,
|
||||
Index = 2,
|
||||
Localizable = false,
|
||||
Name = "TableName"
|
||||
)]
|
||||
public List<String> Table { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty]
|
||||
[Value(
|
||||
LocalizableValue = true,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = true,
|
||||
Index = 4
|
||||
)]
|
||||
public String Test { get; set; }
|
||||
|
||||
[SubSchemaListTable(
|
||||
"ListTable", 10, 30, 60,
|
||||
AddHeader = true,
|
||||
Level = DetailLevel.Detail,
|
||||
Name = "ListTableName",
|
||||
Localizable = true
|
||||
)]
|
||||
[SchemaProperty]
|
||||
public List<SimpleSchema> SubLabel { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Ratio(
|
||||
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1,
|
||||
Name = "Ratio1Name"
|
||||
)]
|
||||
public Double Ratio1 { get; set; }
|
||||
|
||||
|
||||
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Ratio(
|
||||
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = -1,
|
||||
Name = "Ratio2Name"
|
||||
)]
|
||||
public Double Ratio2 { get; set; }
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Name>ExtensibleStorageDocumentation</Name>
|
||||
<Assembly>AssemblyPath</Assembly>
|
||||
<AddInId>7b653422-c7fa-46a6-986f-35c1b87632bb</AddInId>
|
||||
<FullClassName>ExtensibleStorageDocumentation.Command</FullClassName>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.Autodesk.com</VendorDescription>
|
||||
<Text>Extensible Storage Framework - Documentation Overview</Text>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<Discipline>Any</Discipline>
|
||||
<LanguageType>Unknown</LanguageType>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
<?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>{41442C16-4737-4C20-94FF-6F6FFBB29B9A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ExtensibleStorageDocumentation</RootNamespace>
|
||||
<AssemblyName>ExtensibleStorageDocumentation</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ExtensibleStorageFramework">
|
||||
<HintPath>..\..\..\..\..\References\ExtensibleStorageFramework\ExtensibleStorageFramework.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ExtensibleStorageFramework.Documentation">
|
||||
<HintPath>..\..\..\..\..\References\ExtensibleStorageFramework\ExtensibleStorageFramework.Documentation.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ExtensibleStorageFramework.UI">
|
||||
<HintPath>..\..\..\..\..\References\ExtensibleStorageFramework\ExtensibleStorageFramework.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<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.Xaml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Schema.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="ServerDocument.cs" />
|
||||
<Compile Include="ServerUI.cs" />
|
||||
<Compile Include="SubSchema.cs" />
|
||||
<Compile Include="ReportApi.cs" />
|
||||
<Compile Include="ReportSchemas.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ExtensibleStorageDocumentation.addin">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Resource Include="Images\Image.png" />
|
||||
</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>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
+36
@@ -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("ExtensibleStorageDocumentation")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk")]
|
||||
[assembly: AssemblyProduct("ExtensibleStorageDocumentation")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk 2012")]
|
||||
[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("cd4d98b4-78cc-48cf-b7f5-01e5bf1c8bfa")]
|
||||
|
||||
// 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")]
|
||||
SDK/Structural Analysis SDK/Examples/ExtensibleStorageDocumentation/Properties/Resources.Designer.cs
Generated
+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 ExtensibleStorageDocumentation.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("ExtensibleStorageDocumentation.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+101
@@ -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,606 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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 Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation;
|
||||
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This class is an helper class to provide an overview of the documentation features using directly the API
|
||||
/// </summary>
|
||||
internal class ReportApi
|
||||
{
|
||||
/// <summary>
|
||||
/// the length of the beam.
|
||||
/// </summary>
|
||||
private const int lengthBeam = 30;
|
||||
/// <summary>
|
||||
/// the intensity of the load.
|
||||
/// </summary>
|
||||
private const double loadIntensity = 3;
|
||||
|
||||
|
||||
private readonly Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Document docReport;
|
||||
private readonly Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DocumentLineBreak oneLineBreak;
|
||||
private readonly Autodesk.Revit.DB.Document docRevit;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a ReportAPI class instance.
|
||||
/// </summary>
|
||||
/// <param name="activeDocRevit"></param>
|
||||
/// <param name="activeDocReport"></param>
|
||||
public ReportApi(Autodesk.Revit.DB.Document activeDocRevit, Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Document activeDocReport)
|
||||
{
|
||||
this.docRevit = activeDocRevit;
|
||||
this.docReport = activeDocReport;
|
||||
this.oneLineBreak = new DocumentLineBreak(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Main method call to create the documentation using the API.
|
||||
/// Main functionnalities of the API are used on this example.
|
||||
/// </summary>
|
||||
public void CreateDocumentApi()
|
||||
{
|
||||
// How to use different style of titles
|
||||
AddSection("All Title Styles Supported", 1);
|
||||
AddAllTitleType();
|
||||
|
||||
// How to add an image
|
||||
AddSection("Images", 1);
|
||||
AddImage();
|
||||
|
||||
// How to use different style of text
|
||||
AddSection("All Text Styles Supported ", 1);
|
||||
AddAllTextType();
|
||||
|
||||
// How to use different type od diagrams
|
||||
AddSection("All Diagram Type Supported", 1);
|
||||
AddBeamDiagrams();
|
||||
AddSinusXDiagrams();
|
||||
AddSupportedBeamDiagrams();
|
||||
AddCantileverDiagrams();
|
||||
|
||||
// How to use maps
|
||||
AddSection("Maps", 1);
|
||||
AddMap();
|
||||
AddMapWithHole();
|
||||
|
||||
// How to create a table
|
||||
AddSection("stringListValue", 1);
|
||||
AddTables();
|
||||
|
||||
// How to create a status report
|
||||
AddSection("Status", 1);
|
||||
AddStatus();
|
||||
|
||||
// How to add a simple text
|
||||
AddSection("Text In-Line Example", 1);
|
||||
AddTextInline();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method will demonstrates how to create a title and add it to the report.
|
||||
/// 7 styles are supported.
|
||||
/// </summary>
|
||||
private void AddAllTitleType()
|
||||
{
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 1", 1));
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 2", 2));
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 3", 3));
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 4", 4));
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 5", 5));
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 6", 6));
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("This is a title size 7", 7));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to add an image embedded inside the component into the report
|
||||
/// </summary>
|
||||
private void AddImage()
|
||||
{
|
||||
var image = new DocumentImage(new Uri(@"pack://application:,,,/ExtensibleStorageDocumentation;component/Images/Image.png"));
|
||||
this.docReport.Main.Elements.Add(image);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to create a text and add it to the report.
|
||||
/// Text could be normal, with subscript, superscript and symbol characters
|
||||
/// </summary>
|
||||
private void AddAllTextType()
|
||||
{
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentText("This is a normal text"));
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentText("This is a text with{Subscript}"));
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentText("This is a text with{^Superscript}"));
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentText("This is a text with @a"));
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentText("This is a normal text with break line ", true));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to create tables and add them in the report.
|
||||
/// </summary>
|
||||
private void AddTables()
|
||||
{
|
||||
// A 2 x 2 table
|
||||
# region a first table
|
||||
|
||||
var tableTitle = new DocumentTitle { Size = 1, Text = "A 2 x 2 table" };
|
||||
var table = new DocumentTable(2, 2);
|
||||
|
||||
// Set the table title
|
||||
table.Title = tableTitle;
|
||||
// Number of rows and columns to take into consideration to build the table headers
|
||||
table.HeaderColumnsCount = 1;
|
||||
table.HeaderRowsCount = 1;
|
||||
// Specify dimension of columns
|
||||
table.PercentageColumnWidth[0] = 10;
|
||||
table.PercentageColumnWidth[1] = 50;
|
||||
// fill the table
|
||||
table[0, 0].Elements.Add(new DocumentText("columns/rows"));
|
||||
table[0, 1].Elements.Add(new DocumentText("header first column"));
|
||||
table[1, 0].Elements.Add(new DocumentText("header first row"));
|
||||
table[1, 1].Elements.Add(new DocumentText("A value"));
|
||||
|
||||
// Add the table to the report
|
||||
this.docReport.Main.Elements.Add(table);
|
||||
|
||||
# endregion a first table
|
||||
|
||||
// A 12 x 12 table
|
||||
// This table is filled with moment values for a cantilever beam loaded by a concentrated load in different positions.
|
||||
# region a second table
|
||||
|
||||
// Number of division for the beam
|
||||
int numberDivisions = 10;
|
||||
tableTitle = new DocumentTitle { Size = 1, Text = "A 12 x 12 table" };
|
||||
table = new DocumentTable(12, 12);
|
||||
// Set the table title
|
||||
table.Title = tableTitle;
|
||||
// Number of rows and columns to take into consideration to build the table headers
|
||||
table.HeaderColumnsCount = 1;
|
||||
table.HeaderRowsCount = 1;
|
||||
// Specify dimension of columns
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
table.PercentageColumnWidth[i] = Convert.ToInt32(100 / table.ColumnsCount);
|
||||
}
|
||||
|
||||
// fill the table
|
||||
// fill left top corner cell
|
||||
table[0, 0].Elements.Add(new DocumentText("Moment at (x) / Load at (x)"));
|
||||
// fill columns header with the position of the load
|
||||
for (int i = 0; i <= 10; i++)
|
||||
{
|
||||
table[0, i + 1].Elements.Add(new DocumentText(" Load at x = " + i * lengthBeam / numberDivisions));
|
||||
}
|
||||
// fill rows header with the position of the moment
|
||||
for (int i = 0; i <= 10; i++)
|
||||
{
|
||||
table[i + 1, 0].Elements.Add(new DocumentText("Moment at x = " + i * lengthBeam / numberDivisions));
|
||||
}
|
||||
// fill value cells
|
||||
for (int j = 0; j <= numberDivisions; j++)
|
||||
{
|
||||
for (int i = 0; i <= lengthBeam; i += 3)
|
||||
{
|
||||
table[i / 3 + 1, j + 1].Elements.Add(new DocumentText(Math.Max(0, loadIntensity * (i - j * lengthBeam / numberDivisions)).ToString()));
|
||||
}
|
||||
}
|
||||
// Add the table to the report
|
||||
this.docReport.Main.Elements.Add(table);
|
||||
# endregion a second table
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to create different type of diagrams
|
||||
/// Values used are the moment values for a beam loaded by an uniform load.
|
||||
/// The formula used is M(x) = Q/12(6lx-l^2 -6x^2.
|
||||
/// Length unit is set to feet and force unit is set to Kips per foot.
|
||||
/// </summary>
|
||||
private void AddBeamDiagrams()
|
||||
{
|
||||
// Set the main title
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Momemt M(x) = Q/12(6lx-l{^2} -6x{^2}), beam length = 30 feet, load intensity = 3 Kips/feet", 1));
|
||||
|
||||
# region Area Graph Representation
|
||||
|
||||
// Set diagram title
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Area Graph Representation", 2));
|
||||
// Define title in image and default serie name
|
||||
var diagram = new DocumentDiagram("Feet/Moment", "Area Diagram Series"){ Height = 800, Width = 800};
|
||||
var serie = diagram.Series[0];
|
||||
// Set the type of diagram, here area
|
||||
serie.DiagramType = DiagramType.Area;
|
||||
// Set values along the beam, every foot.
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity/12*(6*lengthBeam*i - lengthBeam*lengthBeam - 6*i*i));
|
||||
}
|
||||
// Set the axis labels and specify units and how graduations will be shown
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_DECIMAL_FEET, this.docRevit, 5);
|
||||
diagram.SetLabelsY(UnitType.UT_Moment, DisplayUnitType.DUT_KIP_FEET, this.docRevit, 500);
|
||||
// Add the legend
|
||||
diagram.Legend = true;
|
||||
// Add the diagram to the report
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Area Graph Representation
|
||||
|
||||
# region Bar Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Bar Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Moment/Feet", "Bar Diagram Series"){ Height = 800, Width = 800 };
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Bar;
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity/12*(6*lengthBeam*i - lengthBeam*lengthBeam - 6*i*i));
|
||||
}
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_DECIMAL_FEET, this.docRevit, 10);
|
||||
diagram.SetLabelsY(UnitType.UT_Moment, DisplayUnitType.DUT_KIP_FEET, this.docRevit, 500);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Bar Graph Representation
|
||||
|
||||
# region Column Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Column Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Feet/Moment", "Column Diagram Series"){Height = 800, Width = 800};
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Column;
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity/12*(6*lengthBeam*i - lengthBeam*lengthBeam - 6*i*i));
|
||||
}
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_DECIMAL_FEET, this.docRevit, 10);
|
||||
diagram.SetLabelsY(UnitType.UT_Moment, DisplayUnitType.DUT_KIP_FEET, this.docRevit, 500);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Column Graph Representation
|
||||
|
||||
# region Line Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Line Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Feet/Moment", "Line Diagram Series"){Height = 800, Width = 800 };
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Line;
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity/12*(6*lengthBeam*i - lengthBeam*lengthBeam - 6*i*i));
|
||||
}
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_DECIMAL_FEET, this.docRevit, 10);
|
||||
diagram.SetLabelsY(UnitType.UT_Moment, DisplayUnitType.DUT_KIP_FEET, this.docRevit, 500);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
# endregion Line Graph Representation
|
||||
|
||||
# region Point Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Point Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Feet/Moment", "Point Diagram Series") { Height = 800, Width = 800 };
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Point;
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity/12*(6*lengthBeam*i - lengthBeam*lengthBeam - 6*i*i));
|
||||
}
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_DECIMAL_FEET, this.docRevit, 10);
|
||||
diagram.SetLabelsY(UnitType.UT_Moment, DisplayUnitType.DUT_KIP_FEET, this.docRevit, 500);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Point Graph Representation
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to create different type of diagrams
|
||||
/// This method is really similar to method AddBeamDiagrams
|
||||
/// Values used are based on Sin(x) with x in the range between -2 Pi and 2 Pi
|
||||
/// Angle unit is set to radian and sin(x) is set to a number
|
||||
/// </summary>
|
||||
private void AddSinusXDiagrams()
|
||||
{
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("function Sin(x) with x [-2@p;2@p] ", 1));
|
||||
|
||||
# region Area Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Area Graph Representation", 2));
|
||||
var diagram = new DocumentDiagram("Sin(x)", "Area Diagram Series"){ Height = 400, Width = 800};
|
||||
var serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Area;
|
||||
for (double i = -2*Math.PI; i < 2*Math.PI; i += 0.05)
|
||||
{
|
||||
serie.AddXY(i, Math.Sin(i));
|
||||
}
|
||||
// Set the color
|
||||
serie.Color = new Color(0, 100, 0);
|
||||
diagram.SetLabelsX(UnitType.UT_Angle, DisplayUnitType.DUT_RADIANS, this.docRevit, 2);
|
||||
diagram.SetLabelsY(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL, this.docRevit, 2);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Area Graph Representation
|
||||
|
||||
# region Bar Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Bar Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Sin(x)", "Bar Diagram Series") { Height = 400, Width = 800 };
|
||||
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Bar;
|
||||
for (double i = -2*Math.PI; i < 2*Math.PI; i += 0.05)
|
||||
{
|
||||
serie.AddXY(i, Math.Sin(i));
|
||||
}
|
||||
serie.Color = new Color(255, 0, 100);
|
||||
diagram.SetLabelsX(UnitType.UT_Angle, DisplayUnitType.DUT_RADIANS, this.docRevit, 2);
|
||||
diagram.SetLabelsY(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL, this.docRevit, 2);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Bar Graph Representation
|
||||
|
||||
# region Column Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Column Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Sin(x)", "Column Diagram Series"){ Height = 400, Width = 800};
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Column;
|
||||
for (double i = -2*Math.PI; i < 2*Math.PI; i += 0.05)
|
||||
{
|
||||
serie.AddXY(i, Math.Sin(i));
|
||||
}
|
||||
serie.Color = new Color(255, 0, 100);
|
||||
diagram.SetLabelsX(UnitType.UT_Angle, DisplayUnitType.DUT_RADIANS, this.docRevit, 2);
|
||||
diagram.SetLabelsY(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL, this.docRevit, 2);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Column Graph Representation
|
||||
|
||||
# region Line Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(this.oneLineBreak);
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Line Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Sin(x)", "Line Diagram Series"){ Height = 400, Width = 800};
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Line;
|
||||
for (double i = -2*Math.PI; i < 2*Math.PI; i += 0.05)
|
||||
{
|
||||
serie.AddXY(i, Math.Sin(i));
|
||||
}
|
||||
serie.Color = new Color(255, 0, 100);
|
||||
diagram.SetLabelsX(UnitType.UT_Angle, DisplayUnitType.DUT_RADIANS, this.docRevit, 2);
|
||||
diagram.SetLabelsY(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL, this.docRevit, 2);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Line Graph Representation
|
||||
|
||||
# region Point Graph Representation
|
||||
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Point Graph Representation", 2));
|
||||
diagram = new DocumentDiagram("Sin(x)", "Point Diagram Series") { Height = 400, Width = 800 };
|
||||
|
||||
serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Point;
|
||||
for (double i = -2*Math.PI; i < 2*Math.PI; i += 0.05)
|
||||
{
|
||||
serie.AddXY(i, Math.Sin(i));
|
||||
}
|
||||
serie.Color = new Color(255, 0, 100);
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_RADIANS, this.docRevit, 2);
|
||||
diagram.SetLabelsY(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL, this.docRevit, 2);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
|
||||
# endregion Point Graph Representation
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to create three series with different represenatation inside the same diagram
|
||||
/// </summary>
|
||||
private void AddSupportedBeamDiagrams()
|
||||
{
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Two Lines and a column reprensentations on the same diagram", 1));
|
||||
|
||||
int scalingFactor = 20;
|
||||
var diagram = new DocumentDiagram("Supported beam", "Load Intensity") {Height = 800, Width = 800 };
|
||||
diagram.Legend = true;
|
||||
// first serie
|
||||
var serie = diagram.Series[0];
|
||||
serie.DiagramType = DiagramType.Column;
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity * scalingFactor);
|
||||
}
|
||||
serie.Color = new Color(100, 0, 100);
|
||||
// second serie with name
|
||||
serie = new DocumentDiagramSeries("Shear") { Color = new Color(255, 0, 100), DiagramType = DiagramType.Line };
|
||||
scalingFactor = 5;
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity * (lengthBeam / 2 - i) * scalingFactor);
|
||||
}
|
||||
diagram.Series.Add(serie);
|
||||
// third serie with name
|
||||
serie = new DocumentDiagramSeries("Momemt"){Color = new Color(255, 0, 255),DiagramType = DiagramType.Line };
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
serie.AddXY(i, loadIntensity*i/2*(lengthBeam - i));
|
||||
}
|
||||
diagram.Series.Add(serie);
|
||||
// Add the diagram with 3 series and different representation inside the report
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This method demonstrates how to create few series and superposed them on the same diagram
|
||||
/// </summary>
|
||||
private void AddCantileverDiagrams()
|
||||
{
|
||||
this.docReport.Main.Elements.Add(new DocumentTitle("Many series ", 1));
|
||||
var diagram = new DocumentDiagram("Cantilever Beam - Concentrated at any point"){ Height = 800,Width = 800};
|
||||
|
||||
// creation of 10 series
|
||||
// Formula use M(x) = P(x-a) with a the position of the load
|
||||
// Values use are similar as in the table creation example
|
||||
for (int j = 0; j <= 10; j++)
|
||||
{
|
||||
var series = new DocumentDiagramSeries("load position:" + j + " x L/10"){DiagramType = DiagramType.Area};
|
||||
for (int i = 0; i <= lengthBeam; i++)
|
||||
{
|
||||
series.AddXY(i, Math.Max(0, loadIntensity*(i - j*lengthBeam/10)));
|
||||
}
|
||||
series.Color = new Color(Convert.ToByte(j*25), Convert.ToByte(j*5), Convert.ToByte(j*10));
|
||||
diagram.Series.Add(series);
|
||||
}
|
||||
diagram.SetLabelsX(UnitType.UT_Length, DisplayUnitType.DUT_DECIMAL_FEET, this.docRevit, 5);
|
||||
diagram.SetLabelsY(UnitType.UT_Moment, DisplayUnitType.DUT_KIP_FEET, this.docRevit, 100);
|
||||
diagram.Legend = true;
|
||||
this.docReport.Main.Elements.Add(diagram);
|
||||
}
|
||||
/// <summary>
|
||||
/// This method demonstrates how to use the map object and add in inside the report
|
||||
/// </summary>
|
||||
private void AddMap()
|
||||
{
|
||||
// Definition of the units
|
||||
var documentMap = new DocumentMap(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL);
|
||||
|
||||
double originX = 0;
|
||||
double originY = 0;
|
||||
double lengthX = Math.PI*2;
|
||||
double lengthY = Math.PI*2;
|
||||
|
||||
//Definition of the external contour
|
||||
documentMap.AddPoint(originX, originY, 0, true);
|
||||
documentMap.AddPoint(originX + lengthX, originY, 0, true);
|
||||
documentMap.AddPoint(originX + lengthX, originY + lengthY, 0, true);
|
||||
documentMap.AddPoint(originX, originY + lengthY, 0, true);
|
||||
// Values generation using Sinus(x)
|
||||
double incrementX = (lengthX) / 50;
|
||||
double incrementY = (lengthY);
|
||||
for (double x = 0; x <= 50; x++)
|
||||
{
|
||||
for (double y = 0; y <= 1; y++)
|
||||
{
|
||||
double positionX = originX + x * incrementX;
|
||||
double positionY = originY + y * incrementY;
|
||||
documentMap.AddPoint(positionX, positionY, Math.Sin(positionX));
|
||||
}
|
||||
}
|
||||
//Set the title
|
||||
documentMap.Title = "Sin(x) ";
|
||||
documentMap.Legend = true;
|
||||
// define the dimensions in pixels ?
|
||||
documentMap.Width = 500;
|
||||
// Set the number of color to used
|
||||
documentMap.SetColors(15);
|
||||
this.docReport.Main.Elements.Add(documentMap);
|
||||
}
|
||||
|
||||
private void AddMapWithHole()
|
||||
{
|
||||
var documentMap = new DocumentMap(UnitType.UT_Number, DisplayUnitType.DUT_GENERAL);
|
||||
double originX = 0;
|
||||
double originY = 0;
|
||||
double lengthX = Math.PI;
|
||||
double lengthY = Math.PI;
|
||||
//External contour
|
||||
documentMap.AddPoint(originX, originY, 0, true);
|
||||
documentMap.AddPoint(originX + lengthX, originY, 0, true);
|
||||
documentMap.AddPoint(originX + lengthX, originY + lengthY, 0, true);
|
||||
documentMap.AddPoint(originX, originY + lengthY, 0, true);
|
||||
//holes
|
||||
var hole = new List<int>
|
||||
{
|
||||
documentMap.AddPoint(originX + lengthX/4, originY + lengthY/4, Math.Sin(originX + lengthX/4)),
|
||||
documentMap.AddPoint(originX + 3*lengthX/4, originY + lengthY/4, Math.Sin(originX + 3*lengthX/4)),
|
||||
documentMap.AddPoint(originX + 3*lengthX/4, originY + 3*lengthY/4, Math.Sin(originX + 3*lengthX/4)),
|
||||
documentMap.AddPoint(originX + lengthX/4, originY + 3*lengthY/4, Math.Sin(originX + lengthX/4))
|
||||
};
|
||||
documentMap.AddHole(hole);
|
||||
// value
|
||||
double incrementX = (lengthX)/50;
|
||||
double incrementY = (lengthY)/50;
|
||||
for (double x = 0; x <= 50; x++)
|
||||
{
|
||||
for (double y = 0; y <= 50; y++)
|
||||
{
|
||||
double positionX = originX + x*incrementX;
|
||||
double positionY = originY + y*incrementY;
|
||||
documentMap.AddPoint(positionX, positionY, Math.Sin(positionX));
|
||||
}
|
||||
}
|
||||
//Title
|
||||
documentMap.Title = "Sin(x) ";
|
||||
documentMap.Legend = true;
|
||||
documentMap.Width = 500;
|
||||
documentMap.SetColors(10);
|
||||
this.docReport.Main.Elements.Add(documentMap);
|
||||
}
|
||||
/// <summary>
|
||||
/// This method demonstrates how to add a status, verified or not, inside the report.
|
||||
/// </summary>
|
||||
private void AddStatus()
|
||||
{
|
||||
var documentStatus = new DocumentStatus("M{sd} = 24", "< M{rd} = 25", "Verified", true, "[6.6.6]");
|
||||
this.docReport.Main.Elements.Add(documentStatus);
|
||||
documentStatus = new DocumentStatus("M{sd} = 24", "> M{rd} = 25", "Not Verified", false, "[6.6.6]");
|
||||
this.docReport.Main.Elements.Add(documentStatus);
|
||||
documentStatus = new DocumentStatus("M{sd} = 24", "= M{rd} = 24", "Verified", true, "[6.6.6]");
|
||||
this.docReport.Main.Elements.Add(documentStatus);
|
||||
}
|
||||
|
||||
private void AddTextInline()
|
||||
{
|
||||
this.docReport.Main.Elements.Add(new DocumentValue(2, DisplayUnitType.DUT_CENTIMETERS, UnitType.UT_Length, this.docRevit.GetUnits(), true));
|
||||
this.docReport.Main.Elements.Add(new DocumentValueWithName("First field", 2, DisplayUnitType.DUT_CENTIMETERS, UnitType.UT_Length, this.docRevit.GetUnits(), true));
|
||||
this.docReport.Main.Elements.Add(new DocumentValueWithDescription("Second field", "Description", "Note", 2, DisplayUnitType.DUT_CENTIMETERS, UnitType.UT_Length, this.docRevit.GetUnits(), true));
|
||||
}
|
||||
|
||||
public void AddSection(string textTitle, short sizeTitle)
|
||||
{
|
||||
var documentSection = new DocumentSection(textTitle, sizeTitle);
|
||||
this.docReport.Main.Elements.Add(documentSection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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;
|
||||
using System.Linq;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes;
|
||||
using Document = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Document;
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This class is an helper class to provide an overview of the documentation features using schemas
|
||||
/// </summary>
|
||||
internal class ReportSchemas : IServerUI
|
||||
{
|
||||
|
||||
private readonly Autodesk.Revit.DB.Document docRevit;
|
||||
private readonly Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Document docReport;
|
||||
|
||||
/// <summary>
|
||||
/// /// <summary>
|
||||
/// Creates a ReportSchemas class instance.
|
||||
/// </summary>
|
||||
/// <param name="activeDocRevit"></param>
|
||||
/// <param name="activeDocReport"></param>
|
||||
public ReportSchemas(Autodesk.Revit.DB.Document activeDocRevit, Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Document activeDocReport)
|
||||
{
|
||||
this.docRevit = activeDocRevit;
|
||||
this.docReport = activeDocReport;
|
||||
}
|
||||
|
||||
#region IServerUI Members
|
||||
|
||||
public IList GetDataSource(string key, Autodesk.Revit.DB.Document document, DisplayUnitType unitType)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void LayoutInitialized(object sender, LayoutInitializedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public void ValueChanged(object sender, ValueChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public string GetResource(string key, string contex)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
public Uri GetResourceImage(string key, string contex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void CreateReportSchema()
|
||||
{
|
||||
var server = new ServerUI();
|
||||
// new schema base on default constructor
|
||||
var schema = new Schema();
|
||||
// Add schema to the main report
|
||||
DocumentBody.FillBody(schema, this.docReport.Main, server, this.docRevit);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method which returns a list of all elements of a specific type from the active document
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="document"></param>
|
||||
/// <returns></returns>
|
||||
private IList GetAllElementsOfType(Type type, Autodesk.Revit.DB.Document document)
|
||||
{
|
||||
return new FilteredElementCollector(document).OfClass(type).ToElements().ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// Method which returns a list of all elements of a specific category from the active document
|
||||
/// </summary>
|
||||
/// <param name="category"></param>
|
||||
/// <param name="document"></param>
|
||||
/// <returns></returns>
|
||||
private IList GetAllElementsOfCategory(BuiltInCategory category, Autodesk.Revit.DB.Document document)
|
||||
{
|
||||
return new FilteredElementCollector(document).OfCategory(category).ToElementIds().ToList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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 Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes;
|
||||
|
||||
|
||||
using Document = Autodesk.Revit.DB.Document;
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
[Schema("Schema", "b22a7a96-928b-4ffd-819e-503e275101bd")]
|
||||
public class Schema : SchemaClass
|
||||
{
|
||||
|
||||
public Schema()
|
||||
{
|
||||
stringValue = "A string value ";
|
||||
stringWithNameValue = "A string value with name";
|
||||
stringWithDescriptionValue = "A string value with description";
|
||||
stringValue = "A string value ";
|
||||
doubleValue = Math.PI;
|
||||
ratioValue = 0.9;
|
||||
ratioWithNameValue = Math.Sqrt(2) ;
|
||||
stringListValue = new List<string> { "A first string", "A second string" };
|
||||
doubleListValue = new List<double> { 5.0, 10.0, 11.0, 12.0 };
|
||||
doubleDoubledictionaryValue = new Dictionary<double, double> { { 1.0, 1.0 }, { 2.0, 2.0 }, { 3.0, 3.0 }, { 4.0, 4.0 } };
|
||||
subLabelListValue = new List<SubSchema>{new SubSchema(), new SubSchema(), new SubSchema(), new SubSchema()};
|
||||
subSchemaListValue = new List<SubSchema> {new SubSchema(), new SubSchema(), new SubSchema(), new SubSchema(), new SubSchema()};
|
||||
doubleSubSchemaDictionaryValue = new Dictionary<double, SubSchema> { { 1.0, new SubSchema() }, { 2.0, new SubSchema() }, { 3.0, new SubSchema() }, { 4.0, new SubSchema() } };
|
||||
}
|
||||
|
||||
public Schema(Autodesk.Revit.DB.Document document)
|
||||
{
|
||||
}
|
||||
|
||||
public Schema(Entity entity, Autodesk.Revit.DB.Document document)
|
||||
: base(entity, document)
|
||||
{
|
||||
}
|
||||
|
||||
# region base type
|
||||
/// <summary>
|
||||
/// A double value
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Value(
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 1)]
|
||||
public Double doubleValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A string value
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty()]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Value(
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 2
|
||||
)]
|
||||
public String stringValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A string value with name set
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(
|
||||
LocalizableValue = true,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = true,
|
||||
Name = "Name",
|
||||
Index = 3
|
||||
)]
|
||||
public String stringWithNameValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A string value with name, description and note set.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithDescription(
|
||||
LocalizableValue = true,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = true,
|
||||
Name = "Name",
|
||||
Description = "Description",
|
||||
Note = "Note",
|
||||
Index = 4
|
||||
)]
|
||||
public String stringWithDescriptionValue { get; set; }
|
||||
# endregion base type
|
||||
|
||||
# region ratio
|
||||
|
||||
/// <summary>
|
||||
/// A ratio
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Ratio(
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 5
|
||||
)]
|
||||
public Double ratioValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A ratio with name
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Ratio(
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 6,
|
||||
Name = "Ratio"
|
||||
)]
|
||||
public Double ratioWithNameValue { get; set; }
|
||||
# endregion ratio
|
||||
|
||||
# region list
|
||||
|
||||
/// <summary>
|
||||
/// A list of string
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Table(
|
||||
Level = DetailLevel.General,
|
||||
Index = 7,
|
||||
Localizable = false,
|
||||
Name = "Title of a table containing string values"
|
||||
)]
|
||||
public List<String> stringListValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of double
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Table(
|
||||
Name = "Title of a table containing double values",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 8
|
||||
)]
|
||||
public List<Double> doubleListValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of subSchemas
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Table(
|
||||
Name = "Title of a table containing subschemas",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 9
|
||||
)]
|
||||
public List<SubSchema> subSchemaListValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of subSchemas
|
||||
/// The size of columns is set to 10%,10% and 20 %
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.SubSchemaListTable(
|
||||
"ListTable", 10, 10, 20,
|
||||
AddHeader = true,
|
||||
Level = DetailLevel.Detail,
|
||||
Name = "Title of a table containing subschemas",
|
||||
Localizable = true,
|
||||
Index =10
|
||||
)]
|
||||
public List<SubSchema> subLabelListValue { get; set; }
|
||||
# endregion list
|
||||
|
||||
# region dictionary
|
||||
/// <summary>
|
||||
/// A dictionary of double
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Table(
|
||||
Name = "Title of a table containing dictionary of double",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 12
|
||||
)]
|
||||
public Dictionary<Double, Double> doubleDoubledictionaryValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A dictionnary of SubSchema (see SubSchema.cs)
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(
|
||||
Unit = UnitType.UT_Length,
|
||||
DisplayUnit = DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.Table(
|
||||
Name = "Title of a table containing dictionary of subSchema",
|
||||
LocalizableValue = false,
|
||||
Level = DetailLevel.General,
|
||||
Localizable = false,
|
||||
Index = 13
|
||||
)]
|
||||
public Dictionary<Double, SubSchema> doubleSubSchemaDictionaryValue { get; set; }
|
||||
# endregion dictionary
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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 Autodesk.Revit.DB.ExtensibleStorage.Framework;
|
||||
using ExtensibleStorageDocumentation.Properties;
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
internal class ServerDocument : IResource
|
||||
{
|
||||
#region IResource Members
|
||||
|
||||
public string GetResource(string key, string contex)
|
||||
{
|
||||
string txt = Resources.ResourceManager.GetString(key);
|
||||
if (!string.IsNullOrEmpty(txt))
|
||||
return txt;
|
||||
return key;
|
||||
}
|
||||
|
||||
public Uri GetResourceImage(string key, string contex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
|
||||
using ExtensibleStorageDocumentation.Properties;
|
||||
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
internal class ServerUI : IServerUI
|
||||
{
|
||||
#region IServerUI Members
|
||||
|
||||
public IList GetDataSource(string key, Document document, DisplayUnitType unitType)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public string GetResource(string key, string contex)
|
||||
{
|
||||
string txt = Resources.ResourceManager.GetString(key);
|
||||
if (!string.IsNullOrEmpty(txt))
|
||||
return txt;
|
||||
return key;
|
||||
}
|
||||
|
||||
public Uri GetResourceImage(string key, string contex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void LayoutInitialized(object sender, LayoutInitializedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public void ValueChanged(object sender, ValueChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 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 Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes ;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation ;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes;
|
||||
namespace ExtensibleStorageDocumentation
|
||||
{
|
||||
/// <summary>
|
||||
/// A simple SubSchema Class that contains 3 double values.
|
||||
/// </summary>
|
||||
[Schema("SimpleSchema", "eaec17a1-e7dd-4e46-9eac-2646d95d334c")]
|
||||
public class SubSchema : SchemaClass
|
||||
{
|
||||
public SubSchema()
|
||||
{
|
||||
subSchemaFirstValue = 1;
|
||||
subSchemaSecondValue = 2;
|
||||
subSchemaThirdValue = 3;
|
||||
}
|
||||
|
||||
public SubSchema(Autodesk.Revit.DB.Document document)
|
||||
{
|
||||
subSchemaFirstValue = 1;
|
||||
subSchemaSecondValue = 2;
|
||||
subSchemaThirdValue = 3;
|
||||
}
|
||||
|
||||
public SubSchema(Entity entity, Autodesk.Revit.DB.Document document)
|
||||
: base(entity, document)
|
||||
{
|
||||
subSchemaFirstValue = 1;
|
||||
subSchemaSecondValue = 2;
|
||||
subSchemaThirdValue = 3;
|
||||
}
|
||||
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.DefaultElement]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(UnitType.UT_Length, DisplayUnitType.DUT_METERS)]
|
||||
public double subSchemaFirstValue { get; set; }
|
||||
|
||||
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.DefaultElement]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(UnitType.UT_Length, DisplayUnitType.DUT_METERS)]
|
||||
public double subSchemaSecondValue { get; set; }
|
||||
|
||||
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.DefaultElement]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(UnitType.UT_Length, DisplayUnitType.DUT_METERS)]
|
||||
public double subSchemaThirdValue { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user