mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-21 11:23:36 +00:00
updated to Revit 2023 SDK
This commit is contained in:
@@ -68,12 +68,12 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
get
|
||||
{
|
||||
Material material = CurrentMaterial as Material;
|
||||
int materialId = 0;
|
||||
ElementId materialId = new ElementId(0);
|
||||
if (material != null)
|
||||
{
|
||||
materialId = material.Id.IntegerValue;
|
||||
materialId = material.Id;
|
||||
}
|
||||
if (materialId <= 0)
|
||||
if (materialId.IntegerValue <= 0)
|
||||
{
|
||||
return StructuralAssetClass.Generic;
|
||||
}
|
||||
@@ -422,11 +422,11 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
if (null != m_cacheMaterial)
|
||||
return m_cacheMaterial;
|
||||
|
||||
int identityValue = 0;
|
||||
ElementId identityValue = new ElementId(0);
|
||||
if (m_currentMaterial != null)
|
||||
identityValue = m_currentMaterial.AsElementId().IntegerValue; //get the value of current material's ElementId
|
||||
identityValue = m_currentMaterial.AsElementId(); //get the value of current material's ElementId
|
||||
//material has no value
|
||||
if (identityValue <= 0)
|
||||
if (identityValue.IntegerValue <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -532,7 +532,7 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
}
|
||||
}
|
||||
//map between materials and their elementId
|
||||
m_allMaterialMap.Add(material.Id.IntegerValue, material);
|
||||
m_allMaterialMap.Add(material.Id, material);
|
||||
moreValue = i.MoveNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,13 +74,14 @@ Public Class MaterialProperties
|
||||
|
||||
ReadOnly Property CurrentType() As StructuralAssetClass
|
||||
Get
|
||||
Dim materialId As Integer = 0
|
||||
Dim materialId As Autodesk.Revit.DB.ElementId = New Autodesk.Revit.DB.ElementId(0)
|
||||
|
||||
|
||||
If Not m_currentMaterial Is Nothing Then
|
||||
materialId = m_currentMaterial.AsElementId().IntegerValue
|
||||
materialId = m_currentMaterial.AsElementId()
|
||||
End If
|
||||
|
||||
If materialId <= 0 Then
|
||||
If materialId.IntegerValue <= 0 Then
|
||||
Return StructuralAssetClass.Generic
|
||||
End If
|
||||
|
||||
@@ -366,14 +367,14 @@ Public Class MaterialProperties
|
||||
'get current material of selected component
|
||||
Private Function GetCurrentMaterial() As Autodesk.Revit.DB.Material
|
||||
'get the value of current material's ElementId
|
||||
Dim identityValue As Integer = 0
|
||||
Dim identityValue As Autodesk.Revit.DB.ElementId = New Autodesk.Revit.DB.ElementId(0)
|
||||
|
||||
If Not m_currentMaterial Is Nothing Then
|
||||
identityValue = m_currentMaterial.AsElementId().IntegerValue
|
||||
identityValue = m_currentMaterial.AsElementId()
|
||||
End If
|
||||
|
||||
'material has no value
|
||||
If (identityValue <= 0) Then
|
||||
If (identityValue.IntegerValue <= 0) Then
|
||||
Return Nothing
|
||||
End If
|
||||
Dim material As Autodesk.Revit.DB.Material = _
|
||||
@@ -467,7 +468,7 @@ Public Class MaterialProperties
|
||||
Case Else
|
||||
End Select
|
||||
'map between materials and their elementId
|
||||
m_allMaterialMap.Add(material.Id.IntegerValue, material)
|
||||
m_allMaterialMap.Add(material.Id, material)
|
||||
End If
|
||||
moreValue = i.MoveNext()
|
||||
End While
|
||||
|
||||
Reference in New Issue
Block a user