mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-10-02 07:04:00 +00:00
updated to Revit 2023 SDK
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -31,7 +30,6 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<CodeAnalysisRuleSet />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -40,8 +38,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>
|
||||
</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
@@ -51,8 +48,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>
|
||||
</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
m_levels.Clear();
|
||||
foreach (Level level in levels)
|
||||
{
|
||||
m_levels.Add(level.Id.IntegerValue.ToString(), level);
|
||||
m_levels.Add(level.Id.ToString(), level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
/// </summary>
|
||||
/// <param name="id">The id of the level</param>
|
||||
/// <returns>Returns a level which id equals the specified id.</returns>
|
||||
static public Level GetLevelByID(int id)
|
||||
static public Level GetLevelByID(ElementId id)
|
||||
{
|
||||
return m_levels[id.ToString()];
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
if (destinationType == typeof(String) && value is Level)
|
||||
{
|
||||
Level level = (Level)value;
|
||||
return level.Name + "[" + level.Id.IntegerValue.ToString() + "]";
|
||||
return level.Name + "[" + level.Id.ToString() + "]";
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
|
||||
@@ -122,14 +122,14 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
get
|
||||
{
|
||||
Parameter para = m_roof.get_Parameter(BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM);
|
||||
return LevelConverter.GetLevelByID(para.AsElementId().IntegerValue);
|
||||
return LevelConverter.GetLevelByID(para.AsElementId());
|
||||
}
|
||||
set
|
||||
{
|
||||
// update reference level
|
||||
Parameter para = m_roof.get_Parameter(BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM);
|
||||
Autodesk.Revit.DB.ElementId id = new Autodesk.Revit.DB.ElementId(value.Id.IntegerValue);
|
||||
para.Set(id);
|
||||
para.Set(value.Id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,11 +117,11 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
/// Get the id value of the model curve.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public int Id
|
||||
public ElementId Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_curve.Id.IntegerValue;
|
||||
return m_curve.Id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
get
|
||||
{
|
||||
Parameter para = m_roof.get_Parameter(BuiltInParameter.ROOF_BASE_LEVEL_PARAM);
|
||||
return LevelConverter.GetLevelByID(para.AsElementId().IntegerValue);
|
||||
return LevelConverter.GetLevelByID(para.AsElementId());
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
/// The construct of the RoofItem class.
|
||||
/// </summary>
|
||||
/// <param name="roof"></param>
|
||||
public RoofItem(Autodesk.Revit.DB.RoofBase roof) : base(roof.Id.IntegerValue.ToString())
|
||||
public RoofItem(Autodesk.Revit.DB.RoofBase roof) : base(roof.Id.ToString())
|
||||
{
|
||||
m_roof = roof;
|
||||
this.SubItems.Add(roof.Name);
|
||||
@@ -49,12 +49,12 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
if (m_roof is Autodesk.Revit.DB.FootPrintRoof)
|
||||
{
|
||||
Parameter para = roof.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.ROOF_BASE_LEVEL_PARAM);
|
||||
this.SubItems.Add(LevelConverter.GetLevelByID(para.AsElementId().IntegerValue).Name);
|
||||
this.SubItems.Add(LevelConverter.GetLevelByID(para.AsElementId()).Name);
|
||||
}
|
||||
else if (m_roof is Autodesk.Revit.DB.ExtrusionRoof)
|
||||
{
|
||||
Parameter para = roof.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM);
|
||||
this.SubItems.Add(LevelConverter.GetLevelByID(para.AsElementId().IntegerValue).Name);
|
||||
this.SubItems.Add(LevelConverter.GetLevelByID(para.AsElementId()).Name);
|
||||
}
|
||||
|
||||
this.SubItems.Add(roof.RoofType.Name);
|
||||
@@ -73,12 +73,12 @@ namespace Revit.SDK.Samples.NewRoof.RoofForms.CS
|
||||
if (m_roof is Autodesk.Revit.DB.FootPrintRoof)
|
||||
{
|
||||
Parameter para = m_roof.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.ROOF_BASE_LEVEL_PARAM);
|
||||
this.SubItems[2].Text = LevelConverter.GetLevelByID(para.AsElementId().IntegerValue).Name;
|
||||
this.SubItems[2].Text = LevelConverter.GetLevelByID(para.AsElementId()).Name;
|
||||
}
|
||||
else if (m_roof is Autodesk.Revit.DB.ExtrusionRoof)
|
||||
{
|
||||
Parameter para = m_roof.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM);
|
||||
this.SubItems[2].Text = LevelConverter.GetLevelByID(para.AsElementId().IntegerValue).Name;
|
||||
this.SubItems[2].Text = LevelConverter.GetLevelByID(para.AsElementId()).Name;
|
||||
}
|
||||
|
||||
this.SubItems[3].Text = m_roof.RoofType.Name;
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Revit.SDK.Samples.NewRoof.RoofsManager.CS
|
||||
{
|
||||
if (plane.Name == "Reference Plane")
|
||||
{
|
||||
plane.Name = "Reference Plane" + "(" + plane.Id.IntegerValue.ToString() + ")";
|
||||
plane.Name = "Reference Plane" + "(" + plane.Id.ToString() + ")";
|
||||
}
|
||||
m_referencePlanes.Add(plane);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user