mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-16 02:24:04 +00:00
copied Revit 2024 SDK
This commit is contained in:
+3
-5
@@ -337,19 +337,17 @@ namespace CodeCheckingConcreteExample.Engine
|
||||
Autodesk.Revit.DB.CodeChecking.Storage.Label ccLabel = storageDocument.LabelsManager.GetLabel(element);
|
||||
if (ccLabel != null)
|
||||
{
|
||||
Autodesk.Revit.DB.BuiltInCategory category = (Autodesk.Revit.DB.BuiltInCategory)element.Category.Id.IntegerValue;
|
||||
Autodesk.Revit.DB.BuiltInCategory category = element.Category.BuiltInCategory;
|
||||
StructuralAssetClass material = ccLabel.Material;
|
||||
|
||||
if (server.GetSupportedMaterials().Contains(material) &&
|
||||
server.GetSupportedCategories(material).Contains(category))
|
||||
{
|
||||
ElementId id = new ElementId(element.Id.IntegerValue);
|
||||
|
||||
SchemaClass label = EngineData.ReadElementLabel(category, material, ccLabel, data);
|
||||
ResultStatus status = new Autodesk.Revit.DB.CodeChecking.Storage.ResultStatus(Server.Server.ID, activePackageId);
|
||||
EngineData.VerifyElementLabel(category, material, label, ref status);
|
||||
|
||||
listElementId.Add(new Tuple<ElementId, ResultStatus>(id, status));
|
||||
listElementId.Add(new Tuple<ElementId, ResultStatus>(element.Id, status));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -378,7 +376,7 @@ namespace CodeCheckingConcreteExample.Engine
|
||||
Autodesk.Revit.DB.CodeChecking.Storage.Label ccLabel = storageDocument.LabelsManager.GetLabel(element);
|
||||
if (ccLabel != null)
|
||||
{
|
||||
Autodesk.Revit.DB.BuiltInCategory category = (Autodesk.Revit.DB.BuiltInCategory)element.Category.Id.IntegerValue;
|
||||
Autodesk.Revit.DB.BuiltInCategory category = element.Category.BuiltInCategory;
|
||||
StructuralAssetClass material = ccLabel.Material;
|
||||
Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass label = EngineData.ReadElementLabel(category, material, ccLabel, data);
|
||||
Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass result = EngineData.CreateElementResult(category, material);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ namespace CodeCheckingConcreteExample.Engine
|
||||
{
|
||||
category = elementCategory;
|
||||
material = elementMaterial;
|
||||
elemId = new ElementId(elementId.IntegerValue); ;
|
||||
elemId = elementId;
|
||||
label = elementLabel;
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -786,7 +786,5 @@ namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
}
|
||||
return forceTypes;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ namespace CodeCheckingConcreteExample.UIComponents.RCSteelParameters
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null && Material != null && value.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.MATERIAL_ID_PARAM).AsElementId().IntegerValue == Material.Id.IntegerValue)
|
||||
if (value != null && Material != null && value.get_Parameter(Autodesk.Revit.DB.BuiltInParameter.MATERIAL_ID_PARAM).AsElementId() == Material.Id)
|
||||
{
|
||||
_RebarBarType = value;
|
||||
BarDiameter = Autodesk.Revit.DB.UnitUtils.ConvertFromInternalUnits(value.BarDiameter, DisplayUnitType.DUT_METERS);
|
||||
|
||||
@@ -152,10 +152,9 @@ namespace ExtensibleStorageUI
|
||||
|
||||
public object Parse(string value, Autodesk.Revit.DB.Document document, Autodesk.Revit.DB.UnitType unitType, Autodesk.Revit.DB.DisplayUnitType outputDisplayUnitType)
|
||||
{
|
||||
int tempid;
|
||||
if(!int.TryParse(value, out tempid))
|
||||
ElementId eid;
|
||||
if(!ElementId.TryParse(value, out eid))
|
||||
return null;
|
||||
ElementId eid = new ElementId(tempid);
|
||||
|
||||
Element e = document.GetElement(eid);
|
||||
if (e == null)
|
||||
@@ -347,10 +346,9 @@ namespace ExtensibleStorageUI
|
||||
List<ElementId> elementids = new List<ElementId>();
|
||||
for (int i = 0; i < elementidmain.Length; i++)
|
||||
{
|
||||
int tempid;
|
||||
if (!int.TryParse(elementidmain[i].ToString() , out tempid))
|
||||
ElementId eid;
|
||||
if (!ElementId.TryParse(elementidmain[i].ToString() , out eid))
|
||||
return null;
|
||||
ElementId eid = new ElementId(tempid);
|
||||
|
||||
Element e = document.GetElement(eid);
|
||||
if (e == null)
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace SectionPropertiesExplorer
|
||||
|
||||
foreach (Autodesk.Revit.DB.Element el in commandData.Application.ActiveUIDocument.Selection.Elements)
|
||||
{
|
||||
Autodesk.Revit.DB.BuiltInCategory cat = (Autodesk.Revit.DB.BuiltInCategory)el.Category.Id.IntegerValue;
|
||||
Autodesk.Revit.DB.BuiltInCategory cat = el.Category.BuiltInCategory;
|
||||
|
||||
switch (cat)
|
||||
{
|
||||
|
||||
@@ -392,7 +392,7 @@ namespace SectionPropertiesExplorer
|
||||
public ElementEntry(Autodesk.Revit.DB.Element revitElement)
|
||||
{
|
||||
string elementDescription;
|
||||
Autodesk.Revit.DB.BuiltInCategory cat = (Autodesk.Revit.DB.BuiltInCategory)revitElement.Category.Id.IntegerValue;
|
||||
Autodesk.Revit.DB.BuiltInCategory cat = revitElement.Category.BuiltInCategory;
|
||||
switch (cat)
|
||||
{
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_StructuralColumns:
|
||||
|
||||
Reference in New Issue
Block a user