replaced Revit 2020 SDK by Revit 2021 SDK

This commit is contained in:
Jeremy Tammik
2020-05-11 14:07:56 +02:00
parent 06ba6e0541
commit 64f8b0ed3e
250 changed files with 1225 additions and 1496 deletions
Binary file not shown.
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="AddInManager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<AddInManager.Properties.Settings>
<setting name="AppFolder" serializeAs="String">
<value>Revit Add-In Manager 2021</value>
</setting>
</AddInManager.Properties.Settings>
</userSettings>
</configuration>
Binary file not shown.
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Assembly>[TARGETDIR]AddInManager.dll</Assembly>
<ClientId>8C0A9E25-B7C5-421c-A1AB-702F73FA551F</ClientId>
<FullClassName>AddInManager.CAddInManager</FullClassName>
<Text>Add-In Manager (Manual Mode)</Text>
<VisibilityMode>AlwaysVisible</VisibilityMode>
<LanguageType>Unknown</LanguageType>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
<AddIn Type="Command">
<Assembly>[TARGETDIR]AddInManager.dll</Assembly>
<ClientId>6FDB8EC7-CCD3-4fc0-ADB7-B459D298FB93</ClientId>
<FullClassName>AddInManager.CAddInManagerFaceless</FullClassName>
<Text>Add-In Manager (Manual Mode, Faceless)</Text>
<VisibilityMode>AlwaysVisible</VisibilityMode>
<LanguageType>Unknown</LanguageType>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
<AddIn Type="Command">
<Assembly>[TARGETDIR]AddInManager.dll</Assembly>
<ClientId>91A2419C-5FCA-491A-BAA3-29A497EC07C7</ClientId>
<FullClassName>AddInManager.CAddInManagerReadOnly</FullClassName>
<Text>Add-In Manager (ReadOnly Mode)</Text>
<VisibilityMode>AlwaysVisible</VisibilityMode>
<LanguageType>Unknown</LanguageType>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
</RevitAddIns>
@@ -0,0 +1,22 @@
Copyright (c) 2009, wyDay
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>APIAppStartup</RootNamespace>
<AssemblyName>APIAppStartup</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AddSpaceAndZone</RootNamespace>
<AssemblyName>AddSpaceAndZone</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+1 -1
View File
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DistanceToSurfaces</RootNamespace>
<AssemblyName>DistanceToSurfaces</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.MultithreadedCalculation.CS</RootNamespace>
<AssemblyName>MultithreadedCalculation</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SpatialFieldGradient</RootNamespace>
<AssemblyName>SpatialFieldGradient</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AnalyticalSupportData_Info</RootNamespace>
<AssemblyName>AnalyticalSupportData_Info</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -17,7 +12,7 @@
<AssemblyName>AppearanceAssetEditing</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -29,8 +24,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>
</DocumentationFile>
<DocumentationFile>bin\Debug\AppearanceAssetEditing.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -31,7 +31,7 @@
<MyType>Windows</MyType>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>AttachedDetailGroup</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -92,4 +86,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
+1 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoRoute</RootNamespace>
<AssemblyName>AutoRoute</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -9,7 +9,7 @@
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>AvoidObstruction</AssemblyName>
<RootNamespace>AvoidObstruction</RootNamespace>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -27,7 +27,7 @@
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -20,7 +20,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -44,7 +44,7 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>CapitalizeAllTextNotes</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -92,4 +86,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CompoundStructure</RootNamespace>
<AssemblyName>CompoundStructure</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -20,7 +20,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -27,7 +27,7 @@
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -30,7 +30,7 @@
<MyType>Windows</MyType>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>CreateFillPattern</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -37,113 +37,123 @@ using RvtView = Autodesk.Revit.DB.View;
namespace Revit.SDK.Samples.CreateFillPattern.CS
{
/// <summary>
///
/// </summary>
public partial class PatternForm : System.Windows.Forms.Form
{
/// <summary>
/// Current UI document
/// </summary>
UIDocument docUI;
/// <summary>
/// Current revit document
/// </summary>
Document doc;
/// <summary>
///
/// </summary>
public partial class PatternForm : System.Windows.Forms.Form
{
/// <summary>
/// Current UI document
/// </summary>
UIDocument docUI;
/// <summary>
/// Current revit document
/// </summary>
Document doc;
/// <summary>
/// Constructor
/// </summary>
public PatternForm(ExternalCommandData commandData)
{
docUI = commandData.Application.ActiveUIDocument;
doc = commandData.Application.ActiveUIDocument.Document;
InitializeComponent();
/// <summary>
/// Constructor
/// </summary>
public PatternForm(ExternalCommandData commandData)
{
docUI = commandData.Application.ActiveUIDocument;
doc = commandData.Application.ActiveUIDocument.Document;
InitializeComponent();
IniTreeView();
}
IniTreeView();
}
/// <summary>
/// Select all elements in current document with specified element type filter
/// </summary>
/// <typeparam name="T">Target element type</typeparam>
/// <returns>List of the elements</returns>
private List<T> GetAllElements<T>()
{
ElementClassFilter elementFilter = new ElementClassFilter(typeof(T));
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector = collector.WherePasses(elementFilter);
return collector.Cast<T>().ToList();
}
/// <summary>
/// Select all elements in current document with specified element type filter
/// </summary>
/// <typeparam name="T">Target element type</typeparam>
/// <returns>List of the elements</returns>
private List<T> GetAllElements<T>()
{
ElementClassFilter elementFilter = new ElementClassFilter(typeof(T));
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector = collector.WherePasses(elementFilter);
return collector.Cast<T>().ToList();
}
/// <summary>
/// Close the window after close button is clicked
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// Close the window after close button is clicked
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
/// <summary>
/// Initial nodes of treeviews
/// </summary>
private void IniTreeView()
{
this.treeViewLinePattern.Nodes.Clear();
TreeNode iniNode2 = new TreeNode("LinePatterns");
treeViewLinePattern.Nodes.Add(iniNode2);
/// <summary>
/// Initial nodes of treeviews
/// </summary>
private void IniTreeView()
{
this.treeViewLinePattern.Nodes.Clear();
TreeNode iniNode2 = new TreeNode("LinePatterns");
treeViewLinePattern.Nodes.Add(iniNode2);
List<LinePatternElement> lstLinePatterns = GetAllElements<LinePatternElement>();
for (int i = 0; i < lstLinePatterns.Count; i++)
{
TreeNode node = new TreeNode(lstLinePatterns[i].Name);
node.Name = lstLinePatterns[i].Id.IntegerValue.ToString();
iniNode2.Nodes.Add(node);
}
List<LinePatternElement> lstLinePatterns = GetAllElements<LinePatternElement>();
for (int i = 0; i < lstLinePatterns.Count; i++)
{
TreeNode node = new TreeNode(lstLinePatterns[i].Name);
node.Name = lstLinePatterns[i].Id.IntegerValue.ToString();
iniNode2.Nodes.Add(node);
}
this.treeViewFillPattern.Nodes.Clear();
TreeNode iniNode1 = new TreeNode("FillPatterns");
treeViewFillPattern.Nodes.Add(iniNode1);
this.treeViewFillPattern.Nodes.Clear();
TreeNode iniNode1 = new TreeNode("FillPatterns");
treeViewFillPattern.Nodes.Add(iniNode1);
List<FillPatternElement> lstFillPatterns = GetAllElements<FillPatternElement>();
for (int i = 0; i < lstFillPatterns.Count; i++)
{
TreeNode node = new TreeNode(lstFillPatterns[i].Name);
node.Name = i.ToString();
iniNode1.Nodes.Add(node);
}
}
List<FillPatternElement> lstFillPatterns = GetAllElements<FillPatternElement>();
for (int i = 0; i < lstFillPatterns.Count; i++)
{
TreeNode node = new TreeNode(lstFillPatterns[i].Name);
node.Name = i.ToString();
iniNode1.Nodes.Add(node);
}
}
/// <summary>
/// Create a fillpattern element
/// </summary>
/// <param name="patternName">The fillpattern name</param>
/// <returns>Created fillpattern element</returns>
private FillPatternElement CreateFacePattern(string patternName)
{
/// <summary>
/// Create a fillpattern element
/// </summary>
/// <param name="patternName">The fillpattern name</param>
/// <returns>Created fillpattern element</returns>
private FillPatternElement GetOrCreateFacePattern(string patternName)
{
FillPatternTarget target = FillPatternTarget.Model;
FillPatternElement fillPatternElement = FillPatternElement.GetFillPatternElementByName(doc, target, patternName);
if (fillPatternElement == null)
{
//Create a fillpattern with specified angle and spacing
FillPattern fillPattern = new FillPattern(patternName, FillPatternTarget.Model,
FillPattern fillPattern = new FillPattern(patternName, target,
FillPatternHostOrientation.ToView, 0.5, 0.5, 0.5);
Transaction trans = new Transaction(doc);
trans.Start("Create a fillpattern element");
FillPatternElement fillPatternElement = FillPatternElement.Create(doc, fillPattern);
fillPatternElement = FillPatternElement.Create(doc, fillPattern);
trans.Commit();
return fillPatternElement;
}
}
return fillPatternElement;
}
/// <summary>
/// Create a complex fillpattern element
/// </summary>
/// <param name="patternName">The fillpattern name</param>
/// <returns>Created fillpattern element</returns>
private FillPatternElement CreateComplexFacePattern(string patternName)
{
FillPatternElement fillPatternElement = null;
/// <summary>
/// Create a complex fillpattern element
/// </summary>
/// <param name="patternName">The fillpattern name</param>
/// <returns>Created fillpattern element</returns>
private FillPatternElement GetOrCreateComplexFacePattern(string patternName)
{
FillPatternTarget target = FillPatternTarget.Model;
FillPatternElement fillPatternElement = FillPatternElement.GetFillPatternElementByName(doc, target, patternName);
if (fillPatternElement == null)
{
// Create the fill pattern
FillPattern fillPattern = new FillPattern("API-created", FillPatternTarget.Model,
FillPattern fillPattern = new FillPattern(patternName, target,
FillPatternHostOrientation.ToHost);
// Add grids
@@ -165,304 +175,306 @@ namespace Revit.SDK.Samples.CreateFillPattern.CS
fillPatternElement = FillPatternElement.Create(doc, fillPattern);
t.Commit();
return fillPatternElement;
}
}
/// <summary>
/// Create a fillgrid
/// </summary>
/// <param name="origin"></param>
/// <param name="offset"></param>
/// <param name="angle"></param>
/// <param name="shift"></param>
/// <param name="segments"></param>
/// <returns></returns>
private FillGrid CreateGrid(UV origin, double offset, double angle,
double shift, params double[] segments)
{
FillGrid fillGrid = new FillGrid();
// The arguments: origin, offset (vertical distance between lines),
// angle, shift (delta between location of start point per line)
// The last two arguments are the segments: e.g. 1.0 units on,
// 0.1 units off (units are Revit units (ft))
fillGrid.Origin = origin;
fillGrid.Offset = offset;
fillGrid.Angle = angle;
fillGrid.Shift = shift;
List<double> segmentsList = new List<double>();
foreach (double d in segments)
{
segmentsList.Add(d);
}
fillGrid.SetSegments(segmentsList);
return fillPatternElement;
}
return fillGrid;
}
/// <summary>
/// Create a fillgrid
/// </summary>
/// <param name="origin"></param>
/// <param name="offset"></param>
/// <param name="angle"></param>
/// <param name="shift"></param>
/// <param name="segments"></param>
/// <returns></returns>
private FillGrid CreateGrid(UV origin, double offset, double angle,
double shift, params double[] segments)
{
FillGrid fillGrid = new FillGrid();
// The arguments: origin, offset (vertical distance between lines),
// angle, shift (delta between location of start point per line)
// The last two arguments are the segments: e.g. 1.0 units on,
// 0.1 units off (units are Revit units (ft))
fillGrid.Origin = origin;
fillGrid.Offset = offset;
fillGrid.Angle = angle;
fillGrid.Shift = shift;
List<double> segmentsList = new List<double>();
foreach (double d in segments)
{
segmentsList.Add(d);
}
fillGrid.SetSegments(segmentsList);
return fillGrid;
}
/// <summary>
/// Create a linepattern element
/// </summary>
/// <param name="patternName">The linepattern name</param>
/// <returns>Created linepattern element</returns>
private LinePatternElement CreateLinePatternElement(string patternName)
{
//Create list of segments which define the line pattern
List<LinePatternSegment> lstSegments = new List<LinePatternSegment>();
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Dot, 0.0));
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Space, 0.02));
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Dash, 0.03));
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Space, 0.02));
/// <summary>
/// Create a linepattern element
/// </summary>
/// <param name="patternName">The linepattern name</param>
/// <returns>Created linepattern element</returns>
private LinePatternElement CreateLinePatternElement(string patternName)
{
//Create list of segments which define the line pattern
List<LinePatternSegment> lstSegments = new List<LinePatternSegment>();
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Dot, 0.0));
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Space, 0.02));
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Dash, 0.03));
lstSegments.Add(new LinePatternSegment(LinePatternSegmentType.Space, 0.02));
LinePattern linePattern = new LinePattern(patternName);
linePattern.SetSegments(lstSegments);
LinePattern linePattern = new LinePattern(patternName);
linePattern.SetSegments(lstSegments);
Transaction trans = new Transaction(doc);
trans.Start("Create a linepattern element");
LinePatternElement linePatternElement = LinePatternElement.Create(doc, linePattern);
trans.Commit();
return linePatternElement;
}
Transaction trans = new Transaction(doc);
trans.Start("Create a linepattern element");
LinePatternElement linePatternElement = LinePatternElement.Create(doc, linePattern);
trans.Commit();
return linePatternElement;
}
/// <summary>
/// Create a fillpattern element and apply it to target material
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCreateFillPattern_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Create Fill Pattern",
"Before applying FillPattern to a wall's surfaces, you must firstly select a wall.");
this.Close();
return;
}
FillPatternElement mySurfacePattern = CreateFacePattern("MySurfacePattern");
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply fillpattern to surface");
targetMaterial.SurfaceForegroundPatternId = mySurfacePattern.Id;
trans.Commit();
/// <summary>
/// Create a fillpattern element and apply it to target material
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCreateFillPattern_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Create Fill Pattern",
"Before applying a FillPattern to a wall's surfaces, you must first select a wall.");
this.Close();
}
return;
}
/// <summary>
/// Create a linepattern element and apply it to grids
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCreateLinePattern_Click(object sender, EventArgs e)
{
List<ElementId> lstGridTypeIds = new List<ElementId>();
GetSelectedGridTypeIds(lstGridTypeIds);
if (lstGridTypeIds.Count == 0)
{
TaskDialog.Show("Apply To Grids",
"Before applying LinePattern to Grids, you must firstly select at least one grid.");
this.Close();
return;
}
FillPatternElement mySurfacePattern = GetOrCreateFacePattern("MySurfacePattern");
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply fillpattern to surface");
targetMaterial.SurfaceForegroundPatternId = mySurfacePattern.Id;
trans.Commit();
this.Close();
}
LinePatternElement myLinePatternElement = CreateLinePatternElement("MyLinePattern");
foreach (ElementId typeId in lstGridTypeIds)
{
Element gridType = doc.GetElement(typeId);
//set the parameter value of End Segment Pattern
SetParameter("End Segment Pattern", myLinePatternElement.Id, gridType);
}
/// <summary>
/// Create a linepattern element and apply it to grids
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCreateLinePattern_Click(object sender, EventArgs e)
{
List<ElementId> lstGridTypeIds = new List<ElementId>();
GetSelectedGridTypeIds(lstGridTypeIds);
if (lstGridTypeIds.Count == 0)
{
TaskDialog.Show("Apply To Grids",
"Before applying a LinePattern to Grids, you must first select at least one grid.");
this.Close();
}
return;
}
/// <summary>
/// Set a parameter value of a target element
/// </summary>
/// <param name="paramName">The parameter name</param>
/// <param name="eid">Id value of the parameter</param>
/// <param name="elem">Target element</param>
private void SetParameter(string paramName, ElementId eid, Element elem)
{
foreach (Parameter param in elem.Parameters)
LinePatternElement myLinePatternElement = CreateLinePatternElement("MyLinePattern");
foreach (ElementId typeId in lstGridTypeIds)
{
Element gridType = doc.GetElement(typeId);
//set the parameter value of End Segment Pattern
SetParameter("End Segment Pattern", myLinePatternElement.Id, gridType);
}
this.Close();
}
/// <summary>
/// Set a parameter value of a target element
/// </summary>
/// <param name="paramName">The parameter name</param>
/// <param name="eid">Id value of the parameter</param>
/// <param name="elem">Target element</param>
private void SetParameter(string paramName, ElementId eid, Element elem)
{
foreach (Parameter param in elem.Parameters)
{
if (param.Definition.Name == paramName)
{
if (param.Definition.Name == paramName)
{
Transaction trans = new Transaction(doc);
trans.Start("Set parameter value");
param.Set(eid);
trans.Commit();
break;
}
Transaction trans = new Transaction(doc);
trans.Start("Set parameter value");
param.Set(eid);
trans.Commit();
break;
}
}
/// <summary>
/// Apply fillpattern to surface
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonApplyToSurface_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Apply To Surface",
"Before applying FillPattern to a wall's surfaces, you must firstly select a wall.");
this.Close();
return;
}
if (treeViewFillPattern.SelectedNode == null || treeViewFillPattern.SelectedNode.Parent == null)
{
TaskDialog.Show("Apply To Surface",
"Before applying FillPattern to a wall's surfaces, you must firstly select one FillPattern.");
return;
}
List<FillPatternElement> lstPatterns = GetAllElements<FillPatternElement>();
int patternIndex = int.Parse(treeViewFillPattern.SelectedNode.Name);
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply fillpattern to surface");
targetMaterial.SurfaceForegroundPatternId = lstPatterns[patternIndex].Id;
trans.Commit();
}
}
/// <summary>
/// Apply fillpattern to surface
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonApplyToSurface_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Apply To Surface",
"Before applying a FillPattern to a wall's surfaces, you must first select a wall.");
this.Close();
}
return;
}
/// <summary>
/// Get a selected wall
/// </summary>
/// <returns>Selected wall</returns>
private Wall GetSelectedWall()
{
Wall wall = null;
foreach (ElementId elemId in docUI.Selection.GetElementIds())
{
Element elem = doc.GetElement(elemId);
wall = elem as Wall;
if (wall != null)
return wall;
}
return wall;
}
if (treeViewFillPattern.SelectedNode == null || treeViewFillPattern.SelectedNode.Parent == null)
{
TaskDialog.Show("Apply To Surface",
"Before applying a FillPattern to a wall's surfaces, you must first select one FillPattern.");
return;
}
/// <summary>
/// Apply fillpatterns to cutting surface
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonApplyToCutSurface_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Apply To CutSurface",
"Before applying FillPattern to a wall's cutting surfaces, you must firstly select a wall.");
this.Close();
return;
}
List<FillPatternElement> lstPatterns = GetAllElements<FillPatternElement>();
int patternIndex = int.Parse(treeViewFillPattern.SelectedNode.Name);
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply fillpattern to surface");
targetMaterial.SurfaceForegroundPatternId = lstPatterns[patternIndex].Id;
trans.Commit();
if (treeViewFillPattern.SelectedNode == null || treeViewFillPattern.SelectedNode.Parent == null)
{
TaskDialog.Show("Apply To CutSurface",
"Before applying FillPattern to a wall's cutting surfaces, you must firstly select one FillPattern.");
return;
}
this.Close();
}
List<FillPatternElement> lstPatterns = GetAllElements<FillPatternElement>();
int patternIndex = int.Parse(treeViewFillPattern.SelectedNode.Name);
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply fillpattern to cutting surface");
targetMaterial.CutForegroundPatternId = lstPatterns[patternIndex].Id;
trans.Commit();
/// <summary>
/// Get a selected wall
/// </summary>
/// <returns>Selected wall</returns>
private Wall GetSelectedWall()
{
Wall wall = null;
foreach (ElementId elemId in docUI.Selection.GetElementIds())
{
Element elem = doc.GetElement(elemId);
wall = elem as Wall;
if (wall != null)
return wall;
}
return wall;
}
/// <summary>
/// Apply fillpatterns to cutting surface
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonApplyToCutSurface_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Apply To CutSurface",
"Before applying a FillPattern to a wall's cut surfaces, you must first select a wall.");
this.Close();
}
return;
}
/// <summary>
/// Apply linepattern to grids
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonApplyToGrids_Click(object sender, EventArgs e)
{
List<ElementId> lstGridTypeIds = new List<ElementId>();
GetSelectedGridTypeIds(lstGridTypeIds);
if (lstGridTypeIds.Count == 0)
{
TaskDialog.Show("Apply To Grids",
"Before applying LinePattern to Grids, you must firstly select at least one grid.");
this.Close();
return;
}
if (treeViewFillPattern.SelectedNode == null || treeViewFillPattern.SelectedNode.Parent == null)
{
TaskDialog.Show("Apply To CutSurface",
"Before applying a FillPattern to a wall's cutting surfaces, you must first select a FillPattern.");
return;
}
if (treeViewLinePattern.SelectedNode == null || treeViewLinePattern.Parent == null)
{
TaskDialog.Show("Apply To Grids",
"Before applying LinePattern to Grids, you must firstly select a LinePattern.");
return;
}
ElementId eid = new ElementId(int.Parse(treeViewLinePattern.SelectedNode.Name));
foreach (ElementId typeId in lstGridTypeIds)
{
Element gridType = doc.GetElement(typeId);
//set the parameter value of End Segment Pattern
SetParameter("End Segment Pattern", eid, gridType);
}
List<FillPatternElement> lstPatterns = GetAllElements<FillPatternElement>();
int patternIndex = int.Parse(treeViewFillPattern.SelectedNode.Name);
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply fillpattern to cutting surface");
targetMaterial.CutForegroundPatternId = lstPatterns[patternIndex].Id;
trans.Commit();
this.Close();
}
/// <summary>
/// Apply linepattern to grids
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonApplyToGrids_Click(object sender, EventArgs e)
{
List<ElementId> lstGridTypeIds = new List<ElementId>();
GetSelectedGridTypeIds(lstGridTypeIds);
if (lstGridTypeIds.Count == 0)
{
TaskDialog.Show("Apply To Grids",
"Before applying a LinePattern to Grids, you must first select at least one grid.");
this.Close();
}
return;
}
/// <summary>
/// Get selected GridType Ids
/// </summary>
/// <param name="lstGridTypeIds">Selected GridType Ids</param>
private void GetSelectedGridTypeIds(List<ElementId> lstGridTypeIds)
{
foreach (ElementId elemId in docUI.Selection.GetElementIds())
{
Element elem = doc.GetElement(elemId);
Grid grid = elem as Grid;
if (grid != null)
{
ElementId gridTypeId = grid.GetTypeId();
if (!lstGridTypeIds.Contains(gridTypeId))
lstGridTypeIds.Add(gridTypeId);
}
}
}
if (treeViewLinePattern.SelectedNode == null || treeViewLinePattern.Parent == null)
{
TaskDialog.Show("Apply To Grids",
"Before applying a LinePattern to Grids, you must first select a LinePattern.");
return;
}
ElementId eid = new ElementId(int.Parse(treeViewLinePattern.SelectedNode.Name));
foreach (ElementId typeId in lstGridTypeIds)
{
Element gridType = doc.GetElement(typeId);
//set the parameter value of End Segment Pattern
SetParameter("End Segment Pattern", eid, gridType);
}
this.Close();
}
/// <summary>
/// To create a brick-like patternss
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCreateComplexFillPattern_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
/// <summary>
/// Get selected GridType Ids
/// </summary>
/// <param name="lstGridTypeIds">Selected GridType Ids</param>
private void GetSelectedGridTypeIds(List<ElementId> lstGridTypeIds)
{
foreach (ElementId elemId in docUI.Selection.GetElementIds())
{
Element elem = doc.GetElement(elemId);
Grid grid = elem as Grid;
if (grid != null)
{
TaskDialog.Show("Create Fill Pattern",
"Before applying FillPattern to a wall's surfaces, you must firstly select a wall.");
this.Close();
return;
ElementId gridTypeId = grid.GetTypeId();
if (!lstGridTypeIds.Contains(gridTypeId))
lstGridTypeIds.Add(gridTypeId);
}
}
}
FillPatternElement mySurfacePattern = CreateComplexFacePattern("MyComplexPattern");
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply complex fillpattern to surface");
targetMaterial.SurfaceForegroundPatternId = mySurfacePattern.Id;
trans.Commit();
/// <summary>
/// To create a brick-like patternss
/// </summary>
/// <param name="sender">This object</param>
/// <param name="e">A object contains the event data</param>
private void buttonCreateComplexFillPattern_Click(object sender, EventArgs e)
{
Wall targetWall = GetSelectedWall();
if (targetWall == null)
{
TaskDialog.Show("Create Fill Pattern",
"Before applying a FillPattern to a wall's surfaces, you must first select a wall.");
this.Close();
}
return;
}
private void PatternForm_Load(object sender, EventArgs e)
{
FillPatternElement mySurfacePattern = GetOrCreateComplexFacePattern("MyComplexPattern");
Material targetMaterial = doc.GetElement(targetWall.GetMaterialIds(false).First<ElementId>()) as Material;
Transaction trans = new Transaction(doc);
trans.Start("Apply complex fillpattern to surface");
targetMaterial.SurfaceForegroundPatternId = mySurfacePattern.Id;
trans.Commit();
this.Close();
}
}
}
private void PatternForm_Load(object sender, EventArgs e)
{
}
}
}
@@ -31,7 +31,7 @@
<MyType>Windows</MyType>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>CreateTrianglesTopography</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -80,4 +74,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -31,7 +31,7 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CreateWallinBeamProfile</RootNamespace>
<AssemblyName>CreateWallinBeamProfile</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.CurtainSystem.CS</RootNamespace>
<AssemblyName>CurtainSystem</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CurtainWallGrid</RootNamespace>
<AssemblyName>CurtainWallGrid</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -623,11 +623,10 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
Vector4 vec = new Vector4(xyz);
vec = m_coordinates.RestoreMatrix.Transform(vec);
offset = vec.Z - m_geometry.LineToBeMoved.FullCurve.GetEndPoint(0).Z;
offset = Unit.CovertFromAPI(m_myDocument.LengthUnitType, offset);
offset = Unit.CovertFromAPI(m_myDocument.LengthUnit, offset);
// showing the move offset
m_drawObject.Text = "Offset: " + Math.Round(offset, 1) +
Revit.SDK.Samples.CurtainWallGrid.CS.Properties.Resources.ResourceManager.GetString(m_myDocument.LengthUnitType.ToString());
m_drawObject.Text = "Offset: " + Math.Round(offset, 1) + Unit.GetUnitLabel(m_myDocument.LengthUnit);
m_drawObject.TextPosition = mousePosition;
m_drawObject.TextPen = redPen;
return;
@@ -653,11 +652,10 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
Vector4 vec = new Vector4(xyz);
vec = m_coordinates.RestoreMatrix.Transform(vec);
offset = vec.X - m_geometry.LineToBeMoved.FullCurve.GetEndPoint(0).X;
offset = Unit.CovertFromAPI(m_myDocument.LengthUnitType, offset);
offset = Unit.CovertFromAPI(m_myDocument.LengthUnit, offset);
// showing the move offset
m_drawObject.Text = "Offset: " + Math.Round(offset, 1) +
Revit.SDK.Samples.CurtainWallGrid.CS.Properties.Resources.ResourceManager.GetString(m_myDocument.LengthUnitType.ToString());
m_drawObject.Text = "Offset: " + Math.Round(offset, 1) + Unit.GetUnitLabel(m_myDocument.LengthUnit);
m_drawObject.TextPosition = mousePosition;
m_drawObject.TextPen = redPen;
}
+7 -7
View File
@@ -102,7 +102,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
LineOperation m_activeOperation;
// the length unit type for the active Revit document
DisplayUnitType m_LengthUnitType;
ForgeTypeId m_LengthUnit;
// store the message of the sample
private KeyValuePair<string/*msgText*/, bool/*is warningOrError*/> m_message;
@@ -199,11 +199,11 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
}
}
public DisplayUnitType LengthUnitType
public ForgeTypeId LengthUnit
{
get
{
return m_LengthUnitType;
return m_LengthUnit;
}
}
@@ -271,16 +271,16 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// </summary>
private void GetLengthUnitType()
{
UnitType unitType = UnitType.UT_Length;
ForgeTypeId specTypeId = SpecTypeId.Length;
Units projectUnit = m_document.GetUnits();
try
{
Autodesk.Revit.DB.FormatOptions formatOption = projectUnit.GetFormatOptions(unitType);
m_LengthUnitType = formatOption.DisplayUnits;
Autodesk.Revit.DB.FormatOptions formatOption = projectUnit.GetFormatOptions(specTypeId);
m_LengthUnit = formatOption.GetUnitTypeId();
}
catch (System.Exception /*e*/)
{
m_LengthUnitType = DisplayUnitType.DUT_DECIMAL_FEET;
m_LengthUnit = UnitTypeId.Feet;
}
}
@@ -8,8 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Revit.SDK.Samples.CurtainWallGrid.CS.Properties
{
namespace CurtainWallGrid.Properties {
using System;
@@ -20,7 +19,7 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS.Properties
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -60,77 +59,5 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS.Properties
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to cm.
/// </summary>
internal static string DUT_CENTIMETERS {
get {
return ResourceManager.GetString("DUT_CENTIMETERS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &apos;.
/// </summary>
internal static string DUT_DECIMAL_FEET {
get {
return ResourceManager.GetString("DUT_DECIMAL_FEET", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &quot;.
/// </summary>
internal static string DUT_DECIMAL_INCHES {
get {
return ResourceManager.GetString("DUT_DECIMAL_INCHES", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &apos;.
/// </summary>
internal static string DUT_FEET_FRACTIONAL_INCHES {
get {
return ResourceManager.GetString("DUT_FEET_FRACTIONAL_INCHES", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &quot;.
/// </summary>
internal static string DUT_FRACTIONAL_INCHES {
get {
return ResourceManager.GetString("DUT_FRACTIONAL_INCHES", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to m.
/// </summary>
internal static string DUT_METERS {
get {
return ResourceManager.GetString("DUT_METERS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to m.
/// </summary>
internal static string DUT_METERS_CENTIMETERS {
get {
return ResourceManager.GetString("DUT_METERS_CENTIMETERS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to mm.
/// </summary>
internal static string DUT_MILLIMETERS {
get {
return ResourceManager.GetString("DUT_MILLIMETERS", resourceCulture);
}
}
}
}
@@ -112,33 +112,9 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DUT_CENTIMETERS" xml:space="preserve">
<value>cm</value>
</data>
<data name="DUT_DECIMAL_FEET" xml:space="preserve">
<value>'</value>
</data>
<data name="DUT_DECIMAL_INCHES" xml:space="preserve">
<value>"</value>
</data>
<data name="DUT_FEET_FRACTIONAL_INCHES" xml:space="preserve">
<value>'</value>
</data>
<data name="DUT_FRACTIONAL_INCHES" xml:space="preserve">
<value>"</value>
</data>
<data name="DUT_METERS" xml:space="preserve">
<value>m</value>
</data>
<data name="DUT_METERS_CENTIMETERS" xml:space="preserve">
<value>m</value>
</data>
<data name="DUT_MILLIMETERS" xml:space="preserve">
<value>mm</value>
</data>
</root>
+35 -21
View File
@@ -38,10 +38,10 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
{
#region Methods
/// <summary>
/// Convert the value get from RevitAPI to the value indicated by DisplayUnitType
/// Convert the value get from RevitAPI to the value indicated by ForgeTypeId
/// </summary>
/// <param name="to">
/// DisplayUnitType indicates unit of target value
/// ForgeTypeId indicates unit of target value
/// </param>
/// <param name="value">
/// value get from RevitAPI
@@ -49,51 +49,65 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
/// <returns>
/// Target value
/// </returns>
public static double CovertFromAPI(DisplayUnitType to, double value)
public static double CovertFromAPI(ForgeTypeId to, double value)
{
return value *= ImperialDutRatio(to);
}
/// <summary>
/// Convert a value indicated by DisplayUnitType to the value used by RevitAPI
/// Convert a value indicated by ForgeTypeId to the value used by RevitAPI
/// </summary>
/// <param name="value">
/// Value to be converted
/// </param>
/// <param name="from">
/// DisplayUnitType indicates the unit of the value to be converted
/// ForgeTypeId indicates the unit of the value to be converted
/// </param>
/// <returns>
/// Target value
/// </returns>
public static double CovertToAPI(double value, DisplayUnitType from)
public static double CovertToAPI(double value, ForgeTypeId from)
{
return value /= ImperialDutRatio(from);
}
/// <summary>
/// Get ratio between value in RevitAPI and value to display indicated by DisplayUnitType
/// Get ratio between value in RevitAPI and value to display indicated by ForgeTypeId
/// </summary>
/// <param name="dut">
/// DisplayUnitType indicates display unit type
/// ForgeTypeId indicates display unit type
/// </param>
/// <returns>
/// Ratio
/// </returns>
private static double ImperialDutRatio(DisplayUnitType dut)
private static double ImperialDutRatio(ForgeTypeId unitTypeId)
{
switch (dut)
{
case DisplayUnitType.DUT_DECIMAL_FEET: return 1;
case DisplayUnitType.DUT_FEET_FRACTIONAL_INCHES: return 1;
case DisplayUnitType.DUT_DECIMAL_INCHES: return 12;
case DisplayUnitType.DUT_FRACTIONAL_INCHES: return 12;
case DisplayUnitType.DUT_METERS: return 0.3048;
case DisplayUnitType.DUT_CENTIMETERS: return 30.48;
case DisplayUnitType.DUT_MILLIMETERS: return 304.8;
case DisplayUnitType.DUT_METERS_CENTIMETERS: return 0.3048;
default: return 1;
}
if (unitTypeId == UnitTypeId.Feet) return 1;
if (unitTypeId == UnitTypeId.FeetFractionalInches) return 1;
if (unitTypeId == UnitTypeId.Inches) return 12;
if (unitTypeId == UnitTypeId.FractionalInches) return 12;
if (unitTypeId == UnitTypeId.Meters) return 0.3048;
if (unitTypeId == UnitTypeId.Centimeters) return 30.48;
if (unitTypeId == UnitTypeId.Millimeters) return 304.8;
if (unitTypeId == UnitTypeId.MetersCentimeters) return 0.3048;
return 1;
}
public static string GetUnitLabel(ForgeTypeId unitTypeId)
{
Dictionary<ForgeTypeId, string> unitLabels = new Dictionary<ForgeTypeId, string> {
{ UnitTypeId.Centimeters, "cm" },
{ UnitTypeId.Feet, "'" },
{ UnitTypeId.Inches, "\"" },
{ UnitTypeId.FeetFractionalInches, "'" },
{ UnitTypeId.FractionalInches, "\"" },
{ UnitTypeId.Meters, "m" },
{ UnitTypeId.MetersCentimeters, "m" },
{ UnitTypeId.Millimeters, "mm" }
};
if (unitLabels.ContainsKey(unitTypeId))
return unitLabels[unitTypeId];
return string.Empty;
}
#endregion
}
@@ -279,12 +279,13 @@ namespace Revit.SDK.Samples.CurtainWallGrid.CS
private void WriteCoordinate(Graphics graphics, Pen pen)
{
PointD assistPointD = ConvertToPointD(m_wallLine2D.AssistantPoint);
double x = Unit.CovertFromAPI(m_myDocument.LengthUnitType, assistPointD.X);
double y = Unit.CovertFromAPI(m_myDocument.LengthUnitType, assistPointD.Y);
double x = Unit.CovertFromAPI(m_myDocument.LengthUnit, assistPointD.X);
double y = Unit.CovertFromAPI(m_myDocument.LengthUnit, assistPointD.Y);
string xCoorString = Convert.ToString(Math.Round(x, 1));
string yCoorString = Convert.ToString(Math.Round(y, 1));
string unitType = Revit.SDK.Samples.CurtainWallGrid.CS.Properties.Resources.ResourceManager.GetString(m_myDocument.LengthUnitType.ToString());
string unitType = Unit.GetUnitLabel(m_myDocument.LengthUnit);
String coordinate = "(" + xCoorString + unitType + "," + yCoorString + unitType + ")";
graphics.DrawString(coordinate, m_coordinateFont, Brushes.Blue,
new PointF(m_wallLine2D.AssistantPoint.X + 2, m_wallLine2D.AssistantPoint.Y + 2));
+1 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.CurvedBeam.CS</RootNamespace>
<AssemblyName>CurvedBeam</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>Custom2DExporter</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>DatumsModification</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -133,4 +127,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeckProperties</RootNamespace>
<AssemblyName>DeckProperties</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -27,7 +27,7 @@
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -30,7 +30,7 @@
<MyType>Windows</MyType>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -44,7 +44,7 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>DimensionLeaderEnd</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
@@ -92,4 +86,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -30,7 +30,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>DisableCommand</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>DisplacementElementAnimation</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>DockableDialogs</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ChangesMonitor</RootNamespace>
<AssemblyName>ChangesMonitor</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
+1 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.DoorSwing.CS</RootNamespace>
<AssemblyName>DoorSwing</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>DuplicateGraphics</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -73,4 +67,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -12,7 +12,7 @@
<AssemblyName>DuplicateViews</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.DynamicModelUpdate.CS</RootNamespace>
<AssemblyName>DynamicModelUpdate</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -18,7 +18,7 @@
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ErrorHandling</RootNamespace>
<AssemblyName>ErrorHandling</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -30,7 +30,7 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoUpdate</RootNamespace>
<AssemblyName>AutoUpdate</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CancelSave</RootNamespace>
<AssemblyName>CancelSave</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.EventsMonitor.CS</RootNamespace>
<AssemblyName>EventsMonitor</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -25,7 +25,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.ProgressNotifier.CS</RootNamespace>
<AssemblyName>ProgressNotifier</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExtensibleStorageManager</RootNamespace>
<AssemblyName>ExtensibleStorageManager</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
@@ -111,12 +111,12 @@ namespace ExtensibleStorageManager
private static void SimpleSchemaAndData(SchemaWrapperTools.SchemaWrapper mySchemaWrapper, out Entity storageElementEntityWrite)
{
//Create some sample fields.
mySchemaWrapper.AddField<int>(int0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<short>(short0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<double>(double0Name, UnitType.UT_Length, null);
mySchemaWrapper.AddField<float>(float0Name, UnitType.UT_Length, null);
mySchemaWrapper.AddField<bool>(bool0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<string>(string0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<int>(int0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<short>(short0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<double>(double0Name, SpecTypeId.Length, null);
mySchemaWrapper.AddField<float>(float0Name, SpecTypeId.Length, null);
mySchemaWrapper.AddField<bool>(bool0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<string>(string0Name, new ForgeTypeId(), null);
//Generate the Autodesk.Revit.DB.ExtensibleStorage.Schema.
mySchemaWrapper.FinishSchema();
@@ -137,8 +137,8 @@ namespace ExtensibleStorageManager
//Set data in the entity.
storageElementEntityWrite.Set<int>(fieldInt0, 5);
storageElementEntityWrite.Set<short>(fieldShort0, 2);
storageElementEntityWrite.Set<double>(fieldDouble0, 7.1, DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set<float>(fieldFloat0, 3.1f, DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set<double>(fieldDouble0, 7.1, UnitTypeId.Meters);
storageElementEntityWrite.Set<float>(fieldFloat0, 3.1f, UnitTypeId.Meters);
storageElementEntityWrite.Set(fieldBool0, false);
storageElementEntityWrite.Set(fieldString0, "hello");
@@ -152,35 +152,35 @@ namespace ExtensibleStorageManager
private static void ComplexSchemaAndData(SchemaWrapperTools.SchemaWrapper mySchemaWrapper, Element storageElement, string xmlPathOut, Guid schemaId, AccessLevel readAccess, AccessLevel writeAccess, string vendorId, string applicationId, string name, string documentation, out Entity storageElementEntityWrite)
{
#region Add Fields to the SchemaWrapper
mySchemaWrapper.AddField<int>(int0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<short>(short0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<double>(double0Name, UnitType.UT_Length, null);
mySchemaWrapper.AddField<float>(float0Name, UnitType.UT_Length, null);
mySchemaWrapper.AddField<bool>(bool0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<string>(string0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<ElementId>(id0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<XYZ>(point0Name, UnitType.UT_Length, null);
mySchemaWrapper.AddField<UV>(uv0Name, UnitType.UT_Length, null);
mySchemaWrapper.AddField<Guid>(guid0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<int>(int0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<short>(short0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<double>(double0Name, SpecTypeId.Length, null);
mySchemaWrapper.AddField<float>(float0Name, SpecTypeId.Length, null);
mySchemaWrapper.AddField<bool>(bool0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<string>(string0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<ElementId>(id0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<XYZ>(point0Name, SpecTypeId.Length, null);
mySchemaWrapper.AddField<UV>(uv0Name, SpecTypeId.Length, null);
mySchemaWrapper.AddField<Guid>(guid0Name, new ForgeTypeId(), null);
//Note that we use IDictionary<> for map types and IList<> for array types
mySchemaWrapper.AddField<IDictionary<string, string>>(map0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<IList<bool>>(array0Name, UnitType.UT_Undefined, null);
mySchemaWrapper.AddField<IDictionary<string, string>>(map0Name, new ForgeTypeId(), null);
mySchemaWrapper.AddField<IList<bool>>(array0Name, new ForgeTypeId(), null);
//Create a sample subEntity
SchemaWrapperTools.SchemaWrapper mySubSchemaWrapper0 = SchemaWrapperTools.SchemaWrapper.NewSchema(subEntityGuid0, readAccess, writeAccess, vendorId, applicationId, entity0Name, "A sub entity");
mySubSchemaWrapper0.AddField<int>("subInt0", UnitType.UT_Undefined, null);
mySubSchemaWrapper0.AddField<int>("subInt0", new ForgeTypeId(), null);
mySubSchemaWrapper0.FinishSchema();
Entity subEnt0 = new Entity(mySubSchemaWrapper0.GetSchema());
subEnt0.Set<int>(mySubSchemaWrapper0.GetSchema().GetField("subInt0"), 11);
mySchemaWrapper.AddField<Entity>(entity0Name, UnitType.UT_Undefined, mySubSchemaWrapper0);
mySchemaWrapper.AddField<Entity>(entity0Name, new ForgeTypeId(), mySubSchemaWrapper0);
//
//Create a sample map of subEntities (An IDictionary<> with key type "int" and value type "Entity")
//
//Create a new sample schema.
SchemaWrapperTools.SchemaWrapper mySubSchemaWrapper1_Map = SchemaWrapperTools.SchemaWrapper.NewSchema(subEntityGuid_Map1, readAccess, writeAccess, vendorId, applicationId, map1Name, "A map of int to Entity");
mySubSchemaWrapper1_Map.AddField<int>("subInt1", UnitType.UT_Undefined, null);
mySubSchemaWrapper1_Map.AddField<int>("subInt1", new ForgeTypeId(), null);
mySubSchemaWrapper1_Map.FinishSchema();
//Create a new sample Entity.
Entity subEnt1 = new Entity(mySubSchemaWrapper1_Map.GetSchema());
@@ -188,7 +188,7 @@ namespace ExtensibleStorageManager
subEnt1.Set<int>(mySubSchemaWrapper1_Map.GetSchema().GetField("subInt1"), 22);
//Add a new map field to the top-level Schema. We will add the entity we just created after all top-level
//fields are created.
mySchemaWrapper.AddField<IDictionary<int, Entity>>(map1Name, UnitType.UT_Undefined, mySubSchemaWrapper1_Map);
mySchemaWrapper.AddField<IDictionary<int, Entity>>(map1Name, new ForgeTypeId(), mySubSchemaWrapper1_Map);
@@ -198,7 +198,7 @@ namespace ExtensibleStorageManager
//
//Create a new sample schema
SchemaWrapperTools.SchemaWrapper mySubSchemaWrapper2_Array = SchemaWrapperTools.SchemaWrapper.NewSchema(subEntityGuid_Array2, readAccess, writeAccess, vendorId, applicationId, array1Name, "An array of Entities");
mySubSchemaWrapper2_Array.AddField<int>("subInt2", UnitType.UT_Undefined, null);
mySubSchemaWrapper2_Array.AddField<int>("subInt2", new ForgeTypeId(), null);
mySubSchemaWrapper2_Array.FinishSchema();
//Create a new sample Entity.
Entity subEnt2 = new Entity(mySubSchemaWrapper2_Array.GetSchema());
@@ -206,7 +206,7 @@ namespace ExtensibleStorageManager
subEnt2.Set<int>(mySubSchemaWrapper2_Array.GetSchema().GetField("subInt2"), 33);
//Add a new array field to the top-level Schema We will add the entity we just crated after all top-level fields
//are created.
mySchemaWrapper.AddField<IList<Entity>>(array1Name, UnitType.UT_Undefined, mySubSchemaWrapper2_Array);
mySchemaWrapper.AddField<IList<Entity>>(array1Name, new ForgeTypeId(), mySubSchemaWrapper2_Array);
#endregion
@@ -251,15 +251,15 @@ namespace ExtensibleStorageManager
storageElementEntityWrite.Set<int>(fieldInt0, 5);
storageElementEntityWrite.Set<short>(fieldShort0, 2);
storageElementEntityWrite.Set<double>(fieldDouble0, 7.1, DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set<float>(fieldFloat0, 3.1f, DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set<double>(fieldDouble0, 7.1, UnitTypeId.Meters);
storageElementEntityWrite.Set<float>(fieldFloat0, 3.1f, UnitTypeId.Meters);
storageElementEntityWrite.Set(fieldBool0, false);
storageElementEntityWrite.Set(fieldString0, "hello");
storageElementEntityWrite.Set(fieldId0, storageElement.Id);
storageElementEntityWrite.Set(fieldPoint0, new XYZ(1, 2, 3), DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set(fieldUv0, new UV(1, 2), DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set(fieldPoint0, new XYZ(1, 2, 3), UnitTypeId.Meters);
storageElementEntityWrite.Set(fieldUv0, new UV(1, 2), UnitTypeId.Meters);
storageElementEntityWrite.Set(fieldGuid0, new Guid("D8301329-F207-43B8-8AA1-634FD344F350"));
//Note that we must pass an IDictionary<>, not a Dictionary<> to Set().
@@ -361,8 +361,8 @@ namespace ExtensibleStorageManager
storageElementEntityWrite.Set<int>(fieldInt0, 10);
storageElementEntityWrite.Set<short>(fieldShort0, 20);
storageElementEntityWrite.Set<double>(fieldDouble0, 14.2, DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set<float>(fieldFloat0, 6.12f, DisplayUnitType.DUT_METERS);
storageElementEntityWrite.Set<double>(fieldDouble0, 14.2, UnitTypeId.Meters);
storageElementEntityWrite.Set<float>(fieldFloat0, 6.12f, UnitTypeId.Meters);
storageElementEntityWrite.Set(fieldBool0, true);
storageElementEntityWrite.Set(fieldString0, "goodbye");
//Set the entity back into the storage element.
@@ -52,8 +52,8 @@ namespace SchemaWrapperTools
/// </summary>
/// <param name="name">The name of the field</param>
/// <param name="typeIn">The AssemblyQualifiedName of the Field's data type</param>
/// <param name="unit">The unit type of the Field (set to UT_Undefined for non-floating point types</param>
public FieldData(string name, string typeIn, UnitType unit) : this(name, typeIn, unit, null)
/// <param name="spec">The unit type of the Field (set to UT_Undefined for non-floating point types</param>
public FieldData(string name, string typeIn, ForgeTypeId spec) : this(name, typeIn, spec, null)
{
}
@@ -63,13 +63,13 @@ namespace SchemaWrapperTools
/// </summary>
/// <param name="name">The name of the field</param>
/// <param name="typeIn">The AssemblyQualifiedName of the Field's data type</param>
/// <param name="unit">The unit type of the Field (set to UT_Undefined for non-floating point types</param>
/// <param name="spec">The unit type of the Field (set to UT_Undefined for non-floating point types</param>
/// <param name="subSchema">The SchemaWrapper of the field's subSchema, if the field is of type "Entity"</param>
public FieldData(string name, string typeIn, UnitType unit, SchemaWrapper subSchema)
public FieldData(string name, string typeIn, ForgeTypeId spec, SchemaWrapper subSchema)
{
m_Name = name;
m_Type = typeIn;
m_Unit = unit;
m_Spec = spec;
m_SubSchema = subSchema;
}
#endregion
@@ -83,7 +83,7 @@ namespace SchemaWrapperTools
strBuilder.Append(", ");
strBuilder.Append(Type);
strBuilder.Append(", ");
strBuilder.Append(Unit.ToString());
strBuilder.Append(Spec.TypeId);
if (SubSchema != null)
@@ -116,10 +116,10 @@ namespace SchemaWrapperTools
/// <summary>
/// The Unit type of the field
/// </summary>
public UnitType Unit
public ForgeTypeId Spec
{
get { return m_Unit; }
set { m_Unit = value; }
get { return m_Spec; }
set { m_Spec = value; }
}
/// <summary>
@@ -136,7 +136,7 @@ namespace SchemaWrapperTools
private SchemaWrapper m_SubSchema;
private string m_Name;
private string m_Type;
private UnitType m_Unit;
private ForgeTypeId m_Spec;
#endregion
}
@@ -76,11 +76,11 @@ namespace SchemaWrapperTools
/// </summary>
/// <param name="name">the name of the field</param>
/// <param name="typeIn">the data type of the field</param>
/// <param name="unit">The unit type of the Field (set to UT_Undefined for non-floating point types</param>
/// <param name="spec">The unit type of the Field (set to UT_Undefined for non-floating point types</param>
/// <param name="subSchema">The SchemaWrapper of the field's subSchema, if the field is of type "Entity"</param>
public void AddData(string name, System.Type typeIn, UnitType unit, SchemaWrapper subSchema)
public void AddData(string name, System.Type typeIn, ForgeTypeId spec, SchemaWrapper subSchema)
{
m_DataList.Add(new FieldData(name, typeIn.FullName, unit, subSchema));
m_DataList.Add(new FieldData(name, typeIn.FullName, spec, subSchema));
}
#endregion
@@ -65,7 +65,7 @@ namespace SchemaWrapperTools
//then query the field data types from the field and instantiate a new generic method with those types as parameters.
//Get the "AddField" method.
MethodInfo addFieldmethod = typeof(SchemaWrapper).GetMethod("AddField", new Type[] { typeof(string), typeof(UnitType), typeof(SchemaWrapper) });
MethodInfo addFieldmethod = typeof(SchemaWrapper).GetMethod("AddField", new Type[] { typeof(string), typeof(ForgeTypeId), typeof(SchemaWrapper) });
Type[] methodGenericParameters = null;
//Get the generic type parameters. The type will either be a single type, an IList<> of a single type, or an IDictionary<> of a key type and a value type.
@@ -87,7 +87,7 @@ namespace SchemaWrapperTools
swSub = SchemaWrapper.FromSchema(subSchema);
}
//Invoke the "AddField" method with the generic parameters from the current field.
genericAddFieldMethodInstantiated.Invoke(swReturn, new object[] { currentField.FieldName, currentField.UnitType, swSub });
genericAddFieldMethodInstantiated.Invoke(swReturn, new object[] { currentField.FieldName, currentField.GetSpecTypeId(), swSub });
}
//Note that we don't call SchemaWrapper.FinishSchema here.
//The Autodesk.Revit.DB.ExtensibleStorage.Schema object already exists and is registered -- we're just populating the outer wrapper.
@@ -161,11 +161,11 @@ namespace SchemaWrapperTools
/// </summary>
/// <typeparam name="TypeName">Currently supported types: int, short, float, double, bool, string, ElementId, XYZ, UV, Guid, Entity, IDictionary<>, IList<>. IDictionary<> does not support floating point types, XYZ, UV, or Entity as Key parameters.</typeparam>
/// <param name="name">The name of the field</param>
/// <param name="unit">The unit type of the field. Defintion required for floating point, XYZ, and UV types</param>
/// <param name="spec">The unit type of the field. Defintion required for floating point, XYZ, and UV types</param>
/// <param name="subSchema">A subSchemaWrapper, if the field is of type Entity</param>
public void AddField<TypeName>(string name, UnitType unit, SchemaWrapper subSchema)
public void AddField<TypeName>(string name, ForgeTypeId spec, SchemaWrapper subSchema)
{
m_SchemaDataWrapper.AddData(name, typeof(TypeName), unit, subSchema);
m_SchemaDataWrapper.AddData(name, typeof(TypeName), spec, subSchema);
}
/// <summary>
@@ -254,8 +254,8 @@ namespace SchemaWrapperTools
currentFieldData.SubSchema.FinishSchema(); //Recursively create the schema for the subSchema.
}
if (currentFieldData.Unit != UnitType.UT_Undefined)
currentFieldBuilder.SetUnitType(currentFieldData.Unit);
if (!currentFieldData.Spec.Empty())
currentFieldBuilder.SetSpec(currentFieldData.Spec);
}
//Set all the top level data in the schema we are generating.
@@ -373,7 +373,7 @@ namespace SchemaWrapperTools
{
string fieldName = field.FieldName;
System.Type fieldType = field.ValueType;
UnitType fieldUnit = field.UnitType;
ForgeTypeId fieldUnit = field.GetSpecTypeId();
ContainerType fieldContainerType = field.ContainerType;
Type[] methodGenericParameters = null;
object[] invokeParams = null;
@@ -385,15 +385,15 @@ namespace SchemaWrapperTools
else //map
methodGenericParameters = new Type[] { typeof(IDictionary<int, int>).GetGenericTypeDefinition().MakeGenericType(new Type[] { field.KeyType, field.ValueType }) };
if (fieldUnit == UnitType.UT_Undefined)
if (fieldUnit.Empty())
{
methodOverloadSelectionParams = new Type[] { typeof(Field) };
invokeParams = new object[] { field };
}
else
{
methodOverloadSelectionParams = new Type[] { typeof(Field), typeof(DisplayUnitType) };
invokeParams = new object[] { field, DisplayUnitType.DUT_METERS };
methodOverloadSelectionParams = new Type[] { typeof(Field), typeof(ForgeTypeId) };
invokeParams = new object[] { field, UnitTypeId.Meters };
}
MethodInfo instantiatedGenericGetMethod = entity.GetType().GetMethod("Get", methodOverloadSelectionParams).MakeGenericMethod(methodGenericParameters);
@@ -403,13 +403,13 @@ namespace SchemaWrapperTools
if (fieldType == typeof(Entity))
{
Schema subSchema = Schema.Lookup(field.SubSchemaGUID);
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {SubEntity} " + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {SubEntity} " + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
DumpAllSchemaEntityData<FieldType>(retval, subSchema, strBuilder);
}
else
{
string sRetval = retval.ToString();
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + retval + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + retval + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
}
}
else if (field.ContainerType == ContainerType.Array)
@@ -417,7 +417,7 @@ namespace SchemaWrapperTools
IList<FieldType> listRetval = (IList<FieldType>)instantiatedGenericGetMethod.Invoke(entity, invokeParams);
if (fieldType == (typeof(Entity)))
{
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {SubEntity} " + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {SubEntity} " + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
foreach (FieldType fa in listRetval)
{
@@ -427,7 +427,7 @@ namespace SchemaWrapperTools
}
else
{
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {Array} " + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {Array} " + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
foreach (FieldType fa in listRetval)
{
strBuilder.AppendLine(" Array value: " + fa.ToString());
@@ -436,11 +436,11 @@ namespace SchemaWrapperTools
}
else //Map
{
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {Map} " + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {Map} " + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
IDictionary<KeyType, FieldType> mapRetval = (IDictionary<KeyType, FieldType>)instantiatedGenericGetMethod.Invoke(entity, invokeParams);
if (fieldType == (typeof(Entity)))
{
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {SubEntity} " + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {SubEntity} " + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
foreach (FieldType fa in mapRetval.Values)
{
strBuilder.Append(" Map Value: ");
@@ -449,7 +449,7 @@ namespace SchemaWrapperTools
}
else
{
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {Map} " + ", Unit: " + field.UnitType.ToString() + ", ContainerType: " + field.ContainerType.ToString());
strBuilder.AppendLine("Field: " + field.FieldName + ", Type: " + field.ValueType.ToString() + ", Value: " + " {Map} " + ", Unit: " + field.GetSpecTypeId().TypeId + ", ContainerType: " + field.ContainerType.ToString());
foreach (FieldType fa in mapRetval.Values)
{
strBuilder.AppendLine(" Map value: " + fa.ToString());
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SchemaWrapperTools</RootNamespace>
<AssemblyName>SchemaWrapperTools</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -54,7 +54,7 @@ namespace Revit.SDK.Samples.ExtensibleStorageUtility.CS
foreach (Schema schema in schemas)
{
//Note-this will delete storage of this schema in *all* open documents.
Schema.EraseSchemaAndAllEntities(schema, true);
document.EraseSchemaAndAllEntities(schema);
}
tErase.Commit();
message = "All storage was deleted.";
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExtensibleStorageUtility</RootNamespace>
<AssemblyName>ExtensibleStorageUtility</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExternalCommandRegistration</RootNamespace>
<AssemblyName>ExternalCommandRegistration</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RevitAddInUtilitySample</RootNamespace>
<AssemblyName>RevitAddInUtilitySample</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
@@ -12,7 +12,7 @@
<AssemblyName>ExternalResourceDBServer</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>ExternalResourceUIServer</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -18,7 +12,7 @@
<AssemblyName>FabricationPartLayout</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -109,4 +103,4 @@
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -139,7 +139,7 @@ namespace Revit.SDK.Samples.FabricationPartLayout.CS
builder.AppendLine("Specification: " + spec);
// centerline length
builder.AppendLine("Centerline Length: " + GetStringFromNumber(doc, part.CenterlineLength, UnitType.UT_Length));
builder.AppendLine("Centerline Length: " + GetStringFromNumber(doc, part.CenterlineLength, SpecTypeId.Length));
TaskDialog.Show("Fabrication Part [" + part.Id.IntegerValue + "]", builder.ToString());
@@ -152,9 +152,9 @@ namespace Revit.SDK.Samples.FabricationPartLayout.CS
}
}
private string GetStringFromNumber(Document doc, double number, UnitType unitType)
private string GetStringFromNumber(Document doc, double number, ForgeTypeId specTypeId)
{
return UnitFormatUtils.Format(doc.GetUnits(), unitType, number, true, false);
return UnitFormatUtils.Format(doc.GetUnits(), specTypeId, number, false);
}
}
}
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoJoin</RootNamespace>
<AssemblyName>AutoJoin</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AutoParameter</RootNamespace>
<AssemblyName>AutoParameter</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -11,7 +11,7 @@
<RootNamespace>CreateAirHandler</RootNamespace>
<AssemblyName>CreateAirHandler</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -34,7 +34,7 @@
</StartupObject>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.ImportExport.CS</RootNamespace>
<AssemblyName>DWGFamilyCreation</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -30,7 +30,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -11,7 +11,7 @@
<RootNamespace>TypeRegeneration</RootNamespace>
<AssemblyName>TypeRegeneration</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -11,7 +11,7 @@
<RootNamespace>ValidateParameters</RootNamespace>
<AssemblyName>ValidateParameters</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -13,7 +13,7 @@
<FileAlignment>512</FileAlignment>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -12,7 +12,7 @@
<AssemblyName>FamilyParametersOrder</AssemblyName>
<StartupObject>
</StartupObject>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

Some files were not shown because too many files have changed in this diff Show More