mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-30 08:32:50 +00:00
copied Revit 2024 SDK
This commit is contained in:
@@ -68,12 +68,12 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
get
|
||||
{
|
||||
Material material = CurrentMaterial as Material;
|
||||
ElementId materialId = new ElementId(0);
|
||||
ElementId materialId = ElementId.InvalidElementId;
|
||||
if (material != null)
|
||||
{
|
||||
materialId = material.Id;
|
||||
}
|
||||
if (materialId.IntegerValue <= 0)
|
||||
if (materialId == ElementId.InvalidElementId)
|
||||
{
|
||||
return StructuralAssetClass.Generic;
|
||||
}
|
||||
@@ -422,11 +422,11 @@ namespace Revit.SDK.Samples.MaterialProperties.CS
|
||||
if (null != m_cacheMaterial)
|
||||
return m_cacheMaterial;
|
||||
|
||||
ElementId identityValue = new ElementId(0);
|
||||
ElementId identityValue = ElementId.InvalidElementId;
|
||||
if (m_currentMaterial != null)
|
||||
identityValue = m_currentMaterial.AsElementId(); //get the value of current material's ElementId
|
||||
//material has no value
|
||||
if (identityValue.IntegerValue <= 0)
|
||||
if (identityValue == ElementId.InvalidElementId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
@@ -139,8 +139,8 @@
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.py"
|
||||
if exist %25FILEFORSAMPLEREG%25 py -3 %25FILEFORSAMPLEREG%25 "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
|
||||
@@ -72,30 +72,30 @@ Public Class MaterialProperties
|
||||
'arraylist of all materials belonging to concrete type
|
||||
Dim m_concretes As ArrayList = New ArrayList
|
||||
|
||||
ReadOnly Property CurrentType() As StructuralAssetClass
|
||||
Get
|
||||
Dim materialId As Autodesk.Revit.DB.ElementId = New Autodesk.Revit.DB.ElementId(0)
|
||||
ReadOnly Property CurrentType() As StructuralAssetClass
|
||||
Get
|
||||
Dim materialId As Autodesk.Revit.DB.ElementId = Autodesk.Revit.DB.ElementId.InvalidElementId
|
||||
|
||||
|
||||
If Not m_currentMaterial Is Nothing Then
|
||||
materialId = m_currentMaterial.AsElementId()
|
||||
End If
|
||||
If Not m_currentMaterial Is Nothing Then
|
||||
materialId = m_currentMaterial.AsElementId()
|
||||
End If
|
||||
|
||||
If materialId.IntegerValue <= 0 Then
|
||||
Return StructuralAssetClass.Generic
|
||||
End If
|
||||
If materialId = Autodesk.Revit.DB.ElementId.InvalidElementId Then
|
||||
Return StructuralAssetClass.Generic
|
||||
End If
|
||||
|
||||
Dim materialElem As Autodesk.Revit.DB.Material = _
|
||||
CType(m_allMaterialMap(materialId), Autodesk.Revit.DB.Material)
|
||||
Dim materialElem As Autodesk.Revit.DB.Material = _
|
||||
CType(m_allMaterialMap(materialId), Autodesk.Revit.DB.Material)
|
||||
|
||||
If Nothing Is materialElem Then
|
||||
Return StructuralAssetClass.Generic
|
||||
End If
|
||||
If Nothing Is materialElem Then
|
||||
Return StructuralAssetClass.Generic
|
||||
End If
|
||||
|
||||
Return GetMaterialType(materialElem)
|
||||
End Get
|
||||
Return GetMaterialType(materialElem)
|
||||
End Get
|
||||
|
||||
End Property
|
||||
End Property
|
||||
|
||||
'get the material attribute of selected element
|
||||
ReadOnly Property CurrentMaterial() As Object
|
||||
@@ -366,15 +366,15 @@ 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 Autodesk.Revit.DB.ElementId = New Autodesk.Revit.DB.ElementId(0)
|
||||
'get the value of current material's ElementId
|
||||
Dim identityValue As Autodesk.Revit.DB.ElementId = Autodesk.Revit.DB.ElementId.InvalidElementId
|
||||
|
||||
If Not m_currentMaterial Is Nothing Then
|
||||
identityValue = m_currentMaterial.AsElementId()
|
||||
End If
|
||||
|
||||
'material has no value
|
||||
If (identityValue.IntegerValue <= 0) Then
|
||||
If (identityValue = Autodesk.Revit.DB.ElementId.InvalidElementId) Then
|
||||
Return Nothing
|
||||
End If
|
||||
Dim material As Autodesk.Revit.DB.Material = _
|
||||
|
||||
@@ -145,8 +145,8 @@
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.py"
|
||||
if exist %25FILEFORSAMPLEREG%25 py -3 %25FILEFORSAMPLEREG%25 "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
|
||||
Reference in New Issue
Block a user