added Revit 2022 SDK minus except *rvt and *rfa

This commit is contained in:
Jeremy Tammik
2021-04-20 11:36:21 +02:00
parent 1133a82dc5
commit 7e327986e8
3034 changed files with 1245318 additions and 0 deletions
@@ -0,0 +1,327 @@
//
// (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.Collections.Generic;
using System.Linq;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
using Autodesk.Revit.UI;
using ExtensibleStorageUI.Properties;
using Category = Autodesk.Revit.UI.ExtensibleStorage.Framework.Category;
namespace ExtensibleStorageUI
{
/// <summary>
/// For a selected element, this command will store data defined by user or read data if this data exist on element.
/// This command will expose a serie of tabs. Data exposed for each tab are defined via associated schema
/// 2 objectives here:
/// 1) Review all controls exposed by the Extensible Storage Framework
/// 2) Learn how to save data inside element and later retreive them
/// </summary>
[Transaction(TransactionMode.Manual)]
[Journaling(JournalingMode.NoCommandData)]
public class Command : IExternalCommand, IServerUI
{
// A set of private members that will be used as data source
private readonly List<double> doubleList = new List<double> {10.0, 20.0, 30.0, 40.0};
private readonly List<Int16> int16List = new List<Int16> { 1, 2, 3, 4 };
private readonly List<Int32> int32List = new List<Int32> { 1, 2, 3, 4 };
private readonly List<string> stringList = new List<string> {"Choice 1", "Choice 2", "Choice 3", "Choice 4"};
private readonly List<XYZ> xyzList = new List<XYZ> {new XYZ(1.0,1.0,1.0), new XYZ(2.0, 2.0, 2.0), new XYZ(3.0, 3.0, 3.0)};
private readonly List<UV> uvList = new List<UV> { new UV(1.0, 1.0), new UV(2.0, 2.0), new UV(3.0, 3.0) };
private readonly List<bool> boolList = new List<bool> { true, false };
private readonly List<Guid> guidList = new List<Guid> { new Guid("6AED35BD-9143-4AAB-B568-7FC69C946824"), new Guid("F6F9D635-6AF3-4336-9D52-E734DFA9F97E"), new Guid("E72993A5-CDFE-4501-9A34-D3A6DA407CD6") };
private List<RebarBarType> rebarList = null;
// A set boolean
private bool isTabTextBoxSchemaExistsOnElement = false;
private bool isTabGridSchemaExistsOnElement = false;
private bool isTabKeySchemaExistsOnElement = false;
private bool isTabNumericUpDownSchemaExistsOnElement = false;
private bool isTabComboBoxSchemaExistsOnElement = false;
private bool isTabListTextBoxSchemaExistsOnElement = false;
private bool isTabEnumSchemaExistsOnElement = false;
private bool isTabListSchemaExistsOnElement = false;
private bool isTabCategorySchemaExistsOnElement = false;
private bool isTabMiscellaniousSchemaExistsOnElement = false;
#region IExternalCommand Members
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
// One element should be selected and will be the active element
Document document = commandData.Application.ActiveUIDocument.Document;
if (commandData.Application.ActiveUIDocument.Selection.Elements.Size != 1)
{
TaskDialog.Show("Error", "One element should be selected");
return Result.Cancelled;
}
// Check if five rebars are inside the project
ElementId elementId = (new FilteredElementCollector(document).OfClass(typeof(RebarBarType)).ToElementIds() as List<ElementId>)[4] as ElementId ;
if (elementId == null)
{
TaskDialog.Show("Error", "At least five rebars should on this project");
return Result.Cancelled;
}
Element activeElement = null;
foreach (Element element in commandData.Application.ActiveUIDocument.Selection.Elements)
activeElement = element;
//Create all schema instances associated to tabs instances with default constructor
var instanceTabTextBox = new TabTextBoxSchema();
var instanceTabGrid = new TabGridSchema();
var instanceTabKey = new TabKeySchema();
var instanceTabNumericUpDown = new TabNumericUpDownSchema();
var instanceTabComboBox = new TabComboBoxSchema();
var instanceTabListTextBox = new TabListTextBoxSchema(document);
var instanceTabEnum = new TabEnumSchema();
var instanceTabList = new TabListSchema();
var instanceTabCategory = new TabCategorySchema();
var instanceTabMiscellanious = new TabMiscellaniousSchema();
// Data preparation
// initialization of element from the Revit project
instanceTabComboBox.ComboBoxElementId = elementId;
instanceTabTextBox.TextBoxElementId = activeElement.Id;
rebarList = new FilteredElementCollector(document).OfClass(typeof(RebarBarType)).ToElements().Cast<RebarBarType>().ToList();
// Check if we are in reading mode by quering active element
isTabTextBoxSchemaExistsOnElement = instanceTabTextBox.Exists(activeElement);
isTabGridSchemaExistsOnElement = instanceTabGrid.Exists(activeElement);
isTabKeySchemaExistsOnElement = instanceTabKey.Exists(activeElement);
isTabNumericUpDownSchemaExistsOnElement = instanceTabNumericUpDown.Exists(activeElement);
isTabComboBoxSchemaExistsOnElement = instanceTabComboBox.Exists(activeElement);
isTabListTextBoxSchemaExistsOnElement = instanceTabListTextBox.Exists(activeElement);
isTabEnumSchemaExistsOnElement = instanceTabEnum.Exists(activeElement);
isTabListSchemaExistsOnElement = instanceTabList.Exists(activeElement);
isTabCategorySchemaExistsOnElement = instanceTabCategory.Exists(activeElement);
isTabMiscellaniousSchemaExistsOnElement = instanceTabMiscellanious.Exists(activeElement);
//Load data
instanceTabTextBox.Load(activeElement);
instanceTabGrid.Load(activeElement);
instanceTabKey.Load(activeElement);
instanceTabNumericUpDown.Load(activeElement);
instanceTabComboBox.Load(activeElement);
instanceTabListTextBox.Load(activeElement);
instanceTabEnum.Load(activeElement);
instanceTabList.Load(activeElement);
instanceTabCategory.Load(activeElement);
instanceTabMiscellanious.Load(activeElement);
//Create all layouts on schema
Layout layoutTabTextBox = Layout.Build(typeof (TabTextBoxSchema), this);
Layout layoutTabGrid = Layout.Build(typeof (TabGridSchema), this);
Layout layoutTabKey = Layout.Build(typeof(TabKeySchema), this);
Layout layoutTabNumericUpDown = Layout.Build(typeof (TabNumericUpDownSchema), this);
Layout layoutTabComboBox = Layout.Build(typeof (TabComboBoxSchema), this);
Layout layoutTabListTextBox = Layout.Build(typeof (TabListTextBoxSchema), this);
Layout layoutTabEnum = Layout.Build(typeof (TabEnumSchema), this);
Layout layoutTabList = Layout.Build(typeof (TabListSchema), this);
Layout layoutTabCategory = Layout.Build(typeof (TabCategorySchema), this);
Layout layoutTabMiscellanious = Layout.Build(typeof (TabMiscellaniousSchema), this);
// add an image in line on the last tab
var image = new Image
{
Source = new Uri(@"pack://application:,,,/ExtensibleStorageUI;component/Images/bigImage1.png"),
Index = 1,
Key = "image1"
};
layoutTabMiscellanious.Controls.Insert(0, image);
// add a free text inline
var textBlock = new TextBlock
{
Text = "This a test of the textblock usage",
Index = 2,
Key = "text"
};
layoutTabMiscellanious.Controls.Insert(1, textBlock);
// build all layout objects
ILayoutControl layoutCtrTabTextBox = Layout.BuildControl(this, document, layoutTabTextBox, instanceTabTextBox.GetEntity());
ILayoutControl layoutCtrTabGrid = Layout.BuildControl(this, document, layoutTabGrid, instanceTabGrid.GetEntity());
ILayoutControl layoutCtrTabKey = Layout.BuildControl(this, document, layoutTabKey, instanceTabKey.GetEntity());
ILayoutControl layoutCtrTabNumericUpDown = Layout.BuildControl(this, document, layoutTabNumericUpDown, instanceTabNumericUpDown.GetEntity());
ILayoutControl layoutCtrTabComboBox = Layout.BuildControl(this, document, layoutTabComboBox, instanceTabComboBox.GetEntity());
ILayoutControl layoutCtrTabListTextBox = Layout.BuildControl(this, document, layoutTabListTextBox, instanceTabListTextBox.GetEntity());
ILayoutControl layoutCtrTabEnum = Layout.BuildControl(this, document, layoutTabEnum, instanceTabEnum.GetEntity());
ILayoutControl layoutCtrTabList = Layout.BuildControl(this, document, layoutTabList, instanceTabList.GetEntity());
ILayoutControl layoutCtrTabCategory = Layout.BuildControl(this, document, layoutTabCategory, instanceTabCategory.GetEntity());
ILayoutControl layoutCtrTabMiscellanious = Layout.BuildControl(this, document, layoutTabMiscellanious, instanceTabMiscellanious);
//create main window and add all object
var window = new MainWindows
{
Name = "ExtensibleStorageUIOverview",
Title = "Extensible Storage UI Overview"
};
var layout = new MainLayout
{
tabTextBox = {Content = layoutCtrTabTextBox},
tabGrid = {Content = layoutCtrTabGrid},
tabKey = { Content = layoutCtrTabKey },
tabNumericUpDown = {Content = layoutCtrTabNumericUpDown},
tabComboBox = {Content = layoutCtrTabComboBox},
tabListTextBox = {Content = layoutCtrTabListTextBox},
tabEnum = {Content = layoutCtrTabEnum},
tabList = {Content = layoutCtrTabList},
tabCategory = {Content = layoutCtrTabCategory},
tabMiscellanious = {Content = layoutCtrTabMiscellanious}
};
window.layout.Children.Add(layout);
window.ShowAndAssignParent();
//Getting data from UI
instanceTabTextBox = new TabTextBoxSchema(layoutCtrTabTextBox.GetEntity(), document);
instanceTabGrid = new TabGridSchema(layoutCtrTabGrid.GetEntity(), document);
instanceTabKey = new TabKeySchema(layoutCtrTabKey.GetEntity(), document);
instanceTabNumericUpDown = new TabNumericUpDownSchema(layoutCtrTabNumericUpDown.GetEntity(), document);
instanceTabComboBox = new TabComboBoxSchema(layoutCtrTabComboBox.GetEntity(), document);
instanceTabListTextBox = new TabListTextBoxSchema(layoutCtrTabListTextBox.GetEntity(), document);
instanceTabEnum = new TabEnumSchema(layoutCtrTabEnum.GetEntity(), document);
instanceTabList = new TabListSchema(layoutCtrTabList.GetEntity(), document);
instanceTabCategory = new TabCategorySchema(layoutCtrTabCategory.GetEntity(), document);
instanceTabMiscellanious = new TabMiscellaniousSchema(instanceTabMiscellanious.GetEntity(), document);
//Saving Data into selected element
if (window.storeSchema)
{
var t = new Transaction(document, "Save schemas");
t.Start();
instanceTabTextBox.Save(activeElement);
instanceTabGrid.Save(activeElement);
instanceTabKey.Save(activeElement);
instanceTabNumericUpDown.Save(activeElement);
instanceTabComboBox.Save(activeElement);
instanceTabListTextBox.Save(activeElement);
instanceTabEnum.Save(activeElement);
instanceTabList.Save(activeElement);
instanceTabCategory.Save(activeElement);
instanceTabMiscellanious.Save(activeElement);
t.Commit();
}
return Result.Succeeded;
}
#endregion
#region IServerUI Members
public IList GetDataSource(string key, Document document, DisplayUnitType unitType)
{
// switch to return proper data structure to controls
switch (key)
{
case "DataSourceDoubleList":
return UnitUtilsExt.Convert(this.doubleList, Autodesk.Revit.DB.DisplayUnitType.DUT_METERS, unitType);
case "DataSourceStringList":
return this.stringList;
case "DataSourceInt16List":
return this.int16List;
case "DataSourceInt32List":
return this.int32List;
case "DataSourceBoolList":
return this.boolList;
case "DataSourceUVList":
return this.uvList;
case "DataSourceGuidList":
return this.guidList;
case "DataSourceRebarList":
return new FilteredElementCollector(document).OfClass(typeof(RebarBarType)).ToElements().Cast<RebarBarType>().ToList();
case "DataSourceElementIdList":
return (new FilteredElementCollector(document).OfClass(typeof(RebarBarType)).ToElementIds() as List <ElementId>).GetRange(0,5);
case "DataSourceXYZList":
return this.xyzList;
default:
return null;
}
}
public string GetResource(string key, string context)
{
string txt = Resources.ResourceManager.GetString(key);
if (!string.IsNullOrEmpty(txt))
{
return txt;
}
return key;
}
public Uri GetResourceImage(string key, string context)
{
// Enum images
if (key == EnumLocalized.Choice1.ToString() || key == EnumNotLocalized.Item1.ToString() )
return new Uri(@"pack://application:,,,/ExtensibleStorageUI;component/Images/smallImage1.png");
else if (key == EnumLocalized.Choice2.ToString() || key == EnumNotLocalized.Item2.ToString())
return new Uri(@"pack://application:,,,/ExtensibleStorageUI;component/Images/smallImage2.png");
else if (key == EnumLocalized.Choice3.ToString() || key == EnumNotLocalized.Item3.ToString())
return new Uri(@"pack://application:,,,/ExtensibleStorageUI;component/Images/smallImage3.png");
return null;
}
void IServerUI.LayoutInitialized(object sender, LayoutInitializedEventArgs e)
{
var entity = e.Entity as Entity;
if (entity == null) return;
else if (entity.Schema.SchemaName == "tabComboBoxSchema" && !isTabComboBoxSchemaExistsOnElement)
{
e.Editor.SetValue("ComboBoxUV", uvList[1], DisplayUnitType.DUT_METERS);
e.Editor.SetValue("UnitComboBoxDoubleConstructor", 15, DisplayUnitType.DUT_METERS);
e.Editor.SetValue("ComboBoxXYZ", xyzList[2], DisplayUnitType.DUT_METERS);
e.Editor.SetValue("ComboBoxRebar", rebarList[2], DisplayUnitType.DUT_UNDEFINED);
}
else if (entity.Schema.SchemaName == "tabComboBoxSchema" && isTabComboBoxSchemaExistsOnElement)
{
var tab = new TabComboBoxSchema(entity, null);
e.Editor.SetValue("ComboBoxUV", tab.ComboBoxUV, DisplayUnitType.DUT_METERS);
e.Editor.SetValue("ComboBoxXYZ", tab.ComboBoxXYZ, DisplayUnitType.DUT_METERS);
e.Editor.SetValue("UnitComboBoxDoubleConstructor", tab.UnitComboBoxDoubleConstructor, DisplayUnitType.DUT_METERS);
}
}
void IServerUI.ValueChanged(object sender, ValueChangedEventArgs e)
{
//throw new NotImplementedException();
}
#endregion
}
}
@@ -0,0 +1,34 @@
//
// (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.
//
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
public enum EnumLocalized
{
Choice1,
Choice2,
Choice3
}
}
@@ -0,0 +1,31 @@
//
// (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.
//
namespace ExtensibleStorageUI
{
public enum EnumNotLocalized
{
Item1 ,
Item2 ,
Item3
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Name>ExtensibleStorageUI</Name>
<Assembly>AssemblyPath</Assembly>
<AddInId>7b653422-c7fa-46a6-986f-35c1b87632bc</AddInId>
<FullClassName>ExtensibleStorageUI.Command</FullClassName>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.Autodesk.com</VendorDescription>
<Text>Extensible Storage Framework - UI Overview</Text>
<VisibilityMode>AlwaysVisible</VisibilityMode>
<Discipline>Any</Discipline>
<LanguageType>Unknown</LanguageType>
</AddIn>
</RevitAddIns>
@@ -0,0 +1,144 @@
<?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>{2E856D39-A061-44C2-BACE-386F6504E890}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExtensibleStorageUI</RootNamespace>
<AssemblyName>ExtensibleStorageUI</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>
<CodeAnalysisRuleSet>BasicDesignGuidelineRules.ruleset</CodeAnalysisRuleSet>
<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="ExtensibleStorageFramework.UI.WPF">
<HintPath>..\..\..\..\..\References\ExtensibleStorageFramework\ExtensibleStorageFramework.UI.WPF.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="EnumLocalized.cs" />
<Compile Include="EnumNotLocalized.cs" />
<Compile Include="MainWindows.xaml.cs">
<DependentUpon>MainWindows.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Subschema.cs" />
<Compile Include="Command.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="MainLayout.xaml.cs">
<DependentUpon>MainLayout.xaml</DependentUpon>
</Compile>
<Compile Include="TabCategorySchema.cs" />
<Compile Include="TabComboBoxSchema.cs" />
<Compile Include="TabEnumSchema.cs" />
<Compile Include="TabGridSchema.cs" />
<Compile Include="TabKeySchema.cs" />
<Compile Include="TabListSchema.cs" />
<Compile Include="TabListTextBoxSchema.cs" />
<Compile Include="TabMiscellaniousSchema.cs" />
<Compile Include="TabNumericUpDownSchema.cs" />
<Compile Include="TabTextBoxSchema.cs" />
<Compile Include="ValueFormat.cs" />
<Compile Include="ValueProvider.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="MainLayout.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindows.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\smallImage1.png" />
<Resource Include="Images\bigImage1.png" />
<Resource Include="Images\smallImage2.png" />
<Resource Include="Images\smallImage3.png" />
</ItemGroup>
<ItemGroup>
<Content Include="ExtensibleStorageUI.addin" />
</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: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,21 @@
<UserControl x:Class="ExtensibleStorageUI.MainLayout"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DesignHeight="900" d:DesignWidth="450">
<Grid>
<TabControl Name="RevitAttributeTestApp" SelectedIndex="0">
<TabItem Name="tabTextBox" Header="TextBox"></TabItem>
<TabItem Header="ComboBox" Name="tabComboBox"></TabItem>
<TabItem Header="NumericUpDown" Name="tabNumericUpDown"></TabItem>
<TabItem Header="Enum" Name="tabEnum"></TabItem>
<TabItem Header="List" Name="tabList"></TabItem>
<TabItem Header="List TextBox" Name="tabListTextBox"></TabItem>
<TabItem Header="Category" Name="tabCategory"></TabItem>
<TabItem Name="tabGrid" Header="Grid"></TabItem>
<TabItem Name="tabKey" Header="Key"></TabItem>
<TabItem Name="tabMiscellanious" Header="Miscellanious"></TabItem>
</TabControl>
</Grid>
</UserControl>
@@ -0,0 +1,37 @@
//
// (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.Windows.Controls;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
public partial class MainLayout : UserControl
{
public MainLayout()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,25 @@
<Raf:WindowBase x:Class="ExtensibleStorageUI.MainWindows"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Raf="clr-namespace:Autodesk.Revit.UI.ExtensibleStorage.Framework.WPF;assembly=ExtensibleStorageFramework.UI.WPF"
Title="ExtensibleStorageUI" Height="900" Width="900">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="37"></RowDefinition>
</Grid.RowDefinitions>
<Menu Grid.Row="0" IsMainMenu="True"></Menu>
<DockPanel Grid.Row="1" Name="layout"></DockPanel>
<DockPanel Grid.Row="2" Name="Command">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width ="*"></ColumnDefinition>
<ColumnDefinition Width="175"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="1" Content="OK" Height="23" Name="btnOk" Width="75" HorizontalAlignment="left" Margin="5,5" Click="btnOk_Click" />
<Button Grid.Column="1" Content="Cancel" Height="23" Name="btnCancel" Width="75" HorizontalAlignment="Right" Margin="5,5" Click="btnCancel_Click" />
</Grid>
</DockPanel>
</Grid>
</Raf:WindowBase>
@@ -0,0 +1,59 @@
//
// (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.Windows;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.WPF;
namespace ExtensibleStorageUI
{
/// <summary>
/// Interaction logic for MainWindows.xaml
/// </summary>
public partial class MainWindows : WindowBase
{
// Windows with simple event management
// Close, don't save schemas
// Cancel, don't save schemas
// Ok, save schemas in selected elements
public bool storeSchema;
public MainWindows()
{
InitializeComponent();
this.storeSchema = false;
}
private void btnOk_Click(object sender, RoutedEventArgs e)
{
this.storeSchema = true;
this.Close();
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
this.storeSchema = false;
this.Close();
}
}
}
@@ -0,0 +1,40 @@
using System.Reflection;
using System.Resources;
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("ExtensibleStorageUI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Autodesk")]
[assembly: AssemblyProduct("ExtensibleStorageUI")]
[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")]
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,88 @@
//
// (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;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
namespace ExtensibleStorageUI
{
[Schema("SubSchemaEmbedded", "8f253922-1dfa-4d6b-84b8-bb695b2b1780")]
public class SubSchemaEmbedded : SchemaClass
{
public SubSchemaEmbedded()
{
ValueDouble = 100;
ValueString = "A string";
}
public SubSchemaEmbedded(Document document)
{
}
public SubSchemaEmbedded(Entity entity, Document document)
: base(entity, document)
{
}
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitTextBox()]
public Double ValueDouble { get; set; }
[SchemaProperty]
[TextBox()]
public String ValueString { get; set; }
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ComboBox(
DataSourceKey = "DataSourceDoubleList"
)]
public Double ValueDoubleList { get; set; }
[SchemaProperty]
[CheckBox()]
public Boolean CheckBoxUnchecked { get; set; }
[SchemaProperty]
[ComboBox(
"Item1",
"Item2",
"Item3",
Category = "",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true
)]
public String ComboBoxString { get; set; }
}
}
@@ -0,0 +1,156 @@
//
// (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;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
/// Simple subschema
/// </summary>
///
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("SubSchema", "8a89c457-ae12-45ce-b1d2-fa19be3dbf82")]
public class SubSchema : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
{
# region Constructors
/// <summary>
///
/// </summary>
public SubSchema()
{
UnitTextBoxDouble = 10;
CheckBoxChecked = true;
ComboBoxInt32 = 1;
UnitComboBoxDouble = 10;
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
//public SubSchema(Document document)
//{
// UnitTextBoxDouble = 10;
// CheckBoxChecked = true;
// ComboBoxInt32 = 1;
// UnitComboBoxDouble = 10;
//}
///// <summary>
/////
///// </summary>
///// <param name="entity"></param>
///// <param name="document"></param>
public SubSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
/// <summary>
/// ComboBox supporting int32 values.
/// This comboBox is filled using "DataSourceInt32List" data source.
/// "DataSourceInt32List" is based on int32List values {1,2,3,4}.
/// </summary>
[SchemaProperty]
[ComboBox(
DataSourceKey = "DataSourceInt32List",
Category = "ComboBox",
Description = "ComboBoxInt32",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxInt32ToolTips"
)]
public Int32 ComboBoxInt32 { get; set; }
/// <summary>
/// Unit TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to 10.0 DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitTextBox(
Category = "UnitTextBox",
AttributeUnit = DisplayUnitType.DUT_METERS,
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "UnitTextBoxDouble",
Tooltip = "UnitTextBoxDoubleToolTips"
)]
public Double UnitTextBoxDouble { get; set; }
/// <summary>
/// Unit ComboBox supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Selected index value is stored in DUT_METERS.
/// This comboBox is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitComboBox(
DataSourceKey = "DataSourceDoubleList",
Category = "UnitComboBox",
Description = "UnitComboBoxDouble",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Tooltip = "UnitComboBoxDoubleToolTips"
)]
public Double UnitComboBoxDouble { get; set; }
/// <summary>
/// CheckBox checked.
/// </summary>
[SchemaProperty]
[CheckBox(
Category = "CheckBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "CheckBoxChecked",
Tooltip = "CheckBoxCheckedToolTips"
)]
public Boolean CheckBoxChecked { get; set; }
}
}
@@ -0,0 +1,166 @@
//
// (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.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
[Schema("tabCategorySchema", "e7152376-4340-4b0c-969b-4cc89874d8fb")]
public class TabCategorySchema : SchemaClass
{
# region CheckBox
/// <summary>
/// CheckBox unchecked.
/// </summary>
[SchemaProperty]
[CheckBox(
Category = "CheckBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "CheckBoxUnchecked",
Tooltip = "CheckBoxUncheckedToolTips"
)]
public Boolean CheckBoxUnchecked { get; set; }
/// <summary>
/// CheckBox checked.
/// </summary>
[SchemaProperty]
[CheckBox(
Category = "CheckBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "CheckBoxChecked",
Tooltip = "CheckBoxCheckedToolTips"
)]
public Boolean CheckBoxChecked { get; set; }
# endregion CheckBox
# region Category CheckBox
/// <summary>
/// Category CheckBox drives the status of controls stacked to this category.
/// Enable it will enable all controls, disable it will disable all controls.
/// </summary>
[SchemaProperty]
[CategoryCheckBox(
Category = "CategoryCheckBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "CategoryCheckBox",
Tooltip = "CategoryCheckBoxToolTips"
)]
public Boolean CategoryCheckBox { get; set; }
/// <summary>
/// Unit ComboBox supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Selected index value is stored in DUT_METERS.
/// This comboBox is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS, FieldName = "")]
[UnitComboBox(
DataSourceKey = "DataSourceDoubleList",
Category = "CategoryCheckBox",
Description = "ComboBoxDouble",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Tooltip = "ComboBoxDoubleToolTips"
)]
public Double ComboBoxDouble { get; set; }
/// <summary>
/// Unit Checklist supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Selected index value is stored in DUT_METERS.
/// This Checklist is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitCheckedList(
DataSourceKey = "DataSourceDoubleList",
Category = "CategoryCheckBox",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "UnitCheckListDouble",
Tooltip = "UnitCheckListDoubleToolTips"
)]
public List<Double> UnitCheckListDouble { get; set; }
# endregion Category CheckBox
# region Constructors
/// <summary>
///
/// </summary>
public TabCategorySchema()
{
CategoryCheckBox = true;
CheckBoxChecked = true;
CheckBoxUnchecked = false;
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabCategorySchema(Document document)
{
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabCategorySchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
}
}
@@ -0,0 +1,424 @@
//
// (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;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
/// this class explains how to define a schema and associated UIField related to ComboBox.
/// ComboBox Items could be defined directly, based on data sources or on an enum.
/// </summary>
[Schema("tabComboBoxSchema", "8c1bdb2d-75bf-4d56-bfd5-fbafd30d18d0")]
public class TabComboBoxSchema : SchemaClass
{
# region Constructors
/// <summary>
/// Default constructor
/// </summary>
public TabComboBoxSchema()
{
this.ComboBoxString = "Choice 1";
this.ComboBoxBool = true;
this.ComboBoxInt16 = 1;
this.ComboBoxInt32 = 2;
this.ComboBoxGuid = new Guid("E72993A5-CDFE-4501-9A34-D3A6DA407CD6");
this.ComboBoxDouble = 10.0;
this.ComboBoxEnumImage = EnumLocalized.Choice1;
this.ComboBoxEnumImageText = EnumLocalized.Choice2;
this.ComboBoxEnumText = EnumLocalized.Choice3;
this.ComboBoxEnumTextNotLocalized = EnumNotLocalized.Item1;
this.ComboBoxEnumImageTextNotLocalized = EnumNotLocalized.Item3;
this.UnitComboBoxDouble = 20;
// Value will be set on layoutInitialized when
this.UnitComboBoxDoubleConstructor = 0;
this.ComboBoxRebar = null;
this.ComboBoxElementId = null;
this.ComboBoxUV = null; ;
this.ComboBoxXYZ = null;
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabComboBoxSchema(Document document)
{
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabComboBoxSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
# region UnitComboBox
/// <summary>
/// Unit ComboBox supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Selected index value is stored in DUT_METERS.
/// This comboBox is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS )]
[UnitComboBox(
DataSourceKey = "DataSourceDoubleList",
Category = "UnitComboBox",
Description = "UnitComboBoxDouble",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Tooltip = "UnitComboBoxDoubleToolTips"
)]
public Double UnitComboBoxDouble { get; set; }
/// <summary>
/// Unit ComboBox supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Selected index value is stored in DUT_METERS.
/// This comboBox is filled inline using {5,10,15,20)
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitComboBox(
5.0, 10.0, 15.0, 20.0,
Category = "UnitComboBox",
Description = "UnitComboBoxDoubleConstructor",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "UnitComboBoxDoubleConstructorToolTips"
)]
public Double UnitComboBoxDoubleConstructor { get; set; }
# endregion UnitComboBox
# region EnumComboBox
/// <summary>
/// EnumControl supporting strings values presented as ComboBox.
/// This comboBox is filled using AnEnumLocalized.
/// Strings associated to [Choice1,Choice2,Choice3] are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// </summary>
[SchemaProperty]
[EnumControl(
Description = "ComboBoxEnumText",
Presentation = PresentationMode.Combobox,
Item = PresentationItem.Text,
Category = "EnumComboBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Tooltip = "ComboBoxEnumTextToolTips"
)]
public EnumLocalized ComboBoxEnumText { get; set; }
/// <summary>
/// EnumControl supporting strings values presented as ComboBox.
/// This comboBox is filled using AnEnumNotLocalized.
/// Strings associated to [Item1,Item2,Item3] are not part of the resources file.
/// On the UI are visible strings "Item1","Item2","Item3".
/// Enum field is stored as integer with defined enumerator values.
/// </summary>
[SchemaProperty]
[EnumControl(
Description = "ComboBoxEnumTextNotLocalized",
Presentation = PresentationMode.Combobox,
Item = PresentationItem.Text,
Category = "EnumComboBox",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Tooltip = "ComboBoxEnumTextNotLocalizedToolTips"
)]
public EnumNotLocalized ComboBoxEnumTextNotLocalized { get; set; }
/// <summary>
/// EnumControl supporting strings values and images presented as ComboBox.
/// This comboBox is filled using AnEnumLocalized.
/// Strings associated to AnEnumLocalized.Choice1, AnEnumLocalized.Choice2, AnEnumLocalized.Choice3 are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Description = "ComboBoxEnumImageText",
Presentation = PresentationMode.Combobox,
Item = PresentationItem.ImageWithText,
Category = "EnumComboBox",
IsVisible = true,
IsEnabled = true,
Index = 4,
Localizable = true,
Tooltip = "ComboBoxEnumImageTextToolTips"
)]
public EnumLocalized ComboBoxEnumImageText { get; set; }
/// <summary>
/// EnumControl supporting images and text presented as OptionList(List).
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// Text are coming from the not transalted enum
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.Combobox,
Item = PresentationItem.ImageWithText,
Category = "EnumComboBox",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "ComboBoxEnumImageTextNotLocalized",
Tooltip = "ComboBoxEnumImageTextNotLocalizedTooltips"
)]
public EnumNotLocalized ComboBoxEnumImageTextNotLocalized { get; set; }
/// <summary>
/// EnumControl supporting images presented as ComboBox.
/// This comboBox is filled using AnEnumLocalized.
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Description = "ComboBoxEnumImage",
Presentation = PresentationMode.Combobox,
Item = PresentationItem.Image,
Category = "EnumComboBox",
IsVisible = true,
IsEnabled = true,
Index = 5,
Localizable = true,
Tooltip = "ComboBoxEnumImageToolTips"
)]
public EnumLocalized ComboBoxEnumImage { get; set; }
# endregion EnumComboBox
# region ComboBox Category
/// <summary>
/// ComboBox supporting int16 values.
/// This comboBox is filled using "DataSourceInt16List" data source.
/// "DataSourceInt16List" is based on int16List values {1,2,3,4}.
/// </summary>
[SchemaProperty]
[ComboBox(
DataSourceKey = "DataSourceInt16List",
Category = "ComboBox",
Description = "ComboBoxInt16",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxInt16ToolTips"
)]
public Int16 ComboBoxInt16 { get; set; }
/// <summary>
/// ComboBox supporting int32 values.
/// This comboBox is filled using "DataSourceInt32List" data source.
/// "DataSourceInt32List" is based on int32List values {1,2,3,4}.
/// </summary>
[SchemaProperty]
[ComboBox(
DataSourceKey = "DataSourceInt32List",
Category = "ComboBox",
Description = "ComboBoxInt32",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxInt32ToolTips"
)]
public Int32 ComboBoxInt32 { get; set; }
/// <summary>
/// ComboBox supporting bool values.
/// This comboBox is filled using "DataSourceBoolList" data source.
/// "DataSourceBoolList" is based on boolList values {true,false}.
/// </summary>
[SchemaProperty]
[ComboBox(
DataSourceKey = "DataSourceBoolList",
Category = "ComboBox",
Description = "ComboBoxBool",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxBoolToolTips"
)]
public bool ComboBoxBool { get; set; }
/// <summary>
/// ComboBox supporting UV values.
/// This comboBox is filled using "DataSourceUVList" data source.
/// "DataSourceUVList" is based on uvList values {(1,1),(2,2),(3,3)}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ComboBox(
DataSourceKey = "DataSourceUVList",
Category = "ComboBox",
Description = "ComboBoxUV",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxUVToolTips"
)]
public UV ComboBoxUV { get; set; }
/// <summary>
/// ComboBox supporting XYZ values.
/// This comboBox is filled using "DataSourceXYZList" data source.
/// "DataSourceXYZList" is based on xyzList values {(1,1,1),(2,2,2),(3,3,3)}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ComboBox(
DataSourceKey = "DataSourceXYZList",
Category = "ComboBox",
Description = "ComboBoxXYZ",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxXYZToolTips"
)]
public XYZ ComboBoxXYZ { get; set; }
/// <summary>
/// ComboBox supporting string values.
/// This comboBox is filled using "DataSourceStringList" data source.
/// "DataSourceStringList" is based on stringList values {"Choice 1", "Choice 2", "Choice 3", "Choice 4"}.
/// </summary>
[SchemaProperty]
[ComboBox(
DataSourceKey = "DataSourceStringList",
Category = "ComboBox",
Description = "ComboBoxString",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxStringToolTips"
)]
public string ComboBoxString { get; set; }
/// <summary>
/// ComboBox supporting ElementId values.
/// Selected index value is stored as ElementId.
/// This comboBox is filled using "DataSourceElementIdList" data source.
/// "DataSourceElementIdList" is the list of ElementID for the first five rebars form the current document
/// </summary>
[SchemaProperty]
[ComboBox(
Description = "ComboBoxElementId",
Category = "ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
DataSourceKey = "DataSourceElementIdList",
Tooltip = "ComboElementIDToolTips"
)]
public ElementId ComboBoxElementId { get; set; }
/// <summary>
/// ComboBox supporting Rebar type values.
/// This Element ComboBox is filled using "DataSourceRebarList" data source.
/// "DataSourceRebarList" is the list of Rebars from current document.
/// </summary>
[SchemaProperty]
[ElementComboBox(
Description = "ComboBoxRebar",
Category = "ComboBoxRebar",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
DataSourceKey = "DataSourceRebarList",
Tooltip = "ComboBoxRebarToolTips"
)]
public Autodesk.Revit.DB.Structure.RebarBarType ComboBoxRebar { get; set; }
/// <summary>
/// ComboBox supporting guid values.
/// This comboBox is filled using "DataSourceGuidList" data source.
/// "DataSourceGuidList" is based on guidList values {"6AED35BD-9143-4AAB-B568-7FC69C946824"),"F6F9D635-6AF3-4336-9D52-E734DFA9F97E", "E72993A5-CDFE-4501-9A34-D3A6DA407CD6" ;.
/// </summary>
[SchemaProperty]
[ComboBox(
DataSourceKey = "DataSourceGuidList",
Category = "ComboBox",
Description = "ComboBoxGuid",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Tooltip = "ComboBoxGuidToolTips"
)]
public Guid ComboBoxGuid { get; set; }
/// <summary>
/// ComboBox supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Selected index value is stored in DUT_METERS.
/// This comboBox is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ComboBox(
DataSourceKey = "DataSourceDoubleList",
Category = "ComboBox",
Description = "ComboBoxDouble",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Tooltip = "ComboBoxDoubleToolTips"
)]
public Double ComboBoxDouble { get; set; }
# endregion ComboBox Category
}
}
@@ -0,0 +1,269 @@
//
// (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.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.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
[Schema("tabEnumSchema", "effcafc6-a56d-4090-9a8c-c3e8a04c3ef0")]
public class TabEnumSchema : SchemaClass
{
# region Constructors
/// <summary>
///
/// </summary>
public TabEnumSchema()
{
OptionListEnumImage = new List<EnumLocalized>();
OptionListEnumText = new List<EnumLocalized>();
OptionListEnumImageText = new List<EnumLocalized>();
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabEnumSchema(Document document)
{
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabEnumSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
# region ToggleButton
/// <summary>
/// EnumControl supporting strings values and images presented as ToggleButton.
/// Strings associated to AnEnumLocalized.Choice1, AnEnumLocalized.Choice2, AnEnumLocalized.Choice3 are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.ToggleButton,
EnumType = typeof(EnumLocalized),
ImageSize = Autodesk.Revit.UI.ExtensibleStorage.Framework.ImageSize.Small ,
Item = PresentationItem.ImageWithText,
Category = "ToggleButton",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "ToggleButtonEnumImageText",
Tooltip = "ToggleButtonEnumImageTextToolTips"
)]
public EnumLocalized ToggleButtonEnumImageText { get; set; }
/// <summary>
/// EnumControl supporting images presented as ToggleButton.
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.ToggleButton,
EnumType = typeof(EnumLocalized),
Item = PresentationItem.Image,
ImageSize = Autodesk.Revit.UI.ExtensibleStorage.Framework.ImageSize.Medium ,
Category = "ToggleButton",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "ToggleButtonEnumImage",
Tooltip = "ToggleButtonEnumImageToolTips"
)]
public EnumLocalized ToggleButtonEnumImage { get; set; }
/// <summary>
/// EnumControl supporting strings values presented as ToggleButton.
/// Strings associated to [Choice1,Choice2,Choice3] are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.ToggleButton,
EnumType = typeof(EnumLocalized),
Item = PresentationItem.Text,
ImageSize = Autodesk.Revit.UI.ExtensibleStorage.Framework.ImageSize.Small,
Category = "ToggleButton",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "ToggleButtonEnumText",
Tooltip = "ToggleButtonEnumTextToolTips"
)]
public EnumLocalized ToggleButtonEnumText { get; set; }
# endregion ToggleButton
# region OptionList
/// <summary>
/// EnumControl supporting strings values presented as OptionList(List).
/// Strings associated to [Choice1,Choice2,Choice3] are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.OptionList,
Item = PresentationItem.Text,
EnumType = typeof(EnumLocalized),
Category = "OptionList",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "OptionListEnumText",
Tooltip = "OptionListEnumTextToolTips"
)]
public List<EnumLocalized> OptionListEnumText { get; set; }
/// <summary>
/// EnumControl supporting strings values and images presented as OptionList(List).
/// Strings associated to AnEnumLocalized.Choice1, AnEnumLocalized.Choice2, AnEnumLocalized.Choice3 are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.OptionList,
Item = PresentationItem.ImageWithText,
EnumType = typeof(EnumLocalized),
Category = "OptionList",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "OptionListEnumImageText",
Tooltip = "OptionListEnumImageTextToolTips"
)]
public List<EnumLocalized> OptionListEnumImageText { get; set; }
/// <summary>
/// EnumControl supporting images presented as OptionList(List).
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.OptionList,
Item = PresentationItem.Image,
EnumType = typeof(EnumLocalized),
Category = "OptionList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "OptionListEnumImage",
Tooltip = "OptionListEnumImageToolTips"
)]
public List<EnumLocalized> OptionListEnumImage { get; set; }
#endregion OptionList
#region RadioButton
/// <summary>
/// EnumControl supporting strings values and images presented as OptionList(RadioButton).
/// Strings associated to AnEnumLocalized.Choice1, AnEnumLocalized.Choice2, AnEnumLocalized.Choice3 are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.OptionList,
Item = PresentationItem.ImageWithText,
EnumType = typeof(EnumLocalized),
Category = "RadioButton",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "RadioButtonEnumImageText",
Tooltip = "RadioButtonEnumImageTextToolTips"
)]
public EnumLocalized RadioButtonEnumImageText { get; set; }
/// <summary>
/// EnumControl supporting images presented as OptionList(RadioButton).
/// Uri for associated images are returned by the GetResourceImage(string key) function.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.OptionList,
Item = PresentationItem.Image,
EnumType = typeof(EnumLocalized),
Category = "RadioButton",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "RadioButtonEnumImage",
Tooltip = "RadioButtonEnumImageToolTips"
)]
public EnumLocalized RadioButtonEnumImage { get; set; }
/// <summary>
/// EnumControl supporting strings values presented as OptionList(RadioButton).
/// Strings associated to [Choice1,Choice2,Choice3] are part of the resources file.
/// On the UI are visible strings "This is my choice 1","This is my choice 2","This is my choice 3"
/// Enum field is stored as integer with default enumerator values.
/// </summary>
[SchemaProperty]
[EnumControl(
Presentation = PresentationMode.OptionList,
Item = PresentationItem.Text,
EnumType = typeof(EnumLocalized),
Category = "RadioButton",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "RadioButtonEnumText",
Tooltip = "RadioButtonEnumTextToolTips"
)]
public EnumLocalized RadioButtonEnumText { get; set; }
# endregion RadioButton
}
}
@@ -0,0 +1,716 @@
//
// (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.Collections.Generic;
using System.Linq;
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.UI.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.DB.Structure ;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
[Schema("tabGridSchema", "02639b0b-d52a-453c-be68-a4a98aa81945")]
public class TabGridSchema : SchemaClass
{
public RebarBarType rbt = null;
# region Constructors
/// <summary>
/// Initialize
/// </summary>
public TabGridSchema()
{
# region GridTextBox
GridTextBoxDouble = new List<Double>();
GridTextBoxXYZ = new List<XYZ>();
GridTextBoxUV = new List<UV>();
GridTextBoxBool = new List<bool>();
GridTextBoxInt16 = new List<short>();
GridTextBoxInt32 = new List<int>();
GridTextBoxString = new List<string>();
GridTextBoxGuid = new List<Guid>();
GridTextBoxXYZRemoveNotAllow = new List<XYZ> { new XYZ(1, 1, 1), new XYZ(2, 2, 2) };
# endregion GridTextBox
# region GridComboBox
GridComboBoxDouble = new List<Double>();
GridComboBoxXYZ = new List<XYZ>();
GridComboBoxUV = new List<UV>();
GridComboBoxBool = new List<bool>();
GridComboBoxInt16 = new List<short>();
GridComboBoxInt32 = new List<int>();
GridComboBoxString = new List<string>();
GridComboBoxGuid = new List<Guid>();
# endregion GridComboBox
GridUnitTextBoxDouble = new List<Double>();
GridXYZTextBox = new List<XYZ>();
GridCheckBoxBool = new List<bool>();
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabGridSchema(Document document)
{
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabGridSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
# region GridTextBox
/// <summary>
/// Grid TextBox supporting a value defined as double.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Area, DisplayUnit = DisplayUnitType.DUT_SQUARE_CENTIMETERS)]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_SQUARE_CENTIMETERS,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxDouble",
Tooltip = "GridTextBoxDoubleToolTips"
)]
public List<Double> GridTextBoxDouble { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as XYZ.
/// Default XYZ is provided by the XYZDefaultValueProvider (1,1,1).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length , DisplayUnit = DisplayUnitType.DUT_METERS)]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxXYZ",
Tooltip = "GridTextBoxXYZToolTips",
DefaultValueProvider = typeof(XYZDefaultValueProvider)
)]
public List<XYZ> GridTextBoxXYZ { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as UV.
/// Default UV is provided by the UVDefaultValueProvider (1,1).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxUV",
Tooltip = "GridTextBoxUVToolTips",
DefaultValueProvider = typeof(UVDefaultValueProvider)
)]
public List<UV> GridTextBoxUV { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as integer16.
/// Default integer is provided by the IntDefaultValueProvider (2).
/// </summary>
[SchemaProperty()]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxInt16",
Tooltip = "GridTextBoxInt16ToolTips",
DefaultValueProvider = typeof(Int16DefaultValueProvider)
)]
public List<Int16> GridTextBoxInt16 { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as integer32.
/// integer is set to 5 per default.
/// </summary>
[SchemaProperty()]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxInt32",
Tooltip = "GridTextBoxInt32ToolTips",
DefaultValue = 5
)]
public List<Int32> GridTextBoxInt32 { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as string.
/// String is set to "Choice 1" per default.
/// </summary>
[SchemaProperty()]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxString",
Tooltip = "GridTextBoxStringToolTips",
DefaultValue = "Choice 1"
)]
public List<string> GridTextBoxString { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as boolean.
/// Boolean is set to true per default.
/// </summary>
[SchemaProperty()]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxBool",
Tooltip = "GridTextBoxBoolToolTips",
DefaultValue = true
)]
public List<bool> GridTextBoxBool { get; set; }
/// <summary>
/// Grid TextBox supporting a value defined as guid.
/// Default guid is porvided by the GUIDDefaultValueProvider
/// </summary>
[SchemaProperty()]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid TextBox",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "GridTextBoxGuid",
Tooltip = "GridTextBoxGuidToolTips" ,
DefaultValueProvider = typeof(GUIDDefaultValueProvider)
)]
public List<Guid> GridTextBoxGuid { get; set; }
# endregion GridTextBox
# region GridComboBox
/// <summary>
/// Grid ComboBox supporting some double values.
/// ComboBox is filled using "ComboBoxDouble" data source [10,20,30,40].
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_CENTIMETERS)]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxDouble",
Tooltip = "GridComboBoxDoubleToolTips",
DataSourceKey = "DataSourceDoubleList",
DefaultValue = 10
)]
public List<Double> GridComboBoxDouble { get; set; }
/// <summary>
/// Grid ComboBox supporting some XYZ values.
/// ComboBox is filled using "DataSourceXYZList" data source.
/// Default value is set using XYZDefaultValueProvider
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_CENTIMETERS)]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxXYZ",
Tooltip = "GridComboBoxXYZToolTips",
DataSourceKey = "DataSourceXYZList",
DefaultValueProvider = typeof(XYZDefaultValueProvider)
)]
public List<XYZ> GridComboBoxXYZ { get; set; }
/// <summary>
/// Grid ComboBox supporting UV values.
/// ComboBox is filled using "DataSourceUVList" data source.
/// Default value is set using UVDefaultValueProvider
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_CENTIMETERS)]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxUV",
Tooltip = "GridComboBoxUVToolTips",
DataSourceKey = "DataSourceUVList",
DefaultValueProvider = typeof(UVDefaultValueProvider)
)]
public List<UV> GridComboBoxUV { get; set; }
/// <summary>
/// Grid ComboBox supporting integer16 values.
/// ComboBox is filled using "DataSourceInt16List" data source.
/// Default value is set using Int16DefaultValueProvider
/// </summary>
[SchemaProperty()]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxInt16",
Tooltip = "GridComboBoxInt16ToolTips",
DataSourceKey = "DataSourceInt16List",
DefaultValueProvider = typeof(Int16DefaultValueProvider)
)]
public List<Int16 > GridComboBoxInt16 { get; set; }
/// <summary>
/// Grid ComboBox supporting integer32 values.
/// ComboBox is filled using "DataSourceInt32List" data source.
/// Default value is set to 1.
[SchemaProperty()]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxInt32",
Tooltip = "GridComboBoxInt32ToolTips",
DataSourceKey = "DataSourceInt32List",
DefaultValue = 1
)]
public List<Int32> GridComboBoxInt32 { get; set; }
/// <summary>
/// Grid ComboBox supporting guid values.
/// ComboBox is filled using "DataSourceGuidList" data source.
/// Default value is set using GUIDDefaultValueProvider
[SchemaProperty()]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxGuid",
Tooltip = "GridComboBoxGuidToolTips",
DataSourceKey = "DataSourceGuidList",
DefaultValueProvider = typeof(GUIDDefaultValueProvider)
)]
public List<Guid> GridComboBoxGuid { get; set; }
/// <summary>
/// Grid ComboBox supporting boolean values.
/// ComboBox is filled using "DataSourceBoolList" data source.
/// Default value is set to true.
[SchemaProperty()]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxBool",
Tooltip = "GridComboBoxBoolToolTips",
DataSourceKey = "DataSourceBoolList",
DefaultValue = true
)]
public List<bool> GridComboBoxBool { get; set; }
/// <summary>
/// Grid ComboBox supporting string values.
/// ComboBox is filled using "DataSourceStringList" data source.
/// Default value is set to "Choice 1".
[SchemaProperty()]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid ComboBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridComboBoxString",
Tooltip = "GridComboBoxStringToolTips",
DataSourceKey = "DataSourceStringList",
DefaultValue = "Choice 1"
)]
public List<string> GridComboBoxString { get; set; }
# endregion GridComboBox
# region UnitTextBox
/// <summary>
/// Grid TextBox supporting a value defined as double.
/// Default value is set to 10.0.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Area, DisplayUnit = DisplayUnitType.DUT_SQUARE_CENTIMETERS)]
[GridUnitTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
Category = "Grid UnitTextBox",
AttributeUnit = DisplayUnitType.DUT_SQUARE_CENTIMETERS,
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "GridUnitTextBoxDouble",
Tooltip = "GridUnitTextBoxDoubleToolTips",
DefaultValue = 10.0)]
public List<Double> GridUnitTextBoxDouble { get; set; }
# endregion UnitTextBox
# region XYZTextBox
/// <summary>
/// Grid TextBox supporting a value defined as XYZ.
/// Default XYZ is provided by the XYZDefaultValueProvider (1,1,1).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[GridXYZTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid XYZTextBox",
IsVisible = true,
IsEnabled = true,
Index = 7,
Localizable = true,
Description = "GridXYZTextBox",
Tooltip = "GridXYZTextBoxToolTips",
DefaultValueProvider = typeof(XYZDefaultValueProvider)
)]
public List<XYZ> GridXYZTextBox { get; set; }
/// <summary>
/// Grid TextBox supporting a key defined as string and value defined as XYZ.
/// Default values are for the first point 1 (1,1,1) and for the point 2 (2,2,2).
/// Point 1 and 2 are defined on the constructor.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[GridXYZTextBox(
AllowToAddElements = false,
AllowToRemoveElements = false,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "XYZTextBox",
IsVisible = true,
IsEnabled = true,
Index = 7,
Localizable = true,
Description = "GridTextBoxXYZRemoveNotAllow",
Tooltip = "GridTextBoxXYZRemoveNotAllowToolTips"
)]
public List<XYZ> GridTextBoxXYZRemoveNotAllow { get; set; }
# endregion XYZTextBox
# region GridCheckBox
/// <summary>
/// Grid CheckBox supporting a boolean.
////// </summary>
[SchemaProperty()]
[GridCheckBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Grid CheckBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "GridCheckBoxBool",
Tooltip = "GridCheckBoxBoolToolTips",
DefaultValue = true
)]
public List<bool> GridCheckBoxBool { get; set; }
# endregion GridCheckBox
# region GridEnumCombobox
/// <summary>
/// Grid Enum ComboBox supporting image.
/// Default value is set to Choice 3
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType = typeof(EnumLocalized),
Presentation = PresentationMode.Combobox,
Item = PresentationItem.Image,
Description = "GridEnumComboboxImage",
Category = "Grid Enum Combobox",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumComboboxImageToolTips",
DefaultValue = EnumLocalized.Choice3
)]
public List<EnumLocalized> GridEnumComboboxImage { get; set; }
/// <summary>
/// Grid Enum ComboBox supporting text.
/// Default value is set to Choice 2
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType = typeof(EnumLocalized),
Presentation = PresentationMode.Combobox,
Item = PresentationItem.Text,
Description = "GridEnumComboboxText",
Category = "Grid Enum Combobox",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumComboboxTextToolTips",
DefaultValue = EnumLocalized.Choice2
)]
public List<EnumLocalized> GridEnumComboboxText { get; set; }
/// <summary>
/// Grid Enum ComboBox supporting image and text.
/// Default value is set to Choice 1
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType= typeof(EnumLocalized),
Presentation = PresentationMode.Combobox,
Item = PresentationItem.ImageWithText ,
Description = "GridEnumComboboxImageText",
Category = "Grid Enum Combobox",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumComboboxImageTextToolTips",
DefaultValue = EnumLocalized.Choice1
)]
public List<EnumLocalized> GridEnumComboboxImageText { get; set; }
# endregion GridEnumCombobox
# region GridEnumOptionList
/// <summary>
/// Grid Enum OptionList supporting image.
/// Default value is set to Choice 3.
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType = typeof(EnumLocalized),
Presentation = PresentationMode.OptionList ,
Item = PresentationItem.Image,
Description = "GridEnumOptionListImage",
Category = "Grid Enum OptionList",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumOptionListImageToolTips",
DefaultValue = EnumLocalized.Choice3
)]
public List<EnumLocalized> GridEnumOptionListImage { get; set; }
/// <summary>
/// Grid Enum OptionList supporting text.
/// Default value is set to Choice 2.
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType = typeof(EnumLocalized),
Presentation = PresentationMode.OptionList,
Item = PresentationItem.Text,
Description = "GridEnumOptionListText",
Category = "Grid Enum OptionList",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumOptionListTextToolTips",
DefaultValue = EnumLocalized.Choice2
)]
public List<EnumLocalized> GridEnumOptionListText { get; set; }
/// <summary>
/// Grid Enum OptionList supporting image and text.
/// Default value is set to Choice 1.
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
// EnumType= typeof(AnEnumLocalized),
Presentation = PresentationMode.OptionList,
Item = PresentationItem.ImageWithText,
Description = "GridEnumOptionListImageText",
Category = "Grid Enum OptionList",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumOptionListImageTextToolTips",
DefaultValue = EnumLocalized.Choice1
)]
public List<EnumLocalized> GridEnumOptionListImageText { get; set; }
# endregion GridEnumOptionList
# region GridEnumToggleButton
/// <summary>
/// Grid Enum ToggleButton supporting image.
/// Default value is set to Choice 3.
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType = typeof(EnumLocalized),
Presentation = PresentationMode.ToggleButton,
Item = PresentationItem.Image,
Description = "GridEnumToggleButtonImage",
Category = "Grid Enum ToggleButton",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumToggleButtonImageToolTips",
DefaultValue = EnumLocalized.Choice3
)]
public List<EnumLocalized> GridEnumToggleButtonImage { get; set; }
/// <summary>
/// Grid Enum ToggleButton supporting text.
/// Default value is set to Choice 2.
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType = typeof(EnumLocalized),
Presentation = PresentationMode.ToggleButton ,
Item = PresentationItem.Text,
Description = "GridEnumToggleButtonText",
Category = "Grid Enum ToggleButton",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumToggleButtonTextToolTips",
DefaultValue = EnumLocalized.Choice2
)]
public List<EnumLocalized> GridEnumToggleButtonText { get; set; }
/// <summary>
/// Grid Enum ToggleButton supporting image and text.
/// Default value is set to Choice 1.
/// <summary>
[SchemaProperty()]
[GridEnumControl(
AllowToAddElements = true,
AllowToRemoveElements = true,
EnumType= typeof(EnumLocalized),
Presentation = PresentationMode.ToggleButton ,
Item = PresentationItem.ImageWithText,
Description = "GridEnumToggleButtonImageText",
Category = "Grid Enum ToggleButton",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Tooltip = "GridEnumToggleButtonImageTextToolTips",
DefaultValue = EnumLocalized.Choice1
)]
public List<EnumLocalized> GridEnumToggleButtonImageText{ get; set; }
# endregion GridEnumToggleButton
}
}
@@ -0,0 +1,192 @@
//
// (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.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
[Schema("tabKeySchema", "02639b0b-d52a-453c-be68-a4a98aa81946")]
public class TabKeySchema : SchemaClass
{
# region Constructors
/// <summary>
/// Initialize
/// </summary>
public TabKeySchema()
{
GridKeyComboBoxString = new Dictionary<String, String>();
GridKeyTextBoxString = new Dictionary<String, String>();
GridKeyTextBoxStringDouble = new Dictionary<String, Double>();
GridKeyTextBoxStringUnitDouble = new Dictionary<String, Double>();
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabKeySchema(Document document)
{
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabKeySchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
# region GridKey
/// <summary>
/// Grid Key TextBox supporting a key defined as string and a value defined as double.
/// Default value is set to 10. Default key is set to 1 and will be incremented after each addition.
/// Key are ckecked and validate on runtime to avoid duplication.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_CENTIMETERS)]
[GridKeyTextBox(
AttributeUnit = DisplayUnitType.DUT_METERS,
IsVisible = true,
IsEnabled = true,
Category = "GridKey",
Index = 2,
Localizable = true,
DefaultValue = "1")]
[GridTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Description = "GridKeyTextBoxStringDouble",
Tooltip = "GridKeyTextBoxStringDoubleToolTips",
DefaultValue = 10.0)]
public Dictionary<String, Double> GridKeyTextBoxStringDouble { get; set; }
/// <summary>
/// Grid Key TextBox supporting a key defined as string and value defined as double, the unit type is set to length (meters).
/// Default value is set to 10.0 . Default key is set to 1 and will be incremented after each addition.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_CENTIMETERS)]
[GridKeyTextBox(
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
DefaultValue = "1")]
[GridUnitTextBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 4,
Localizable = true,
Description = "GridKeyTextBoxStringUnitDouble",
Tooltip = "GridKeyTextBoxStringUnitDoubleToolTips",
DefaultValue = 10.0)]
public Dictionary<String, Double> GridKeyTextBoxStringUnitDouble { get; set; }
/// <summary>
/// Grid Key TextBox supporting a key defined as string and value defined as string.
/// Default value is set to "Choice 1" .
/// Default key is set to 1 and will be incremented after each addition.
/// Key are ckecked and validate on runtime to avoid duplication.
/// </summary>
[SchemaProperty]
[GridKeyTextBox(
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
DefaultValue = "1")]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 5,
Localizable = true,
Description = "GridKeyTextBoxString",
Tooltip = "GridKeyTextBoxStringToolTips",
DataSourceKey = "DataSourceStringList",
DefaultValue = "Choice 1")]
public Dictionary<String, String> GridKeyTextBoxString { get; set; }
/// <summary>
/// Grid Key ComboBox supporting a key defined as a string and a value defined as string.
/// ComboBox is filled using "ComboBoxString" data source (Choice 1,Choice 2,Choice 3, Choice 4).
/// </summary>
[SchemaProperty]
[GridKeyComboBox(
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 4,
Localizable = true,
DefaultValue = "Choice 1",
DataSourceKey = "DataSourceStringList")]
[GridComboBox(
AllowToAddElements = true,
AllowToRemoveElements = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "GridKey",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Description = "GridKeyComboBoxString",
Tooltip = "GridKeyComboBoxStringToolTips",
DefaultValue = "Choice 1",
DataSourceKey = "DataSourceStringList")]
public Dictionary<String, String> GridKeyComboBoxString { get; set; }
# endregion GridKey
}
}
@@ -0,0 +1,263 @@
//
// (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.Structure;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
[Schema("tabListSchema", "f39afc35-6c0d-4e9e-9f23-eba3f1419940")]
public class TabListSchema : SchemaClass
{
# region checkedlist
/// <summary>
/// Element CheckedList supporting Rebar type values.
/// This Element CheckedList is filled using "DataSourceRebarList" data source.
/// "DataSourceRebarList" is the list of Rebars from current document.
/// </summary>
[SchemaProperty(FieldName = "")]
[ElementCheckedList(
DataSourceKey = "DataSourceRebarList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "CheckListRebar",
Tooltip = "CheckListRebarToolTips"
)]
public List<RebarBarType> CheckListRebar { get; set; }
/// <summary>
/// CheckedList supporting string values.
/// This CheckedList is filled using "DataSourceStringList" data source.
/// "DataSourceStringList" is based on stringList values {"Choice 1", "Choice 2", "Choice 3", "Choice 4"}.
/// </summary>
[SchemaProperty()]
[CheckedList(
DataSourceKey = "DataSourceStringList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "CheckListString",
Tooltip = "CheckListStringToolTips"
)]
public List<String> CheckListString { get; set; }
/// <summary>
/// CheckedList supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Checked items values are stored in DUT_METERS.
/// This comboBox is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// Values are exposed on the UI based on Revit project units settings.
/// Revit project unit formatting won't be applyed on the UI (use Unit CheckedList to achieve this).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[CheckedList(
DataSourceKey = "DataSourceDoubleList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListDouble",
Tooltip = "CheckListDoubleToolTips"
)]
public List<Double> CheckListDouble { get; set; }
/// <summary>
/// CheckedList supporting XYZ values.
/// This CheckedList is filled using "DataSourceXYZList" data source.
/// "DataSourceXYZList" is based on xyzList values {(1, 1, 1),(2, 2, 2), (3, 3, 3)}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[CheckedList(
DataSourceKey = "DataSourceXYZList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListXYZ",
Tooltip = "CheckListXYZToolTips"
)]
public List<XYZ> CheckListXYZ { get; set; }
/// <summary>
/// CheckedList supporting UV values.
/// This CheckedList is filled using "DataSourceUVList" data source.
/// "DataSourceUVList" is based on uvList values {(1, 1),(2, 2), (3, 3)}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[CheckedList(
DataSourceKey = "DataSourceUVList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListUV",
Tooltip = "CheckListUVToolTips"
)]
public List<UV> CheckListUV { get; set; }
/// <summary>
/// CheckedList supporting boolean values.
/// This CheckedList is filled using "DataSourceBoolList" data source.
/// "DataSourceBoolList" is based on boolList values {true,false}.
/// </summary>
[SchemaProperty()]
[CheckedList(
DataSourceKey = "DataSourceBoolList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListBool",
Tooltip = "CheckListBoolToolTips"
)]
public List<bool> CheckListBool { get; set; }
/// <summary>
/// CheckedList supporting int16 values.
/// This CheckedList is filled using "DataSourceInt16List" data source.
/// "DataSourceInt16List" is based on int16List values {1,2,3,4}.
/// </summary>
[SchemaProperty()]
[CheckedList(
DataSourceKey = "DataSourceInt16List",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListInt16",
Tooltip = "CheckListInt16ToolTips"
)]
public List<Int16> CheckListInt16 { get; set; }
/// <summary>
/// CheckedList supporting int32 values.
/// This CheckedList is filled using "DataSourceInt32List" data source.
/// "DataSourceInt32List" is based on int32List values {1,2,3,4}.
/// </summary>
[SchemaProperty()]
[CheckedList(
DataSourceKey = "DataSourceInt32List",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListInt32",
Tooltip = "CheckListInt32ToolTips"
)]
public List<Int32> CheckListInt32 { get; set; }
/// <summary>
/// CheckedList supporting boolean values.
/// This CheckedList is filled using "DataSourceGuidList" data source.
/// "DataSourceGuidList" is based on guidList values {"6AED35BD-9143-4AAB-B568-7FC69C946824"), ("F6F9D635-6AF3-4336-9D52-E734DFA9F97E"), ("E72993A5-CDFE-4501-9A34-D3A6DA407CD6") }
/// </summary>
[SchemaProperty()]
[CheckedList(
DataSourceKey = "DataSourceGuidList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "CheckListGuid",
Tooltip = "CheckListGuidToolTips"
)]
public List<Guid> CheckListGuid { get; set; }
/// <summary>
/// Unit CheckedList supporting double values.
/// The unit type is set to length (DUT_METERS).
/// Checked item values are stored in DUT_METERS.
/// This CheckedList is filled using "DataSourceDoubleList" data source.
/// "DataSourceDoubleList" is based on doubleList values {10.0, 20.0, 30.0, 40.0}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitCheckedList(
DataSourceKey = "DataSourceDoubleList",
Category = "CheckedList",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Description = "UnitCheckListDouble",
Tooltip = "UnitCheckListDoubleToolTips"
)]
public List<Double> UnitCheckListDouble { get; set; }
# endregion checkedlist
# region Constructors
/// <summary>
///
/// </summary>
public TabListSchema()
{
CheckListRebar = new List<RebarBarType>();
CheckListDouble = new List<Double>();
CheckListDouble.Add(10);
CheckListString = new List<String>();
CheckListString.Add("Choice 1");
UnitCheckListDouble = new List<Double>();
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabListSchema(Document document)
{
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabListSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
}
}
@@ -0,0 +1,355 @@
//
// (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.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
[Schema("tabListTextBoxSchema", "ecf25bef-5ce6-422c-9b7f-630b9f8ced85")]
public class TabListTextBoxSchema : SchemaClass
{
# region list
/// <summary>
/// Unit TextBox supporting a list of double value
/// The separator is ";" character.
/// The unit type is set to length (DUT_METERS).
/// These values are stored in DUT_METERS.
/// These values are initialized via the constructor to {10.0, 20.0} DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListUnitTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "ListUnitTextBoxDouble",
Tooltip = "ListUnitTextBoxDoubleToolTips"
)]
public List<Double> ListUnitTextBoxDouble { get; set; }
/// <summary> /// Unit TextBox supporting a list of double value
/// The separator is ";" character.
/// Number of items is limited to 5;
/// The unit type is set to length (DUT_METERS).
/// These values are stored in DUT_METERS.
/// These values are initialized via the constructor to {10.0, 20.0,30.0,40.0,50.0} DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListUnitTextBox(
ValidateMaximumItemCount = true,
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
MaximumItemCount = 5,
Description = "ListUnitTextBoxMaxItemSet",
Tooltip = "ListUnitTextBoxMaxItemSetToolTips"
)]
public List<Double> ListUnitTextBoxMaxItemSet { get; set; }
/// <summary>
/// Unit TextBox supporting a list of double value
/// The separator is ";" character.
/// Number of items should be superior to 2;
/// The unit type is set to length (DUT_METERS).
/// These values are stored in DUT_METERS.
/// These values are initialized via the constructor to {10.0, 20.0} DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListUnitTextBox(
ValidateMinimumItemCount = true,
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
MinimumItemCount = 2,
Description = "ListUnitTextBoxMinItemSet",
Tooltip = "ListUnitTextBoxMinItemSetSetToolTips"
)]
public List<Double> ListUnitTextBoxMinItemSet { get; set; }
/// <summary>
/// Unit TextBox supporting a list of double value
/// The separator is ";" character.
/// The unit type is set to length (DUT_METERS).
/// These values are stored in DUT_METERS.
/// These values should be lower than 100 in DUT_METERS.
/// These values are initialized via the constructor to {10.0, 20.0} DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListUnitTextBox(
ValidateMaximumValue = true,
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
MaximumValue = 100,
Description = "ListUnitTextBoxMaxValueSet",
Tooltip = "ListUnitTextBoxMaxValueSetToolTips"
)]
public List<Double> ListUnitTextBoxMaxValueSet { get; set; }
/// <summary>
/// Unit TextBox supporting a list of double value
/// The separator is ";" character.
/// The unit type is set to length (DUT_METERS).
/// These values are stored in DUT_METERS.
/// These values should be upper than 5 in DUT_METERS.
/// These values are initialized via the constructor to {10.0, 20.0} DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListUnitTextBox(
ValidateMinimumValue = true,
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 4,
Localizable = true,
MinimumValue = 5,
Description = "ListUnitTextBoxMinValueSet",
Tooltip = "ListUnitTextBoxMinValueSetToolTips"
)]
public List<Double> ListUnitTextBoxMinValueSet { get; set; }
/// <summary>
/// TextBox supporting a list of string values
/// The separator is ";" character.
/// These values are initialized via the constructor to {"this is a first text", "this is a second text"}.
/// </summary>
[SchemaProperty()]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 5,
Localizable = true,
Description = "ListTextBoxString",
Tooltip = "ListTextBoxStringToolTips"
)]
public List<String> ListTextBoxString { get; set; }
/// <summary>
/// TextBox supporting a list of int16 values
/// The separator is ";" character.
/// These values are initialized via the constructor to {1,2,3}.
/// </summary>
[SchemaProperty()]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Description = "ListTextBoxInt16",
Tooltip = "ListTextBoxInt16ToolTips"
)]
public List<Int16> ListTextBoxInt16 { get; set; }
/// <summary>
/// TextBox supporting a list of int32 values
/// The separator is ";" character.
/// These values are initialized via the constructor to {1,2,3}.
/// </summary>
[SchemaProperty()]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 7,
Localizable = true,
Description = "ListTextBoxInt32",
Tooltip = "ListTextBoxInt32ToolTips"
)]
public List<Int32> ListTextBoxInt32 { get; set; }
/// <summary>
/// TextBox supporting a list of double values
/// The separator is ";" character.
/// These values are initialized via the constructor to {10,20,30}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 8,
Localizable = true,
Description = "ListTextBoxDouble",
Tooltip = "ListTextBoxDoubleToolTips"
)]
public List<double> ListTextBoxDouble { get; set; }
/// <summary>
/// TextBox supporting a list of XYZ values
/// The separator is ";" character.
/// These values are initialized via the constructor to {XYZ(1,1,1),XYZ(2,2,2)}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS, FieldName = "")]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 9,
Localizable = true,
Description = "ListTextBoxXYZ",
Tooltip = "ListTextBoxXYZToolTips",
FieldFormat = typeof(ValueFormatListXYZ)
)]
public List<XYZ> ListTextBoxXYZ { get; set; }
/// <summary>
/// TextBox supporting a list of UV values
/// The separator is ";" character.
/// These values are initialized via the constructor to {UV(1,1),UV(2,2)}.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 10,
Localizable = true,
Description = "ListTextBoxUV",
Tooltip = "ListTextBoxUVToolTips",
FieldFormat = typeof(ValueFormatListUV)
)]
public List<UV> ListTextBoxUV { get; set; }
/// <summary>
/// TextBox supporting a list of Guid values
/// The separator is ";" character.
/// These values are initialized via the constructor to {("6AED35BD-9143-4AAB-B568-7FC69C946824"),("F6F9D635-6AF3-4336-9D52-E734DFA9F97E"), ("E72993A5-CDFE-4501-9A34-D3A6DA407CD6")}.
/// </summary>
[SchemaProperty(FieldName = "")]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 11,
Localizable = true,
Description = "ListTextBoxGuid",
Tooltip = "ListTextBoxGuidToolTips",
FieldFormat = typeof(ValueFormatListGuid)
)]
public List<Guid> ListTextBoxGuid { get; set; }
/// <summary>
/// TextBox supporting a list of boolean values
/// The separator is ";" character.
/// These values are initialized via the constructor to {true,false}.
/// </summary>
[SchemaProperty()]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 12,
Localizable = true,
Description = "ListTextBoxBool",
Tooltip = "ListTextBoxBoolToolTips"
)]
public List<bool> ListTextBoxBool { get; set; }
/// <summary>
/// TextBox supporting a list of ElementId values
/// The separator is ";" character.
/// These values are initialized via the constructor with the first 5 rebar type Elementd from project.
/// </summary>
[SchemaProperty()]
[ListTextBox(
Category = "List",
IsVisible = true,
IsEnabled = true,
Index = 13,
Localizable = true,
Description = "ListTextBoxElementId",
Tooltip = "ListTextBoxDoubleElementIdToolTips",
FieldFormat = typeof(ValueFormatListElementId)
)]
public List<ElementId> ListTextBoxElementId { get; set; }
# endregion list
# region Constructors
/// <summary>
///
/// </summary>
public TabListTextBoxSchema()
{
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabListTextBoxSchema(Document document)
{
ListUnitTextBoxDouble = new List<Double> { 10.0, 20.0 };
ListUnitTextBoxMaxItemSet = new List<Double> { 10.0, 20.0, 30.0, 40.0, 50.0 };
ListUnitTextBoxMinItemSet = new List<Double> { 10.0, 20.0 };
ListUnitTextBoxMaxValueSet = new List<Double> { 10.0, 20.0 };
ListUnitTextBoxMinValueSet = new List<Double> { 10.0, 20.0 };
ListTextBoxString = new List<String> { "this is a first text", "this is a second text" };
ListTextBoxBool = new List<bool> { true, false };
ListTextBoxDouble = new List<Double> { 10.0, 20.0 };
ListTextBoxInt16 = new List<short> { 1, 2, 3 };
ListTextBoxInt32 = new List<int> { 1, 2, 3 };
ListTextBoxUV = new List<UV> { new UV(1, 1), new UV(2, 2) };
ListTextBoxXYZ = new List<XYZ> { new XYZ(1, 1, 1), new XYZ(2, 2, 2) };
ListTextBoxGuid = new List<Guid> { new Guid("6AED35BD-9143-4AAB-B568-7FC69C946824"), new Guid("F6F9D635-6AF3-4336-9D52-E734DFA9F97E"), new Guid("E72993A5-CDFE-4501-9A34-D3A6DA407CD6") };
ListTextBoxElementId = (new FilteredElementCollector(document).OfClass(typeof(Autodesk.Revit.DB.Structure.RebarBarType)).ToElementIds() as List<ElementId>).GetRange(0,5) ;
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="document"></param>
public TabListTextBoxSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
}
}
@@ -0,0 +1,161 @@
//
// (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.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
///
/// </summary>
///
[Schema("tabMiscellaniousSchema", "0934f0c3-05df-4512-9c3f-fb6637a88c65")]
public class TabMiscellaniousSchema : SchemaClass
{
# region Constructors
/// <summary>
///
/// </summary>
public TabMiscellaniousSchema()
{
SubSchemaSimple = new SubSchema();
SubSchemaEmbedded = new SubSchema();
SubSchemaList = new List<SubSchema>();
SubSchemaDictionary = new Dictionary<int, SubSchema>();
SubSchemaTable = new List<SubSchema>();
DoubleNotSerialized = 5;
}
/// <summary>
///
/// </summary>
/// <param name="document"></param>
public TabMiscellaniousSchema(Document document)
{
}
///// <summary>
/////
///// </summary>
///// <param name="entity"></param>
///// <param name="document"></param>
public TabMiscellaniousSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
/// <summary>
/// SubSchema embedded on the main layout
/// </summary>
[SchemaProperty()]
[SubSchemaEmbeddedControl(
Category = "SubSchema Embedded",
Description="SubSchemaEmbedded",
Localizable = true
)]
public SubSchema SubSchemaEmbedded { get; set; }
/// <summary>
/// Schema embedded on an additional dialog launch by clicking the ellipse button
/// </summary>
[SchemaProperty()]
[SubSchemaControl(
Category = "SubSchema",
DialogTitle = "SubSchemaSimpleDialogTitle",
Description = "SubSchemaSimple",
Text = "SubSchemaSimpleText",
Tooltip = "SubSchemaSimpleToolTips"
)]
public SubSchema SubSchemaSimple { get; set; }
/// <summary>
/// List of schemas embedded on an additional dialog launch by clicking the ellipse button
/// </summary>
[SchemaProperty()]
[SubSchemaControl(
Category = "SubSchema",
DialogTitle = "SubSchemaListDialogTitle",
Description = "SubSchemaList",
Text = "SubSchemaListText",
Tooltip = "SubSchemaListToolTips"
)]
public List<SubSchema> SubSchemaList { get; set; }
/// <summary>
/// Dictionary of schemas embedded on an additional dialog launch by clicking the ellipse button
/// </summary>
[SchemaProperty()]
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.SubSchemaControl(
Category = "SubSchema",
DialogTitle = "SubSchemaDictionary",
Description = "SubSchemaDictionary",
Text = "SubSchemaDictionaryText",
Tooltip = "SubSchemaDictionaryToolTips"
)]
public Dictionary<int, SubSchema> SubSchemaDictionary { get; set; }
/// <summary>
/// List of schemas embedded on a table
/// </summary>
[SchemaProperty()]
[SubSchemaListTable(
Category = "SubSchema Table",
Description = "SubSchemaTable",
Tooltip = "SubSchemaToolTips"
)]
public List<SubSchema> SubSchemaTable { get; set; }
# region without serialization
/// <summary>
/// Unit TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is not serialized
/// this value is initialized via the constructor to 5 DUT_METERS in the range [4;6].
/// </summary>
[Unit(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitTextBox(
ValidateMinimumValue = true,
ValidateMaximumValue = true,
MinimumValue = 4,
MaximumValue = 6,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "Field Not Serialized",
IsVisible = true,
IsEnabled = true,
Index = -1,
Localizable = true,
Description = "DoubleNotSerialized",
Tooltip = "DoubleNotSerializedToolTips"
)]
public Double DoubleNotSerialized { get; set; }
# endregion without serialization
}
}
@@ -0,0 +1,160 @@
//
// (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;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
/// <summary>
/// The usage of this class demonstrate how to use NumericUpDown controls and associated features
/// </summary>
[Schema("tabNumericUpDownSchema", "0dc91899-8fe3-4e90-84b1-a48f3b6c8e11")]
public class TabNumericUpDownSchema : SchemaClass
{
# region Constructors
public TabNumericUpDownSchema()
{
NumericUpDownDoubleUnit = 10;
NumericUpDownDoubleUnitVolume = 2;
NumericUpDownInt = 15;
NumericUpDownDouble = 5;
}
public TabNumericUpDownSchema(Document document)
{
}
public TabNumericUpDownSchema(Entity entity, Document document)
: base(entity, document)
{
}
#endregion Constructors
# region NumericUpDown
/// <summary>
/// Unit NumericUpDown supporting a double value.
/// The unit type is set to length (DUT_FEET_FRACTIONAL_INCHES).
/// This value is stored in DUT_FEET_FRACTIONAL_INCHES.
/// The step is set to 5 DUT_FEET_FRACTIONAL_INCHES.
/// The minimal value is set to 0 DUT_FEET_FRACTIONAL_INCHES.
/// The maximal value is set to 100 DUT_FEET_FRACTIONAL_INCHES.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_FEET_FRACTIONAL_INCHES)]
[UnitNumericUpDown(
Description = "NumericUpDownDoubleUnit",
Category = "NumericUpDown",
AttributeUnit = DisplayUnitType.DUT_FEET_FRACTIONAL_INCHES,
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Step = 5,
MinimumValue = 0,
MaximumValue = 100,
Tooltip = "NumericUpDownDoubleUnitToolTips"
)]
public Double NumericUpDownDoubleUnit { get; set; }
/// <summary>
/// Unit NumericUpDown supporting a double value.
/// The unit type is set to volume (DUT_CUBIC_METERS)
/// This value is stored in DUT_CUBIC_METERS
/// Validation value and step are set in DUT_CUBIC_FEET.
/// The step is set to 1 DUT_CUBIC_FEET.
/// The minimal value is set to 0 DUT_CUBIC_FEET.
/// The maximal value is set to 100 DUT_CUBIC_FEET.
/// Default value is set to 2m³ and 1m³ = 35.3146670ft³
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Volume, DisplayUnit = DisplayUnitType.DUT_CUBIC_METERS )]
[UnitNumericUpDown(
Description = "NumericUpDownDoubleUnitVolume",
AttributeUnit = DisplayUnitType.DUT_CUBIC_FEET,
Category = "NumericUpDown",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Step = 1,
MinimumValue = 0,
MaximumValue = 100,
Tooltip = "NumericUpDownDoubleUnitVolumeToolTips"
)]
public Double NumericUpDownDoubleUnitVolume { get; set; }
/// <summary>
/// NumericUpDown supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// No Unit are displayed on the UI
/// The step is set to 5 DUT_METERS.
/// The minimal value is set to -100 DUT_METERS.
/// The maximal value is set to 100 DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitNumericUpDown(
Description = "NumericUpDownDouble",
Category = "NumericUpDown",
AttributeUnit = DisplayUnitType.DUT_METERS,
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Step = 5,
MinimumValue = -100,
MaximumValue = 100,
Tooltip = "NumericUpDownDoubleToolTips"
)]
public Double NumericUpDownDouble { get; set; }
/// <summary>
/// NumericUpDown supporting an integer value.
/// No Unit are displayed on the UI.
/// The step is set to 1.
/// The minimal value is set to 10.
/// The maximal value is set to 20.
/// </summary>
[SchemaProperty()]
[IntNumericUpDown(
Description = "NumericUpDownInt",
Category = "NumericUpDown",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Step = 1,
MinimumValue = 10,
MaximumValue = 20,
Tooltip = "NumericUpDownIntToolTips"
)]
public Int32 NumericUpDownInt { get; set; }
# endregion NumericUpDown
}
}
@@ -0,0 +1,373 @@
//
// (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;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
using Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes;
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
namespace ExtensibleStorageUI
{
[Categories(
new string[] { "DefaultTextBox", "XYZTextBox", "UnitTextBox" },
new int[]{1,2,3},
Localizable = true
)]
[Schema("tabTextBoxSchema", "632f1c20-2c8c-4fb2-87d7-fdbc1dcb3b79")]
public class TabTextBoxSchema : SchemaClass
{
# region Constructors
public TabTextBoxSchema()
{
TextBoxInteger32 = 2;
TextBoxInteger16 = 2;
TextBoxGuid = new Guid("632f1c20-2c8c-4fb2-87d7-fdbc1dcb3b79");
TextBoxBoolean = true;
TextBoxString = "A string for TextBoxString control";
TextBoxUV = new UV(5, 5);
TextBoxXYZ = new XYZ(5, 5, 5);
TextBoxDouble = 25;
TextBoxDoubleCalculated = TextBoxInteger32 * TextBoxDouble;
UnitTextBoxDouble = 10.0;
UnitTextBoxDoubleMinValueSet = 15;
UnitTextBoxDoubleMaxValueSet = 100;
UnitTextBoxDoubleIsNotEnabled = 5 * 10;
XYZTextBox = new XYZ(5, 5, 5);
}
public TabTextBoxSchema(Document document)
{
}
public TabTextBoxSchema(Entity entity, Document document): base(entity, document)
{
}
#endregion Constructors
# region UnitTextBox
/// <summary>
/// Unit TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to 10.0 DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitTextBox(
Category = "UnitTextBox",
AttributeUnit = DisplayUnitType.DUT_METERS,
IsVisible = true,
IsEnabled = true,
Index = 0,
Localizable = true,
Description = "UnitTextBoxDouble",
Tooltip = "UnitTextBoxDoubleToolTips"
)]
public Double UnitTextBoxDouble { get; set; }
/// <summary>
/// Unit TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to 5 x10 in DUT_FRACTIONAL_INCHES.
/// This control is disabled on the UI.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitTextBox(
ValidateMinimumValue = false,
ValidateMaximumValue = false,
AttributeUnit = DisplayUnitType.DUT_FRACTIONAL_INCHES,
Category = "UnitTextBox",
IsVisible = true,
IsEnabled = false,
Index = 1,
Localizable = true,
Description = "UnitTextBoxDoubleIsNotEnabled",
Tooltip = "UnitTextBoxDoubleIsNotEnabledToolTips"
)]
public Double UnitTextBoxDoubleIsNotEnabled { get; set; }
/// <summary>
/// Unit TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to 15.0 DUT_METERS.
/// The minimal value is set to 10 DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[UnitTextBox(
ValidateMinimumValue = true,
AttributeUnit = DisplayUnitType.DUT_METERS,
MinimumValue = 10,
Category = "UnitTextBox",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "UnitTextBoxDoubleMinValueSet",
Tooltip = "UnitTextBoxDoubleMinValueSetToolTips"
)]
public Double UnitTextBoxDoubleMinValueSet { get; set; }
/// <summary>
/// Unit TextBox supporting a double value.
/// The unit type is set to length (DUT_DECIMAL_FEET).
/// This value is stored in DUT_DECIMAL_FEET.
/// This value is initialized via the constructor to 100.0 DUT_DECIMAL_FEET.
/// The maximal value is set to 100 DUT_METERS.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_DECIMAL_FEET)]
[UnitTextBox(
ValidateMaximumValue = true,
MaximumValue = 100,
AttributeUnit = DisplayUnitType.DUT_METERS,
Category = "UnitTextBox",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Description = "UnitTextBoxDoubleMaxValueSet",
Tooltip = "UnitTextBoxDoubleMaxValueSetToolTips"
)]
public Double UnitTextBoxDoubleMaxValueSet { get; set; }
# endregion UnitTextBox
# region OtherTextBox
/// <summary>
/// TextBox supporting a XYZ value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to (5, 5, 5) DUT_METERS.
/// On the UI semi colomns as X;Y;Z separator
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[XYZTextBox(
Category = "XYZTextBox",
IsVisible = true,
IsEnabled = true,
Index = 4,
Localizable = true,
Description = "XYZTextBox",
Tooltip = "XYZTextBoxToolTips"
)]
public XYZ XYZTextBox { get; set; }
# endregion OtherTextBox
# region DefaultTextBox
/// <summary>
/// TextBox supporting a string value.
/// This value is initialized via the constructor to "A string for TextBoxString control".
/// </summary>
[SchemaProperty(FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 1,
Localizable = true,
Description = "TextBoxString",
Tooltip = "TextBoxStringToolTips"
)]
public String TextBoxString { get; set; }
/// <summary>
/// TextBox supporting an integer value (int16).
/// This value is initialized via the constructor to 2.
/// </summary>
[SchemaProperty(FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 2,
Localizable = true,
Description = "TextBoxInteger16",
Tooltip = "TextBoxInteger16ToolTips"
)]
public Int16 TextBoxInteger16 { get; set; }
/// <summary>
/// TextBox supporting an integer value (int32).
/// This value is initialized via the constructor to 2.
/// </summary>
[SchemaProperty(FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 3,
Localizable = true,
Description = "TextBoxInteger32",
Tooltip = "TextBoxInteger32ToolTips"
)]
public Int32 TextBoxInteger32 { get; set; }
/// <summary>
/// TextBox supporting a guid.
/// This value is initialized via the constructor to {00000000-0000-0000-0000-000000000000}.
/// </summary>
[SchemaProperty(FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 4,
Localizable = true,
Description = "TextBoxGuid",
Tooltip = "TextBoxGuidToolTips",
FieldFormat = typeof(ValueFormatGuid)
)]
public Guid TextBoxGuid { get; set; }
/// <summary>
/// TextBox supporting a boolean.
/// This value is initialized via the constructor to true.
/// </summary>
[SchemaProperty(FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 5,
Localizable = true,
Description = "TextBoxBoolean",
Tooltip = "TextBoxBooleanToolTips"
)]
public bool TextBoxBoolean { get; set; }
/// <summary>
/// TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// This value is initialized via the constructor to 25.0 DUT_METERS.
/// This value will be exposed on the UI based on Revit project units settings.
/// Revit project unit formatting won't be appled on the UI (use UnitTextBox to achieve this).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS, FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 6,
Localizable = true,
Description = "TextBoxDouble",
Tooltip = "TextBoxDoubleToolTips"
)]
public Double TextBoxDouble { get; set; }
/// <summary>
/// TextBox supporting a double value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// This value is initialized and calculated via the constructor in DUT_METERS.
/// This control is disabled on the UI.
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS, FieldName = "")]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = false,
Index = 7,
Localizable = true,
Description = "TextBoxDoubleCalculated",
Tooltip = "TextBoxDoubleCalculatedToolTips"
)]
public Double TextBoxDoubleCalculated { get; set; }
/// <summary>
/// TextBox supporting an ElementId.
/// This value is initialized to the active element.
/// </summary>
[SchemaProperty()]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 8,
Localizable = true,
Description = "TextBoxElementId",
Tooltip = "TextBoxElementIdToolTips",
FieldFormat = typeof(ValueFormatElementId)
)]
public ElementId TextBoxElementId { get; set; }
/// <summary>
/// TextBox supporting a UV value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to (5, 5) DUT_METERS.
/// On the UI the format is (U,V)
/// Revit project unit formatting won't be appled on the UI (use UnitTextBox to achieve this).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 9,
Localizable = true,
Description = "TextBoxUV",
Tooltip = "TextBoxUVToolTips",
FieldFormat = typeof(ValueFormatUV)
)]
public UV TextBoxUV { get; set; }
/// <summary>
/// TextBox supporting a XYZ value.
/// The unit type is set to length (DUT_METERS).
/// This value is stored in DUT_METERS.
/// this value is initialized via the constructor to (5, 5, 5) DUT_METERS.
/// On the UI the format is (X,Y,Z)
/// Revit project unit formatting won't be appled on the UI (use XYZTextBox to achieve this).
/// </summary>
[SchemaProperty(Unit = UnitType.UT_Length, DisplayUnit = DisplayUnitType.DUT_METERS)]
[TextBox(
Category = "DefaultTextBox",
IsVisible = true,
IsEnabled = true,
Index = 10,
Localizable = true,
Description = "TextBoxXYZ",
Tooltip = "TextBoxXYZToolTips",
FieldFormat = typeof(ValueFormatXYZ)
)]
public XYZ TextBoxXYZ { get; set; }
# endregion Default TextBox
}
}
@@ -0,0 +1,364 @@
//
// (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 System.Linq;
using System.Text;
using Autodesk.Revit.DB;
namespace ExtensibleStorageUI
{
//A serie of field formater classes
/// <summary>
/// UV field formater
/// </summary>
class ValueFormatUV:Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
return value.ToString();
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
if (!value.StartsWith("("))
return null;
if (!value.EndsWith(")"))
return null;
value = value.TrimStart('(');
value = value.TrimEnd(')');
string[] uv = value.Split(',');
if (uv.Length != 2)
return null;
double tempu;
double tempv;
if (!double.TryParse(uv[0], out tempu))
return null;
if (!double.TryParse(uv[1], out tempv))
return null;
return new UV(tempu, tempv);
}
}
/// <summary>
/// XYZ filed formater
/// </summary>
class ValueFormatXYZ : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
return value.ToString();
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
if (!value.StartsWith("("))
return null;
if (!value.EndsWith(")"))
return null;
value = value.TrimStart('(');
value = value.TrimEnd(')');
string[] xyz = value.Split(',');
if (xyz.Length != 3)
return null;
double tempx;
double tempy;
double tempz;
if (!double.TryParse(xyz[0], out tempx))
return null;
if (!double.TryParse(xyz[1], out tempy))
return null;
if (!double.TryParse(xyz[2], out tempz))
return null;
return new XYZ(tempx, tempy,tempz);
}
}
/// <summary>
/// Guid formater
/// </summary>
class ValueFormatGuid : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
return value.ToString();
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
Guid tempguid;
if (!Guid.TryParse(value, out tempguid))
return null;
return new Guid(value);
}
}
/// <summary>
/// ElementId formater
/// </summary>
class ValueFormatElementId : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
return value.ToString();
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
int tempid;
if(!int.TryParse(value, out tempid))
return null;
ElementId eid = new ElementId(tempid);
Element e = document.GetElement(eid);
if (e == null)
return null;
return eid;
}
}
/// <summary>
/// UV list formater
/// </summary>
class ValueFormatListUV : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
List<UV > uvs = value as List<UV>;
string tempstring = "";
for (int i=0; i < uvs.Count; i++)
{
tempstring += uvs[i].ToString();
tempstring += ";";
}
if (tempstring.EndsWith(";"))
tempstring = tempstring.TrimEnd(';');
return tempstring;
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
string[] uvmain = value.Split(';');
List<UV> uvs = new List<UV>();
for (int i = 0; i < uvmain.Length; i++)
{
if (!uvmain[i].StartsWith("("))
return null;
if (!uvmain[i].EndsWith(")"))
return null;
uvmain[i] = uvmain[i].TrimStart('(');
uvmain[i] = uvmain[i].TrimEnd(')');
string[] uv = uvmain[i].Split(',');
if (uv.Length != 2)
return null;
double tempu;
double tempv;
if (!double.TryParse(uv[0], out tempu))
return null;
if (!double.TryParse(uv[1], out tempv))
return null;
uvs.Add(new UV(tempu, tempv));
}
return uvs;
}
}
/// <summary>
/// XYZ list formater
/// </summary>
class ValueFormatListXYZ : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
List<XYZ> xyzs = value as List<XYZ>;
string tempstring = "";
for (int i = 0; i < xyzs.Count; i++)
{
tempstring += xyzs[i].ToString();
tempstring += ";";
}
if (tempstring.EndsWith(";"))
tempstring = tempstring.TrimEnd(';');
return tempstring;
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
string[] xyzmain = value.Split(';');
List<XYZ> xyzs = new List<XYZ>();
for (int i = 0; i < xyzmain.Length; i++)
{
if (!xyzmain[i].StartsWith("("))
return null;
if (!xyzmain[i].EndsWith(")"))
return null;
xyzmain[i] = xyzmain[i].TrimStart('(');
xyzmain[i] = xyzmain[i].TrimEnd(')');
string[] xyz = xyzmain[i].Split(',');
if (xyz.Length != 3)
return null;
double tempx;
double tempy;
double tempz;
if (!double.TryParse(xyz[0], out tempx))
return null;
if (!double.TryParse(xyz[1], out tempy))
return null;
if (!double.TryParse(xyz[2], out tempz))
return null;
xyzs.Add(new XYZ(tempx, tempy, tempz));
}
return xyzs;
}
}
/// <summary>
/// Guid list formater
/// </summary>
class ValueFormatListGuid : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
List<Guid> guids = value as List<Guid>;
string tempstring = "";
for (int i = 0; i < guids.Count; i++)
{
tempstring += guids[i].ToString();
tempstring += ";";
}
if (tempstring.EndsWith(";"))
tempstring = tempstring.TrimEnd(';');
return tempstring;
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
string[] guidmain = value.Split(';');
List<Guid> guids = new List<Guid>();
for (int i = 0; i < guidmain.Length; i++)
{
Guid tempguid;
if (!Guid.TryParse(guidmain[i].ToString(), out tempguid))
return null;
guids.Add(tempguid);
}
return guids;
}
}
/// <summary>
/// Element ID formater
/// </summary>
class ValueFormatListElementId : Autodesk.Revit.DB.ExtensibleStorage.Framework.IFieldFormat
{
public object Convert(object value, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputUnitType, Autodesk.Revit.DB.DisplayUnitType outputUnitType)
{
return value;
}
public string Format(object value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType inputDisplayUnitType, bool edit)
{
List<ElementId> elementids = value as List<ElementId>;
string tempstring = "";
for (int i = 0; i < elementids.Count; i++)
{
tempstring += elementids[i].ToString();
tempstring += ";";
}
if (tempstring.EndsWith(";"))
tempstring = tempstring.TrimEnd(';');
return tempstring;
}
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
{
string[] elementidmain = value.Split(';');
List<ElementId> elementids = new List<ElementId>();
for (int i = 0; i < elementidmain.Length; i++)
{
int tempid;
if (!int.TryParse(elementidmain[i].ToString() , out tempid))
return null;
ElementId eid = new ElementId(tempid);
Element e = document.GetElement(eid);
if (e == null)
return null;
elementids.Add(eid);
}
return elementids;
}
}
}
@@ -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.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.DB;
namespace ExtensibleStorageUI
{
// as serie of default value provider classes
public class XYZDefaultValueProvider:Autodesk.Revit.UI.ExtensibleStorage.Framework.IDefaultValueProvider
{
public object GetDefaultValue(object sender, Autodesk.Revit.UI.ExtensibleStorage.Framework.DefaultValueQueryEventArgs e)
{
return new Autodesk.Revit.DB.XYZ(1, 1, 1);
}
}
public class UVDefaultValueProvider : Autodesk.Revit.UI.ExtensibleStorage.Framework.IDefaultValueProvider
{
public object GetDefaultValue(object sender, Autodesk.Revit.UI.ExtensibleStorage.Framework.DefaultValueQueryEventArgs e)
{
return new Autodesk.Revit.DB.UV(1, 1);
}
}
public class GUIDDefaultValueProvider : Autodesk.Revit.UI.ExtensibleStorage.Framework.IDefaultValueProvider
{
public object GetDefaultValue(object sender, Autodesk.Revit.UI.ExtensibleStorage.Framework.DefaultValueQueryEventArgs e)
{
return new Guid("6AED35BD-9143-4AAB-B568-7FC69C946824");
}
}
public class Int16DefaultValueProvider : Autodesk.Revit.UI.ExtensibleStorage.Framework.IDefaultValueProvider
{
public object GetDefaultValue(object sender, Autodesk.Revit.UI.ExtensibleStorage.Framework.DefaultValueQueryEventArgs e)
{
Int16 int16 =2;
return int16 ;
}
}
}