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
@@ -227,7 +227,7 @@ namespace Revit.SDK.Samples.RoutingPreferenceTools.CS
}
sBuilder.Remove(sBuilder.Length - 1, 1);
xSegmentNotCovered.Add(new XAttribute(XName.Get("sizes"), sBuilder.ToString()));
xSegmentNotCovered.Add(new XAttribute(XName.Get("unit"), m_document.GetUnits().GetFormatOptions(UnitType.UT_PipeSize).DisplayUnits.ToString()));
xSegmentNotCovered.Add(new XAttribute(XName.Get("unit"), m_document.GetUnits().GetFormatOptions(SpecTypeId.PipeSize).GetUnitTypeId().TypeId));
xSegmentNotCovered.Add(new XAttribute(XName.Get("groupType"), groupType.ToString()));
@@ -71,17 +71,17 @@ namespace Revit.SDK.Samples.RoutingPreferenceTools.CS
throw new RoutingPreferenceDataException("No pipe pipes defined in this project. At least one must be defined.");
FormatOptions formatOptionPipeSize = m_document.GetUnits().GetFormatOptions(UnitType.UT_PipeSize);
FormatOptions formatOptionPipeSize = m_document.GetUnits().GetFormatOptions(SpecTypeId.PipeSize);
string docPipeSizeUnit = formatOptionPipeSize.DisplayUnits.ToString();
string docPipeSizeUnit = formatOptionPipeSize.GetUnitTypeId().TypeId;
string xmlPipeSizeUnit = xDoc.Root.Attribute("pipeSizeUnits").Value;
if (docPipeSizeUnit != xmlPipeSizeUnit)
throw new RoutingPreferenceDataException("Units from XML do not match current pipe size units.");
FormatOptions formatOptionRoughness = m_document.GetUnits().GetFormatOptions(UnitType.UT_Piping_Roughness);
FormatOptions formatOptionRoughness = m_document.GetUnits().GetFormatOptions(SpecTypeId.PipingRoughness);
string docRoughnessUnit = formatOptionRoughness.DisplayUnits.ToString();
string docRoughnessUnit = formatOptionRoughness.GetUnitTypeId().TypeId;
string xmlRoughnessUnit = xDoc.Root.Attribute("pipeRoughnessUnits").Value;
if (docRoughnessUnit != xmlRoughnessUnit)
throw new RoutingPreferenceDataException("Units from XML do not match current pipe roughness units.");
@@ -186,12 +186,12 @@ namespace Revit.SDK.Samples.RoutingPreferenceTools.CS
XDocument routingPreferenceBuilderDoc = new XDocument();
XElement xroot = new XElement(XName.Get("RoutingPreferenceBuilder"));
FormatOptions formatOptionPipeSize = m_document.GetUnits().GetFormatOptions(UnitType.UT_PipeSize);
string unitStringPipeSize = formatOptionPipeSize.DisplayUnits.ToString();
FormatOptions formatOptionPipeSize = m_document.GetUnits().GetFormatOptions(SpecTypeId.PipeSize);
string unitStringPipeSize = formatOptionPipeSize.GetUnitTypeId().TypeId;
xroot.Add(new XAttribute(XName.Get("pipeSizeUnits"), unitStringPipeSize));
FormatOptions formatOptionRoughness = m_document.GetUnits().GetFormatOptions(UnitType.UT_Piping_Roughness);
string unitStringRoughness = formatOptionRoughness.DisplayUnits.ToString();
FormatOptions formatOptionRoughness = m_document.GetUnits().GetFormatOptions(SpecTypeId.PipingRoughness);
string unitStringRoughness = formatOptionRoughness.GetUnitTypeId().TypeId;
xroot.Add(new XAttribute(XName.Get("pipeRoughnessUnits"), unitStringRoughness));
foreach (FamilySymbol familySymbol in this.m_fittings)
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.RoutingPreferenceTools.CS</RootNamespace>
<AssemblyName>RoutingPreferenceTools</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@@ -60,8 +60,8 @@ namespace Revit.SDK.Samples.RoutingPreferenceTools.CS
{
public static double ConvertValueDocumentUnits(double decimalFeet, Autodesk.Revit.DB.Document document)
{
FormatOptions formatOption = document.GetUnits().GetFormatOptions(UnitType.UT_PipeSize);
return UnitUtils.ConvertFromInternalUnits(decimalFeet, formatOption.DisplayUnits);
FormatOptions formatOption = document.GetUnits().GetFormatOptions(SpecTypeId.PipeSize);
return UnitUtils.ConvertFromInternalUnits(decimalFeet, formatOption.GetUnitTypeId());
}