mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-30 00:23:01 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's beam element.
|
||||
/// </summary>
|
||||
public class BeamElement : ElementDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's beam object.
|
||||
/// </summary>
|
||||
/// <param name="elementDataBase">Instance of base element object with predefined parameters to copy.</param>
|
||||
public BeamElement(ElementDataBase elementDataBase)
|
||||
: base(elementDataBase)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets cref="ElementInfo" object.
|
||||
/// </summary>
|
||||
public ElementInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.CodeChecking.Concrete;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using CodeCheckingConcreteExample.Concrete;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's section of a beam element.
|
||||
/// </summary>
|
||||
class BeamSection : LinearSection
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's section object of beam element.
|
||||
/// </summary>
|
||||
/// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
|
||||
public BeamSection(SectionDataBase sectionDataBase)
|
||||
: base(sectionDataBase)
|
||||
{
|
||||
Width = 0.0;
|
||||
Height = 0.0;
|
||||
Geometry = new Geometry();
|
||||
IsTSection = false;
|
||||
|
||||
ListInternalForces = new List<InternalForcesBase>();
|
||||
MinStiffness = 0.0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// gets and sets flag for T-shape section.
|
||||
/// </summary>
|
||||
public bool IsTSection { get; set; }
|
||||
}
|
||||
}
|
||||
+1181
File diff suppressed because it is too large
Load Diff
+136
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's calculation scenario.
|
||||
/// </summary>
|
||||
public class CalculationScenario : ICalculationScenario
|
||||
{
|
||||
|
||||
#region ICalculationScenario Members
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of cref="ICalculationObject".
|
||||
/// </summary>
|
||||
/// <param name="category">Category of the element.</param>
|
||||
/// <param name="material">Material of the element.</param>
|
||||
/// <returns>List of cref="ICalculationObject".</returns>
|
||||
public List<ICalculationObject> CalculationScenarioList(Autodesk.Revit.DB.BuiltInCategory category, Autodesk.Revit.DB.StructuralAssetClass material)
|
||||
{
|
||||
List<ICalculationObject> scenario = new List<ICalculationObject>();
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
switch (material)
|
||||
{
|
||||
case StructuralAssetClass.Concrete:
|
||||
switch (category)
|
||||
{
|
||||
case BuiltInCategory.OST_BeamAnalytical:
|
||||
case BuiltInCategory.OST_ColumnAnalytical:
|
||||
{
|
||||
PrepareSectionData calcObj = new PrepareSectionData();
|
||||
calcObj.Type = CalculationObjectType.Section;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_BeamAnalytical, BuiltInCategory.OST_ColumnAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
ModifyElementForces calcObj = new ModifyElementForces();
|
||||
calcObj.Type = CalculationObjectType.Element;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_BeamAnalytical, BuiltInCategory.OST_ColumnAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
CalculateSection calcObj = new CalculateSection();
|
||||
calcObj.Type = CalculationObjectType.Section;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_BeamAnalytical, BuiltInCategory.OST_ColumnAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
CalculateDeflection calcObj = new CalculateDeflection();
|
||||
calcObj.Type = CalculationObjectType.Element;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_BeamAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
FillResultData calcObj = new FillResultData();
|
||||
calcObj.Type = CalculationObjectType.Element;
|
||||
calcObj.ErrorResponse = ErrorResponse.RunOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_BeamAnalytical, BuiltInCategory.OST_ColumnAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
{
|
||||
PrepareSectionData calcObj = new PrepareSectionData();
|
||||
calcObj.Type = CalculationObjectType.Section;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_FloorAnalytical, BuiltInCategory.OST_FoundationSlabAnalytical, BuiltInCategory.OST_WallAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
ModifyElementForces calcObj = new ModifyElementForces();
|
||||
calcObj.Type = CalculationObjectType.Element;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_FloorAnalytical, BuiltInCategory.OST_FoundationSlabAnalytical, BuiltInCategory.OST_WallAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
CalculateSection calcObj = new CalculateSection();
|
||||
calcObj.Type = CalculationObjectType.Section;
|
||||
calcObj.ErrorResponse = ErrorResponse.SkipOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_FloorAnalytical, BuiltInCategory.OST_FoundationSlabAnalytical, BuiltInCategory.OST_WallAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
{
|
||||
FillResultData calcObj = new FillResultData();
|
||||
calcObj.Type = CalculationObjectType.Element;
|
||||
calcObj.ErrorResponse = ErrorResponse.RunOnError;
|
||||
calcObj.Categories = new List<BuiltInCategory>() { BuiltInCategory.OST_FloorAnalytical, BuiltInCategory.OST_FoundationSlabAnalytical, BuiltInCategory.OST_WallAnalytical };
|
||||
scenario.Add(calcObj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
|
||||
return scenario;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's colunn element.
|
||||
/// </summary>
|
||||
class ColumnElement : ElementDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's column object.
|
||||
/// </summary>
|
||||
/// <param name="elementDataBase">Instance of base element object with predefined parameters to copy.</param>
|
||||
public ColumnElement(ElementDataBase elementDataBase)
|
||||
: base(elementDataBase)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets cref="ElementInfo" object.
|
||||
/// </summary>
|
||||
public ElementInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.CodeChecking.Concrete;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using CodeCheckingConcreteExample.Concrete;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's section of a column element.
|
||||
/// </summary>
|
||||
class ColumnSection : LinearSection
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's section object of column element.
|
||||
/// </summary>
|
||||
/// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
|
||||
public ColumnSection(SectionDataBase sectionDataBase)
|
||||
: base(sectionDataBase)
|
||||
{
|
||||
Width = 0.0;
|
||||
Height = 0.0;
|
||||
Geometry = new Geometry();
|
||||
|
||||
ListInternalForces = new List<InternalForcesBase>();
|
||||
MinStiffness = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering.Tools;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's object with common parameters.
|
||||
/// </summary>
|
||||
public class CommonParameters : CommonParametersBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's object with common parameters.
|
||||
/// </summary>
|
||||
/// <param name="data">Acces to cref="ServiceData"</param>
|
||||
/// <param name="param">Instance of base common parameters object with predefined parameters to copy.</param>
|
||||
public CommonParameters(Autodesk.Revit.DB.CodeChecking.ServiceData data, CommonParametersBase param)
|
||||
: base(param)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets and sets cref="ForceResultsCache" object.
|
||||
/// </summary>
|
||||
public ForceResultsCache ResultCache { get; set; }
|
||||
}
|
||||
}
|
||||
+792
@@ -0,0 +1,792 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering.Tools;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using Autodesk.Revit.DB.CodeChecking.Storage;
|
||||
using CodeCheckingConcreteExample.Properties;
|
||||
using Autodesk.Revit.DB.CodeChecking;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's implementation of interface for the main loop class. Parameter of the default constructor of the cref="Engine" class.
|
||||
/// </summary>
|
||||
public class EngineData : IEngineData
|
||||
{
|
||||
#region IEngineData Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the display unit which user want to use in the project.
|
||||
/// </summary>
|
||||
/// <returns>cref="DisplayUnit"</returns>
|
||||
public Autodesk.Revit.DB.DisplayUnit GetInputDataUnitSystem()
|
||||
{
|
||||
DisplayUnit displayUnit = DisplayUnit.IMPERIAL;
|
||||
if (Server.Server.UnitSystem == Autodesk.Revit.DB.ResultsBuilder.UnitsSystem.Metric)
|
||||
displayUnit = DisplayUnit.METRIC;
|
||||
return displayUnit;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets number of available threads or processors. user could switch off parallel calculation by returning value 1.
|
||||
/// </summary>
|
||||
/// <param name="data">Service data.</param>
|
||||
/// <returns>Number of threads</returns>
|
||||
public int GetNumberOfThreads(Autodesk.Revit.DB.CodeChecking.ServiceData data)
|
||||
{
|
||||
/// <structural_toolkit_2015>
|
||||
if(Tools.IsJournalPlayback)
|
||||
return 1;
|
||||
else
|
||||
return Environment.ProcessorCount;
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets ForceCalculationDataDescriptor object for the current structure
|
||||
/// </summary>
|
||||
/// <param name="data">Service Data</param>
|
||||
/// <param name="combinations">List of selected combinations ids </param>
|
||||
/// <param name="elementId">Id of Revit element</param>
|
||||
/// <returns>Reference to ForceCalculationDataDescriptor</returns>
|
||||
protected ForceCalculationDataDescriptor GetForceCalculationDataDescriptor(Autodesk.Revit.DB.CodeChecking.ServiceData data, List<ElementId> combinations, ElementId elementId)
|
||||
{
|
||||
Tuple<Label,CalculationParameter,BuiltInCategory,Element> intData = GetElementInternalData(data, elementId);
|
||||
Label ccLabel = intData.Item1;
|
||||
CalculationParameter calculationParameters = intData.Item2;
|
||||
BuiltInCategory category = intData.Item3;
|
||||
Element element = intData.Item4;
|
||||
|
||||
List<ForceType> forceTypes = new List<ForceType>();// { ForceType.Fx, ForceType.Fy, ForceType.Fz, ForceType.Mx, ForceType.My, ForceType.Mz };
|
||||
|
||||
forceTypes = GetForceTypes(data, new ElementId[] { elementId });
|
||||
|
||||
ForceCalculationDataDescriptor descriptor = null;
|
||||
/// <structural_toolkit_2015>
|
||||
switch (category)
|
||||
{
|
||||
case BuiltInCategory.OST_ColumnAnalytical:
|
||||
case BuiltInCategory.OST_BeamAnalytical:
|
||||
{
|
||||
double elementLength = (element as Autodesk.Revit.DB.Structure.AnalyticalModel).GetCurve().Length;
|
||||
elementLength = Autodesk.Revit.DB.UnitUtils.ConvertFromInternalUnits(elementLength, DisplayUnitType.DUT_METERS);
|
||||
descriptor = new ForceCalculationDataDescriptorLinear(elementId, 1.0, calculationParameters.CalculationPointsSelector.GetPointCoordinates(data.Document, true, elementLength, elementId, combinations, forceTypes), true, forceTypes);
|
||||
|
||||
if (descriptor == null)
|
||||
{
|
||||
descriptor = new ForceCalculationDataDescriptorLinear(elementId);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BuiltInCategory.OST_FloorAnalytical:
|
||||
case BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
case BuiltInCategory.OST_WallAnalytical:
|
||||
{
|
||||
descriptor = new ForceCalculationDataDescriptor(elementId,forceTypes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (descriptor == null)
|
||||
{
|
||||
descriptor = new ForceCalculationDataDescriptor(elementId,forceTypes);
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
return descriptor;
|
||||
|
||||
}
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
|
||||
/// <summary>
|
||||
/// Creates user imlementation of cref="ICalculationScenario" which consists list of calculation objects cref="ICalculatinObject".
|
||||
/// </summary>
|
||||
/// <param name="parameters">User common parameters.</param>
|
||||
/// <returns>The new instance of cref="ICalculationScenario"</returns>
|
||||
public ICalculationScenario CreateCalculationScenario(CommonParametersBase parameters)
|
||||
{
|
||||
return new CalculationScenario();
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of user class wich represents a section of a structure element.
|
||||
/// </summary>
|
||||
/// <param name="sectionDataBase">Instance of base class for the section.</param>
|
||||
/// <returns>New instance of user implementation of section class derived from cref="SectionDataBase".</returns>
|
||||
public SectionDataBase CreateSectionData(SectionDataBase sectionDataBase)
|
||||
{
|
||||
switch (sectionDataBase.Material)
|
||||
{
|
||||
case StructuralAssetClass.Concrete:
|
||||
switch (sectionDataBase.Category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
return new ColumnSection(sectionDataBase);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
return new BeamSection(sectionDataBase);
|
||||
/// <structural_toolkit_2015>
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
return new FloorSection(sectionDataBase);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
return new FloorSection(sectionDataBase);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
return new WallSection(sectionDataBase);
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
break;
|
||||
case StructuralAssetClass.Metal:
|
||||
break;
|
||||
}
|
||||
|
||||
return sectionDataBase;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of user class wich represents a structure element.
|
||||
/// </summary>
|
||||
/// <param name="elementDataBase">Instance of base class for the element.</param>
|
||||
/// <returns>New instance of user implementation of element class derived from cref="ElementDataBase".</returns>
|
||||
public ElementDataBase CreateElementData(ElementDataBase elementDataBase)
|
||||
{
|
||||
switch (elementDataBase.Material)
|
||||
{
|
||||
case StructuralAssetClass.Concrete:
|
||||
switch (elementDataBase.Category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
return new ColumnElement(elementDataBase);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
return new BeamElement(elementDataBase);
|
||||
/// <structural_toolkit_2015>
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
return new FloorElement(elementDataBase);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
return new FloorElement(elementDataBase);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
return new WallElement(elementDataBase);
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
break;
|
||||
case StructuralAssetClass.Metal:
|
||||
break;
|
||||
}
|
||||
|
||||
return elementDataBase;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of class with results for the element.
|
||||
/// </summary>
|
||||
/// <param name="category">Category of the element.</param>
|
||||
/// <param name="material">Material of the element.</param>
|
||||
/// <returns>User result schema object for the element.</returns>
|
||||
public Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass CreateElementResult(Autodesk.Revit.DB.BuiltInCategory category, Autodesk.Revit.DB.StructuralAssetClass material)
|
||||
{
|
||||
switch (material)
|
||||
{
|
||||
case StructuralAssetClass.Concrete:
|
||||
switch (category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
return new ResultBeam();
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
return new ResultColumn();
|
||||
/// <structural_toolkit_2015>
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
return new ResultFloor();
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
return new ResultFloor();
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
return new ResultWall();
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
break;
|
||||
case StructuralAssetClass.Metal:
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads calculation parameters from revit data base.
|
||||
/// </summary>
|
||||
/// <param name="data">Acces to cref="ServiceData".</param>
|
||||
/// <returns>User calculation parameters schema object.</returns>
|
||||
public Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass ReadCalculationParameter(Autodesk.Revit.DB.CodeChecking.ServiceData data)
|
||||
{
|
||||
Autodesk.Revit.DB.CodeChecking.Storage.StorageService service = Autodesk.Revit.DB.CodeChecking.Storage.StorageService.GetStorageService();
|
||||
Autodesk.Revit.DB.CodeChecking.Storage.StorageDocument storageDocument = service.GetStorageDocument(data.Document);
|
||||
CalculationParameter calculationParameter = storageDocument.CalculationParamsManager.CalculationParams.GetEntity<CalculationParameter>(data.Document);
|
||||
return calculationParameter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads parameters of user element label.
|
||||
/// </summary>
|
||||
/// <param name="category">Category of the element.</param>
|
||||
/// <param name="material">Material of the element.</param>
|
||||
/// <param name="label">Acces to the Revit storage with labels."</param>
|
||||
/// <param name="data">Acces to cref="ServiceData".</param>
|
||||
/// <returns>User label of the element.</returns>
|
||||
public Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass ReadElementLabel(Autodesk.Revit.DB.BuiltInCategory category, Autodesk.Revit.DB.StructuralAssetClass material, Autodesk.Revit.DB.CodeChecking.Storage.Label label, Autodesk.Revit.DB.CodeChecking.ServiceData data)
|
||||
{
|
||||
if (label != null)
|
||||
{
|
||||
switch (material)
|
||||
{
|
||||
case StructuralAssetClass.Concrete:
|
||||
switch (category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical: return label.GetEntity<LabelColumn>(data.Document);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical: return label.GetEntity<LabelBeam>(data.Document);
|
||||
/// <structural_toolkit_2015>
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical: return label.GetEntity<LabelFloor>(data.Document);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical: return label.GetEntity<LabelFloor>(data.Document);
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical: return label.GetEntity<LabelWall>(data.Document);
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
break;
|
||||
case StructuralAssetClass.Metal:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify parameters of steel in the label.
|
||||
/// </summary>
|
||||
/// <param name="steel">Steel properties</param>
|
||||
/// <param name="longitudinal">Information about the type of reinforcement. True if longitudinal.</param>
|
||||
/// <returns></returns>
|
||||
public List<string> VerifySteel(CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema steel, bool longitudinal)
|
||||
{
|
||||
List<string> errors = new List<string>();
|
||||
|
||||
if (steel.Material == null)
|
||||
errors.Add(Resources.ResourceManager.GetString(longitudinal ? "ErrReinforcementMaterialL" : "ErrReinforcementMaterialT"));
|
||||
else if (steel.MinimumYieldStress < Double.Epsilon)
|
||||
errors.Add(Resources.ResourceManager.GetString(longitudinal ? "ErrReinforcementYieldStressL" : "ErrReinforcementYieldStressT"));
|
||||
if (steel.RebarBarType == null || steel.BarDiameter < Double.Epsilon || steel.DeformationType == Autodesk.Revit.DB.CodeChecking.Engineering.Concrete.ConcreteTypes.SteelSurface.Unknown)
|
||||
errors.Add(Resources.ResourceManager.GetString(longitudinal ? "ErrRebarL" : "ErrRebarT"));
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify parameters of user element label.
|
||||
/// </summary>
|
||||
/// <param name="category">Category of the element.</param>
|
||||
/// <param name="material">Material of the element.</param>
|
||||
/// <param name="label">Element label."</param>
|
||||
/// <param name="status">Reference to element's status".</param>
|
||||
public void VerifyElementLabel(Autodesk.Revit.DB.BuiltInCategory category, StructuralAssetClass material, Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass label,
|
||||
ref Autodesk.Revit.DB.CodeChecking.Storage.ResultStatus status)
|
||||
{
|
||||
if (label != null)
|
||||
{
|
||||
switch (material)
|
||||
{
|
||||
case StructuralAssetClass.Concrete:
|
||||
switch (category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
{
|
||||
LabelColumn labelCol = label as LabelColumn;
|
||||
if (labelCol != null)
|
||||
{
|
||||
if (labelCol.EnabledInternalForces.Count == 0)
|
||||
status.AddError(Resources.ResourceManager.GetString("ErrNoChosenInternalForces"));
|
||||
List<string> errors = VerifySteel(labelCol.LongitudinalReinforcement, true);
|
||||
foreach(string s in errors)
|
||||
status.AddError(s);
|
||||
errors = VerifySteel(labelCol.TransversalReinforcement, false);
|
||||
foreach(string s in errors)
|
||||
status.AddError(s);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
{
|
||||
LabelBeam labelBm = label as LabelBeam;
|
||||
if (labelBm != null)
|
||||
{
|
||||
if (labelBm.EnabledInternalForces.Count == 0)
|
||||
status.AddError(Resources.ResourceManager.GetString("ErrNoChosenInternalForces"));
|
||||
List<string> errors = VerifySteel(labelBm.LongitudinalReinforcement, true);
|
||||
foreach(string s in errors)
|
||||
status.AddError(s);
|
||||
errors = VerifySteel(labelBm.TransversalReinforcement, false);
|
||||
foreach(string s in errors)
|
||||
status.AddError(s);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
{
|
||||
LabelFloor labelFloor = label as LabelFloor;
|
||||
if (labelFloor != null)
|
||||
{
|
||||
if (labelFloor.EnabledInternalForces.Count == 0)
|
||||
status.AddError(Resources.ResourceManager.GetString("ErrNoChosenInternalForces"));
|
||||
List<string> errors = VerifySteel(labelFloor.PrimaryReinforcement, true);
|
||||
foreach (string s in errors)
|
||||
status.AddError(s);
|
||||
errors = VerifySteel(labelFloor.SecondaryReinforcement, false);
|
||||
foreach (string s in errors)
|
||||
status.AddError(s);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
{
|
||||
LabelWall labelWall = label as LabelWall;
|
||||
if (labelWall != null)
|
||||
{
|
||||
if (labelWall.EnabledInternalForces.Count == 0)
|
||||
status.AddError(Resources.ResourceManager.GetString("ErrNoChosenInternalForces"));
|
||||
List<string> errors = VerifySteel(labelWall.VerticalReinforcement, true);
|
||||
foreach (string s in errors)
|
||||
status.AddError(s);
|
||||
errors = VerifySteel(labelWall.HorizontalReinforcement, false);
|
||||
foreach (string s in errors)
|
||||
status.AddError(s);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case StructuralAssetClass.Metal:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filters list of elements due to e.g. a result status for calculation purposes.
|
||||
/// </summary>
|
||||
/// <param name="listElementData">List of user element objects.</param>
|
||||
/// <returns>Filtered list of user element objects.</returns>
|
||||
public List<ObjectDataBase> FilterElementForCalculation(List<ObjectDataBase> listElementData)
|
||||
{
|
||||
List<ObjectDataBase> listElementFiltered = new List<ObjectDataBase>();
|
||||
|
||||
foreach (ObjectDataBase obj in listElementData)
|
||||
{
|
||||
ElementDataBase elem = obj as ElementDataBase;
|
||||
if (elem != null)
|
||||
{
|
||||
if (!elem.Status.IsError())
|
||||
{
|
||||
listElementFiltered.Add(elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return listElementFiltered;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of a user's class with common parameters.
|
||||
/// </summary>
|
||||
/// <param name="data">Acces to cref="ServiceData".</param>
|
||||
/// <param name="parameters">Instance of base class with common parameters.</param>
|
||||
/// <returns>New instance of user implementation of class derived from cref="CommonParametersBase".</returns>
|
||||
public CommonParametersBase CreateCommonParameters(Autodesk.Revit.DB.CodeChecking.ServiceData data, CommonParametersBase parameters)
|
||||
{
|
||||
Autodesk.Revit.DB.CodeChecking.NotificationService.ProgressStart(Resources.ResourceManager.GetString("DataPreparation"), 1);
|
||||
|
||||
CommonParameters commonParameters = new CommonParameters(data, parameters);
|
||||
|
||||
List<ForceCalculationDataDescriptor> calculationDataDescriptors = new List<ForceCalculationDataDescriptor>();
|
||||
foreach (Tuple<ElementId,ResultStatus> elemStatus in commonParameters.ListElementStatus)
|
||||
{
|
||||
ForceCalculationDataDescriptor forceCalculationDataDescriptor = GetForceCalculationDataDescriptor(data, parameters.ListCombinationId, elemStatus.Item1);
|
||||
///<structural_toolkit_2015>
|
||||
if (forceCalculationDataDescriptor is ForceCalculationDataDescriptorLinear)
|
||||
{
|
||||
forceCalculationDataDescriptor.AddBendingForceTypes(new ForceType[] { ForceType.Ux, ForceType.Uy, ForceType.Uz });
|
||||
}
|
||||
///</structural_toolkit_2015>
|
||||
calculationDataDescriptors.Add(forceCalculationDataDescriptor);
|
||||
if (NotificationService.ProgressBreakInvoked())
|
||||
break;
|
||||
}
|
||||
|
||||
ForceResultsPackageDescriptor[] vResPackDesc = new ForceResultsPackageDescriptor[] { ForceResultsPackageDescriptor.GetResultPackageDescriptor(data.Document, commonParameters.ActivePackageGuid) };
|
||||
|
||||
// Uncomment the code below to dump to a text file the time spent on accessing ResultsBuilder
|
||||
// Int64 forceResultsCacheAccessTime = System.DateTime.Now.Ticks;
|
||||
commonParameters.ResultCache = new ForceResultsCache(data.Document, calculationDataDescriptors, vResPackDesc, commonParameters.ListCombinationId, GetInputDataUnitSystem());
|
||||
// Uncomment the code below to dump to a text file the time spent on accessing ResultsBuilder
|
||||
// forceResultsCacheAccessTime = System.DateTime.Now.Ticks - forceResultsCacheAccessTime;
|
||||
|
||||
foreach (Tuple<ElementId, ResultStatus> elemStatus in commonParameters.ListElementStatus)
|
||||
{
|
||||
ForceResultsCache.ElementResultsStatus resultStatus = commonParameters.ResultCache.GetElementResultsStatus(elemStatus.Item1);
|
||||
if (resultStatus != ForceResultsCache.ElementResultsStatus.ResultsOK)
|
||||
{
|
||||
elemStatus.Item2.AddError(Resources.ResourceManager.GetString("ErrStaticResults"));
|
||||
}
|
||||
}
|
||||
|
||||
// Uncomment the code below to dump to a text file the time spent on accessing ResultsBuilder
|
||||
// using (System.IO.StreamWriter writer = new System.IO.StreamWriter(data.Document.PathName + ".RBAccessTimeInfo.txt", true))
|
||||
// {
|
||||
// string resultBuilderAccessTime = DateTime.Now.ToString() + " Cache: " + (new System.TimeSpan(forceResultsCacheAccessTime)).TotalSeconds + " RB: " + (new System.TimeSpan(commonParameters.ResultCache.ResultBuilderAccessTime)).TotalSeconds;
|
||||
//
|
||||
// writer.WriteLine(resultBuilderAccessTime);
|
||||
// }
|
||||
|
||||
Autodesk.Revit.DB.CodeChecking.NotificationService.ProgressStep("");
|
||||
return commonParameters;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of class with list of calculation points for user's elements.
|
||||
/// </summary>
|
||||
/// <param name="data">Acces to cref="ServiceData".</param>
|
||||
/// <param name="parameters">User object with common parameters.</param>
|
||||
/// <param name="elementId">Id of an element.</param>
|
||||
/// <returns>List of calculation points for user's element.</returns>
|
||||
public List<CalcPoint> CreateCalcPointsForElement(Autodesk.Revit.DB.CodeChecking.ServiceData data, CommonParametersBase parameters, ElementId elementId)
|
||||
{
|
||||
List<CalcPoint> calculationPoints = new List<CalcPoint>();
|
||||
CommonParameters commonParameters = parameters as CommonParameters;
|
||||
if (commonParameters != null)
|
||||
calculationPoints = commonParameters.ResultCache.GetCalculationPoints(elementId);
|
||||
return calculationPoints;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gives possibility to read data from Revit data base and puts them into user element's objects and into user section's objects and into user common parameters.
|
||||
/// </summary>
|
||||
/// <param name="listElementData">List of user element objects.</param>
|
||||
/// <param name="parameters">User common parameters.</param>
|
||||
/// <param name="data">Acces to cref="ServiceData".</param>
|
||||
public void ReadFromRevitDB(List<ObjectDataBase> listElementData, CommonParametersBase parameters, Autodesk.Revit.DB.CodeChecking.ServiceData data)
|
||||
{
|
||||
// read additional information from Revit data and store them in user objects derived from ElementDataBase and listed in listElementData
|
||||
|
||||
Autodesk.Revit.DB.CodeChecking.NotificationService.ProgressStart(Resources.ResourceManager.GetString("ReadingGeometry"), listElementData.Count);
|
||||
ElementAnalyser elementAnalyser = new ElementAnalyser(GetInputDataUnitSystem());
|
||||
|
||||
int step = 0;
|
||||
foreach (ObjectDataBase elemData in listElementData)
|
||||
{
|
||||
Element element = data.Document.GetElement(elemData.ElementId);
|
||||
if (element != null)
|
||||
{
|
||||
switch (elemData.Category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
{
|
||||
ColumnElement elem = elemData as ColumnElement;
|
||||
if (elem != null && !elem.Status.IsError())
|
||||
{
|
||||
elem.Info = elementAnalyser.Analyse(element);
|
||||
if (elem.Info.Material.Characteristics.YoungModulus.X < Double.Epsilon)
|
||||
elem.Status.AddError(Resources.ResourceManager.GetString("ErrYoungModulus"));
|
||||
|
||||
MaterialConcreteCharacteristics concrete = (MaterialConcreteCharacteristics)elem.Info.Material.Characteristics.Specific;
|
||||
if (concrete == null || concrete.Compression < Double.Epsilon)
|
||||
elem.Status.AddError(Resources.ResourceManager.GetString("ErrConcreteCompression"));
|
||||
|
||||
foreach (SectionDataBase sectionDataBase in elem.ListSectionData)
|
||||
{
|
||||
ColumnSection sec = sectionDataBase as ColumnSection;
|
||||
if (sec != null)
|
||||
sec.Info = elem.Info;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
{
|
||||
BeamElement elem = elemData as BeamElement;
|
||||
if (elem != null && !elem.Status.IsError())
|
||||
{
|
||||
elementAnalyser.TSectionAnalysis = false;
|
||||
LabelBeam labelBeam = elem.Label as LabelBeam;
|
||||
if (labelBeam != null)
|
||||
{
|
||||
elementAnalyser.TSectionAnalysis = ( labelBeam.SlabBeamInteraction == BeamSectionType.WithSlabBeamInteraction );
|
||||
}
|
||||
|
||||
elem.Info = elementAnalyser.Analyse(element);
|
||||
if (elem.Info.Material.Characteristics.YoungModulus.X < Double.Epsilon)
|
||||
elem.Status.AddError(Resources.ResourceManager.GetString("ErrYoungModulus"));
|
||||
|
||||
MaterialConcreteCharacteristics concrete = (MaterialConcreteCharacteristics)elem.Info.Material.Characteristics.Specific;
|
||||
if (concrete == null || concrete.Compression < Double.Epsilon)
|
||||
elem.Status.AddError(Resources.ResourceManager.GetString("ErrConcreteCompression"));
|
||||
|
||||
foreach (SectionDataBase sectionDataBase in elem.ListSectionData)
|
||||
{
|
||||
BeamSection sec = sectionDataBase as BeamSection;
|
||||
if (sec != null)
|
||||
sec.Info = elem.Info;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
|
||||
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
|
||||
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
|
||||
{
|
||||
FloorElement slab = elemData as FloorElement;
|
||||
if (slab != null)
|
||||
{
|
||||
slab.Info = elementAnalyser.Analyse(element);
|
||||
|
||||
foreach (SectionDataBase secData in slab.ListSectionData)
|
||||
{
|
||||
FloorSection sec = secData as FloorSection;
|
||||
if (sec != null)
|
||||
sec.Info = slab.Info;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
{
|
||||
WallElement wall = elemData as WallElement;
|
||||
if (wall != null)
|
||||
{
|
||||
wall.Info = elementAnalyser.Analyse(element);
|
||||
|
||||
foreach (SectionDataBase secData in wall.ListSectionData)
|
||||
{
|
||||
WallSection sec = secData as WallSection;
|
||||
if (sec != null)
|
||||
sec.Info = wall.Info;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
}
|
||||
Autodesk.Revit.DB.CodeChecking.NotificationService.ProgressStep(string.Format("{0:d}%", ++step * 100 / listElementData.Count));
|
||||
if (NotificationService.ProgressBreakInvoked())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gives possibility to write data to Revit data base.
|
||||
/// </summary>
|
||||
/// <param name="listElementData">List of user element objects.</param>
|
||||
/// <param name="parameters">User common parameters.</param>
|
||||
/// <param name="data">Acces to cref="ServiceData".</param>
|
||||
public void SaveToRevitDB(List<ObjectDataBase> listElementData, CommonParametersBase parameters, Autodesk.Revit.DB.CodeChecking.ServiceData data)
|
||||
{
|
||||
|
||||
Autodesk.Revit.DB.ResultsBuilder.Storage.ResultsPackageBuilder builder = Autodesk.Revit.DB.CodeChecking.Storage.StorageService.GetStorageService().GetStorageDocument(data.Document).CalculationParamsManager.CalculationParams.GetOutputResultPackageBuilder(Server.Server.ID);
|
||||
ForceResultsWriter resultsWriter = new ForceResultsWriter(data.Document, builder, Autodesk.Revit.DB.ResultsBuilder.UnitsSystem.Metric);
|
||||
|
||||
foreach (ObjectDataBase objectDataBase in listElementData)
|
||||
{
|
||||
ElementDataBase elementDataBase = objectDataBase as ElementDataBase;
|
||||
if (!elementDataBase.Status.IsError())
|
||||
{
|
||||
switch (elementDataBase.Category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
{
|
||||
//TBD - RB doesn't support relative coordinates as input
|
||||
//Begin mod
|
||||
//IList<double> vx = (from sec in elementDataBase.ListSectionData select (sec as LinearSection).GetCalcResultsInPt()[ResultTypeLinear.X_Rel ]).ToList();
|
||||
bool isListForces = true;
|
||||
foreach (LinearSection sec in elementDataBase.ListSectionData)
|
||||
{
|
||||
if (sec.ListInternalForces == null || sec.ListInternalForces.Count == 0)
|
||||
{
|
||||
isListForces = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isListForces)
|
||||
{
|
||||
IList<double> xCoordinates = (from sec in elementDataBase.ListSectionData select (sec as LinearSection).GetCalcResultsInPoint()[ResultTypeLinear.X]).ToList();
|
||||
//End Mod
|
||||
resultsWriter.SetMeasurementForElement(elementDataBase.ElementId, AxisDirection.X, xCoordinates);
|
||||
|
||||
ResultTypeLinear[] resultTypesLinear = new ResultTypeLinear[] { ResultTypeLinear.Abottom, ResultTypeLinear.Atop, ResultTypeLinear.Aleft, ResultTypeLinear.Aright };
|
||||
foreach (ResultTypeLinear forceType in resultTypesLinear)
|
||||
{
|
||||
ICollection<double> valuesInPoints = (from LinearSection section in elementDataBase.ListSectionData select section.GetCalcResultsInPoint()[forceType]).ToList();
|
||||
resultsWriter.AddResultsForElement(elementDataBase.ElementId, forceType.GetResultType(), valuesInPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/// <structural_toolkit_2015>
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
IList<double> vx = (from sec in elementDataBase.ListSectionData select (sec as SurfaceSection).GetCalcResultsInPt()[ResultTypeSurface.X]).ToList();
|
||||
IList<double> vy = (from sec in elementDataBase.ListSectionData select (sec as SurfaceSection).GetCalcResultsInPt()[ResultTypeSurface.Y]).ToList();
|
||||
IList<double> vz = (from sec in elementDataBase.ListSectionData select (sec as SurfaceSection).GetCalcResultsInPt()[ResultTypeSurface.Z]).ToList();
|
||||
resultsWriter.SetMeasurementForElement(elementDataBase.ElementId, AxisDirection.X, vx);
|
||||
resultsWriter.SetMeasurementForElement(elementDataBase.ElementId, AxisDirection.Y, vy);
|
||||
resultsWriter.SetMeasurementForElement(elementDataBase.ElementId, AxisDirection.Z, vz);
|
||||
ResultTypeSurface[] vType = new ResultTypeSurface[] { ResultTypeSurface.AxxBottom, ResultTypeSurface.AxxTop, ResultTypeSurface.AyyBottom, ResultTypeSurface.AyyTop };
|
||||
foreach (ResultTypeSurface forceType in vType)
|
||||
{
|
||||
ICollection<double> vVal = (from sec in elementDataBase.ListSectionData select (sec as SurfaceSection).GetCalcResultsInPt()[forceType]).ToList();
|
||||
resultsWriter.AddResultsForElement(elementDataBase.ElementId, forceType.GetResultType(), vVal);
|
||||
}
|
||||
break;
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
}
|
||||
}
|
||||
resultsWriter.StoreResultsInResultsBuilder("RCCalculationsResults");
|
||||
}
|
||||
|
||||
|
||||
private Tuple<Label,CalculationParameter,BuiltInCategory,Element> GetElementInternalData(Autodesk.Revit.DB.CodeChecking.ServiceData data, ElementId elementId)
|
||||
{
|
||||
Element element = data.Document.GetElement(elementId);
|
||||
BuiltInCategory category = Autodesk.Revit.DB.CodeChecking.Tools.GetCategoryOfElement(element);
|
||||
StorageDocument storageDocument = Autodesk.Revit.DB.CodeChecking.Storage.StorageService.GetStorageService().GetStorageDocument(data.Document);
|
||||
CalculationParameter calculationParameter = storageDocument.CalculationParamsManager.CalculationParams.GetEntity<CalculationParameter>(data.Document);
|
||||
Label ccLabel = storageDocument.LabelsManager.GetLabel(element);
|
||||
|
||||
return new Tuple<Label, CalculationParameter, BuiltInCategory, Element>(ccLabel, calculationParameter, category, element);
|
||||
}
|
||||
|
||||
private List<ForceType> GetForceTypes(Autodesk.Revit.DB.CodeChecking.ServiceData data, IEnumerable<ElementId> elementsIds)
|
||||
{
|
||||
List<ForceType> forceTypes = new List<ForceType>();
|
||||
foreach (ElementId elementId in elementsIds)
|
||||
{
|
||||
Tuple<Label, CalculationParameter, BuiltInCategory, Element> elementsInternalData = GetElementInternalData(data, elementId);
|
||||
BuiltInCategory category = elementsInternalData.Item3;
|
||||
Label ccLabel = elementsInternalData.Item1;
|
||||
|
||||
switch (category)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
|
||||
{
|
||||
LabelColumn label = ReadElementLabel(category, ccLabel.Material, ccLabel, data) as LabelColumn;
|
||||
if (label != null)
|
||||
{
|
||||
forceTypes = label.EnabledInternalForces.Select(s => s.GetForceType()).ToList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
|
||||
{
|
||||
LabelBeam label = ReadElementLabel(category, ccLabel.Material, ccLabel, data) as LabelBeam;
|
||||
if (label != null)
|
||||
{
|
||||
forceTypes = label.EnabledInternalForces.Select(s => s.GetForceType()).ToList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
/// <structural_toolkit_2015>
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
|
||||
{
|
||||
LabelFloor label = ReadElementLabel(category, ccLabel.Material, ccLabel, data) as LabelFloor;
|
||||
if (label != null)
|
||||
{
|
||||
if (label.EnabledInternalForces.Contains(EnabledInternalForces.MY))
|
||||
{
|
||||
forceTypes.Add(ForceType.Mxx);
|
||||
forceTypes.Add(ForceType.Myy);
|
||||
}
|
||||
if (label.EnabledInternalForces.Contains(EnabledInternalForces.FX))
|
||||
{
|
||||
forceTypes.Add(ForceType.Fyy);
|
||||
forceTypes.Add(ForceType.Fxx);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
|
||||
{
|
||||
LabelWall label = ReadElementLabel(category, ccLabel.Material, ccLabel, data) as LabelWall;
|
||||
if (label != null)
|
||||
{
|
||||
if (label.EnabledInternalForces.Contains(EnabledInternalForces.FX))
|
||||
{
|
||||
forceTypes.Add(ForceType.Fyy);
|
||||
forceTypes.Add(ForceType.Fxx);
|
||||
}
|
||||
if (label.EnabledInternalForces.Contains(EnabledInternalForces.MY))
|
||||
{
|
||||
forceTypes.Add(ForceType.Mxx);
|
||||
forceTypes.Add(ForceType.Myy);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
|
||||
}
|
||||
}
|
||||
return forceTypes;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
class FloorElement : ElementDataBase
|
||||
{
|
||||
public FloorElement(ElementDataBase elementDataBase) : base(elementDataBase)
|
||||
{
|
||||
}
|
||||
|
||||
public ElementInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.CodeChecking.Concrete;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using CodeCheckingConcreteExample.Concrete;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using DD = CodeCheckingConcreteExample.ConcreteTypes.DimensioningDirection;
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
class FloorSection : SurfaceSection
|
||||
{
|
||||
public FloorSection(SectionDataBase sectionDataBase) : base(sectionDataBase)
|
||||
{
|
||||
Width = 0.0;
|
||||
Height = 0.0;
|
||||
Geometry = new Geometry();
|
||||
|
||||
ListInternalForces = new List<InternalForcesBase>();
|
||||
MinStiffnes[DD.X] = MinStiffnes[DD.Y] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.CodeChecking.Concrete;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using CodeCheckingConcreteExample.Concrete;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents user's section of linear element.
|
||||
/// </summary>
|
||||
class LinearSection : SectionDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's section object of linear element.
|
||||
/// </summary>
|
||||
/// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
|
||||
public LinearSection(SectionDataBase sectionDataBase)
|
||||
: base(sectionDataBase)
|
||||
{
|
||||
DesignWarning = new List<string>();
|
||||
DesignInfo = new List<string>();
|
||||
DesignError = new List<string>();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets analitical results for RC bar section
|
||||
/// </summary>
|
||||
/// <returns>Analitical results in the section.</returns>
|
||||
public ResultInPointLinear GetCalcResultsInPoint()
|
||||
{
|
||||
ResultInPointLinear resultInPoint = null;
|
||||
|
||||
if (ListInternalForces != null && ListInternalForces.Count > 0)
|
||||
{
|
||||
resultInPoint = new ResultInPointLinear();
|
||||
|
||||
resultInPoint[ResultTypeLinear.X] = (CalcPoint as CalcPointLinear).CoordAbsolute;
|
||||
resultInPoint[ResultTypeLinear.X_Rel] = (CalcPoint as CalcPointLinear).CoordRelative;
|
||||
|
||||
IEnumerable<double> vmx = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.MomentMx;
|
||||
resultInPoint[ResultTypeLinear.MxMax] = vmx.Max();
|
||||
resultInPoint[ResultTypeLinear.MxMin] = vmx.Min();
|
||||
|
||||
IEnumerable<double> vmy = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.MomentMy;
|
||||
resultInPoint[ResultTypeLinear.MyMax] = vmy.Max();
|
||||
resultInPoint[ResultTypeLinear.MyMin] = vmy.Min();
|
||||
|
||||
IEnumerable<double> vmz = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.MomentMz;
|
||||
resultInPoint[ResultTypeLinear.MzMax] = vmz.Max();
|
||||
resultInPoint[ResultTypeLinear.MzMin] = vmz.Min();
|
||||
|
||||
IEnumerable<double> vfx = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.ForceFx;
|
||||
resultInPoint[ResultTypeLinear.FxMax] = vfx.Max();
|
||||
resultInPoint[ResultTypeLinear.FxMin] = vfx.Min();
|
||||
|
||||
IEnumerable<double> vfy = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.ForceFy;
|
||||
resultInPoint[ResultTypeLinear.FyMax] = vfy.Max();
|
||||
resultInPoint[ResultTypeLinear.FyMin] = vfy.Min();
|
||||
|
||||
IEnumerable<double> vfz = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.ForceFz;
|
||||
resultInPoint[ResultTypeLinear.FzMax] = vfz.Max();
|
||||
resultInPoint[ResultTypeLinear.FzMin] = vfz.Min();
|
||||
|
||||
resultInPoint[ResultTypeLinear.Abottom] = AsBottom;
|
||||
resultInPoint[ResultTypeLinear.Atop] = AsTop;
|
||||
|
||||
resultInPoint[ResultTypeLinear.Aleft] = AsLeft;
|
||||
resultInPoint[ResultTypeLinear.Aright] = AsRight;
|
||||
|
||||
resultInPoint[ResultTypeLinear.StirrupsSpacing] = System.Math.Min(Spacing, 10.0);
|
||||
resultInPoint[ResultTypeLinear.TransversalReinforcemenDensity] = TransversalDensity;
|
||||
|
||||
IEnumerable<double> vuz = from InternalForcesLinear ifo in ListInternalForces select ifo.Forces.DeflectionUz;
|
||||
|
||||
resultInPoint[ResultTypeLinear.UzMax] = vuz.Max();
|
||||
resultInPoint[ResultTypeLinear.UzMin] = vuz.Min();
|
||||
|
||||
resultInPoint[ResultTypeLinear.UzRealMax] = StiffnesCoeff * vuz.Max();
|
||||
resultInPoint[ResultTypeLinear.UzRealMin] = StiffnesCoeff * vuz.Min();
|
||||
|
||||
resultInPoint[ResultTypeLinear.UxRealMax] = resultInPoint[ResultTypeLinear.UxMax] = 0;
|
||||
resultInPoint[ResultTypeLinear.UxRealMin] = resultInPoint[ResultTypeLinear.UxMin] = 0;
|
||||
resultInPoint[ResultTypeLinear.UyRealMax] = resultInPoint[ResultTypeLinear.UyMax] = 0;
|
||||
resultInPoint[ResultTypeLinear.UyRealMin] = resultInPoint[ResultTypeLinear.UyMin] = 0;
|
||||
}
|
||||
|
||||
return resultInPoint;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets list of internal forces for section.
|
||||
/// </summary>
|
||||
public List<InternalForcesBase> ListInternalForces { get; set; }
|
||||
/// <summary>
|
||||
/// gets and sets geometry of the section.
|
||||
/// </summary>
|
||||
public Geometry Geometry { get; set; }
|
||||
/// <summary>
|
||||
/// gets and sets width of the section.
|
||||
/// </summary>
|
||||
public double Width { get; set; }
|
||||
/// <summary>
|
||||
/// gets and sets height of the section.
|
||||
/// </summary>
|
||||
public double Height { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets bottom reinforcement
|
||||
/// </summary>
|
||||
public double AsBottom { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets top reinforcement
|
||||
/// </summary>
|
||||
public double AsTop { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets left reinforcement
|
||||
/// </summary>
|
||||
public double AsLeft { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets right reinforcement
|
||||
/// </summary>
|
||||
public double AsRight { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets stirrup spacing
|
||||
/// </summary>
|
||||
public double Spacing { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets transversal reinforcement density
|
||||
/// </summary>
|
||||
public double TransversalDensity { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets minimal stiffness property of RC section.
|
||||
/// </summary>
|
||||
public double MinStiffness { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with calculation warnings.
|
||||
/// </summary>
|
||||
public double StiffnesCoeff { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with calculation warnings.
|
||||
/// </summary>
|
||||
public List<string> DesignWarning { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with additional calculation information.
|
||||
/// </summary>
|
||||
public List<string> DesignInfo { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with calculation errors.
|
||||
/// </summary>
|
||||
public List<string> DesignError { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets cref="ElementInfo" object.
|
||||
/// </summary>
|
||||
public ElementInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.CodeChecking.Concrete;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using CodeCheckingConcreteExample.Concrete;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using DD = CodeCheckingConcreteExample.ConcreteTypes.DimensioningDirection;
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
class SurfaceSection : SectionDataBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of user's section object of linear element.
|
||||
/// </summary>
|
||||
/// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
|
||||
public SurfaceSection(SectionDataBase sectionDataBase)
|
||||
: base(sectionDataBase)
|
||||
{
|
||||
DesignWarning = new Dictionary<DD, List<string>>() { { DD.X, new List<string>() }, { DD.Y, new List<string>() } };
|
||||
DesignInfo = new Dictionary<DD, List<string>>() { { DD.X, new List<string>() }, { DD.Y, new List<string>() } };
|
||||
DesignError = new Dictionary<DD, List<string>>() { { DD.X, new List<string>() }, { DD.Y, new List<string>() } };
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets analitical results for RC surface elements (floor, slab, wall)
|
||||
/// </summary>
|
||||
/// <returns>Analitical results in the section.</returns>
|
||||
public ResultInPointSurface GetCalcResultsInPt()
|
||||
{
|
||||
ResultInPointSurface resultInPoint = new ResultInPointSurface();
|
||||
List<InternalForcesBase> vForces = ListInternalForces;
|
||||
|
||||
resultInPoint[ResultTypeSurface.X] = (CalcPoint as CalcPointSurface).Coord.X;
|
||||
resultInPoint[ResultTypeSurface.Y] = (CalcPoint as CalcPointSurface).Coord.Y;
|
||||
resultInPoint[ResultTypeSurface.Z] = (CalcPoint as CalcPointSurface).Coord.Z;
|
||||
|
||||
IEnumerable<double> vmxx = from ifo in vForces let mxx = (ifo as InternalForcesSurface).MomentMxx select mxx;
|
||||
resultInPoint[ResultTypeSurface.MxxMax] = vmxx.Max();
|
||||
resultInPoint[ResultTypeSurface.MxxMin] = vmxx.Min();
|
||||
|
||||
IEnumerable<double> vmyy = from ifo in vForces let myy = (ifo as InternalForcesSurface).MomentMyy select myy;
|
||||
resultInPoint[ResultTypeSurface.MyyMax] = vmyy.Max();
|
||||
resultInPoint[ResultTypeSurface.MyyMin] = vmyy.Min();
|
||||
|
||||
IEnumerable<double> vmxy = from ifo in vForces let mxy = (ifo as InternalForcesSurface).MomentMxy select mxy;
|
||||
resultInPoint[ResultTypeSurface.MxyMax] = vmxy.Max();
|
||||
resultInPoint[ResultTypeSurface.MxyMin] = vmxy.Min();
|
||||
|
||||
IEnumerable<double> fmxx = from ifo in vForces let fxx = (ifo as InternalForcesSurface).ForceFxx select fxx;
|
||||
resultInPoint[ResultTypeSurface.FxxMax] = fmxx.Max();
|
||||
resultInPoint[ResultTypeSurface.FxxMin] = fmxx.Min();
|
||||
|
||||
IEnumerable<double> fmyy = from ifo in vForces let fyy = (ifo as InternalForcesSurface).ForceFyy select fyy;
|
||||
resultInPoint[ResultTypeSurface.FyyMax] = fmyy.Max();
|
||||
resultInPoint[ResultTypeSurface.FyyMin] = fmyy.Min();
|
||||
|
||||
IEnumerable<double> fmxy = from ifo in vForces let fxy = (ifo as InternalForcesSurface).ForceFxy select fxy;
|
||||
resultInPoint[ResultTypeSurface.FxyMax] = fmxy.Max();
|
||||
resultInPoint[ResultTypeSurface.FxyMin] = fmxy.Min();
|
||||
|
||||
IEnumerable<double> qmxx = from ifo in vForces let qxx = (ifo as InternalForcesSurface).ForceQxx select qxx;
|
||||
resultInPoint[ResultTypeSurface.QxxMax] = qmxx.Max();
|
||||
resultInPoint[ResultTypeSurface.QxxMin] = qmxx.Min();
|
||||
|
||||
IEnumerable<double> qmyy = from ifo in vForces let qyy = (ifo as InternalForcesSurface).ForceQyy select qyy;
|
||||
resultInPoint[ResultTypeSurface.QyyMax] = qmyy.Max();
|
||||
resultInPoint[ResultTypeSurface.QyyMin] = qmyy.Min();
|
||||
|
||||
resultInPoint[ResultTypeSurface.AxxBottom] = AsBottom[DD.X];
|
||||
resultInPoint[ResultTypeSurface.AxxTop] = AsTop[DD.X];
|
||||
|
||||
resultInPoint[ResultTypeSurface.AyyBottom] = AsBottom[DD.Y];
|
||||
resultInPoint[ResultTypeSurface.AyyTop] = AsTop[DD.Y];
|
||||
|
||||
return resultInPoint;
|
||||
}
|
||||
|
||||
public List<InternalForcesBase> ListInternalForces { get; set; }
|
||||
public Geometry Geometry { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
|
||||
public Dictionary<DD, double> AsBottom = new Dictionary<DD, double>() { { DD.X, 0.00 }, { DD.Y, 0.00 } };
|
||||
public Dictionary<DD, double> AsTop = new Dictionary<DD, double>() { { DD.X, 0.00 }, { DD.Y, 0.00 } };
|
||||
public Dictionary<DD, double> MinStiffnes = new Dictionary<DD, double>() { { DD.X, 0.0 }, { DD.Y, 0.0 } };
|
||||
public Dictionary<DD, List<Rebar>> LRebar = new Dictionary<DD, List<Rebar>>() { { DD.X, null }, { DD.Y, null } };
|
||||
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with calculation warnings.
|
||||
/// </summary>
|
||||
public Dictionary<DD, List<string>> DesignWarning { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with additional calculation information.
|
||||
/// </summary>
|
||||
public Dictionary<DD, List<string>> DesignInfo { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets a list of texts with calculation errors.
|
||||
/// </summary>
|
||||
public Dictionary<DD, List<string>> DesignError { get; set; }
|
||||
/// <summary>
|
||||
/// Gets and sets cref="ElementInfo" object.
|
||||
/// </summary>
|
||||
public ElementInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
class WallElement : ElementDataBase
|
||||
{
|
||||
public WallElement(ElementDataBase elementDataBase) : base(elementDataBase)
|
||||
{
|
||||
}
|
||||
|
||||
public ElementInfo Info { get; set; }
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering;
|
||||
using Autodesk.CodeChecking.Concrete;
|
||||
using CodeCheckingConcreteExample.Engine;
|
||||
using CodeCheckingConcreteExample.Concrete;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using DD = CodeCheckingConcreteExample.ConcreteTypes.DimensioningDirection;
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main.Calculation
|
||||
{
|
||||
class WallSection : SurfaceSection
|
||||
{
|
||||
public WallSection(SectionDataBase sectionDataBase) : base(sectionDataBase)
|
||||
{
|
||||
Width = 0.0;
|
||||
Height = 0.0;
|
||||
Geometry = new Geometry();
|
||||
|
||||
ListInternalForces = new List<InternalForcesBase>();
|
||||
MinStiffnes[DD.X] = MinStiffnes[DD.Y] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for code Calculation parameters
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("CalculationParam", "b3004f6e-cf05-4cad-8945-dba92d09372a")]
|
||||
public class CalculationParameter : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Calculation points selection component
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "CalcPointSelector")]
|
||||
[CodeCheckingConcreteExample.UIComponents.CalculationPointsSelector.CalculationPointsSelector(Category = "CalcPointSelector")]
|
||||
public CodeCheckingConcreteExample.UIComponents.CalculationPointsSelector.CalculationPointsSelectorSchema CalculationPointsSelector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates default CalculationParameter
|
||||
/// </summary>
|
||||
public CalculationParameter()
|
||||
{
|
||||
CalculationPointsSelector = new CodeCheckingConcreteExample.UIComponents.CalculationPointsSelector.CalculationPointsSelectorSchema();
|
||||
CalculationPointsSelector.ElementDivisionType = CodeCheckingConcreteExample.UIComponents.CalculationPointsSelector.CalculationPointsSelectorSchema.DivisionType.Points;
|
||||
CalculationPointsSelector.UniformDistribution = 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using CT = CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering.Concrete.ConcreteTypes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Values validator for beam label.
|
||||
/// </summary>
|
||||
public class ValueValidatorBeam : IFieldValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the value.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="field">The field.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="unit">The unit.</param>
|
||||
/// <returns>Information about data validation.</returns>
|
||||
public bool ValidateValue(object entity, string field, object value, DisplayUnitType unit)
|
||||
{
|
||||
if (field == "CreepCoefficient")
|
||||
{
|
||||
return (double)value > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Container for RC beam element material and calculation options
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("LabelBeam", "969f2bcf-b1b6-44c2-94af-f6aeff453705")]
|
||||
public class LabelBeam : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Classification of available forces for beam
|
||||
/// </summary>
|
||||
public enum EnabledInternalForcesForBeam
|
||||
{
|
||||
/// <summary>
|
||||
/// Axial force. The force acting along the element.
|
||||
/// </summary>
|
||||
FX = ConcreteTypes.EnabledInternalForces.FX,
|
||||
/// <summary>
|
||||
/// Shear force. The force acting perpendicular to the element along Z axis.
|
||||
/// </summary>
|
||||
FZ = ConcreteTypes.EnabledInternalForces.FZ,
|
||||
/// <summary>
|
||||
/// Torsional moment.
|
||||
/// </summary>
|
||||
MX = ConcreteTypes.EnabledInternalForces.MX,
|
||||
/// <summary>
|
||||
/// Bending moment. Bending around the Y axis.
|
||||
/// </summary>
|
||||
MY = ConcreteTypes.EnabledInternalForces.MY,
|
||||
}
|
||||
/// <summary>
|
||||
/// Collection of beam simple calculation
|
||||
/// representing calculation options chosen by the user
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "BeamCalculationType")]
|
||||
[EnumControl(Description = "EnabledInternalForces", Category = "CalculationOptions", EnumType = typeof(EnabledInternalForcesForBeam), Presentation = PresentationMode.OptionList, Item = PresentationItem.ImageWithText, ImageSize = ImageSize.Medium, Context = "BeamLabel")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ListValue(Name = "EnabledInternalForces", Localizable = true, LocalizableValue = true)]
|
||||
public List<EnabledInternalForcesForBeam> EnabledInternalForcesBeam { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creep coefficient
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "CreepCoefficient", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Description = "CreepCoefficient", Category = "CalculationOptions", IsVisible = true, IsEnabled = true, Index = -1, Localizable = true, FieldValidator = typeof(ValueValidatorBeam))]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "CreepCoefficient", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public Double CreepCoefficient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Section type object(flanges/no flanges) representing
|
||||
/// option chosen by the user
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty]
|
||||
[EnumControl(Description = "SlabBeamInteraction", Category = "CalculationOptions", Index = -1, EnumType = typeof(ConcreteTypes.BeamSectionType), Presentation = PresentationMode.ToggleButton, Item = PresentationItem.Image, ImageSize = ImageSize.Medium, Context = "BeamLabel")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "SlabBeamInteraction", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public ConcreteTypes.BeamSectionType SlabBeamInteraction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for longitudinal reinforcement
|
||||
///</summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "LongitudinalReinforcement")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "LongitudinalReinforcement")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.SubSchemaElement(LocalizableValue = true, Name = "LongitudinalReinforcement", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema LongitudinalReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for transversal reinforcement
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "TransversalReinforcement")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "TransversalReinforcement")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.SubSchemaElement(LocalizableValue = true, Name = "TransversalReinforcement", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema TransversalReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates default LabelBeam
|
||||
/// </summary>
|
||||
public LabelBeam()
|
||||
{
|
||||
LongitudinalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
CreepCoefficient = 2.0;
|
||||
TransversalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
EnabledInternalForcesBeam = new List<EnabledInternalForcesForBeam>();
|
||||
EnabledInternalForcesBeam.Add(EnabledInternalForcesForBeam.MY);
|
||||
EnabledInternalForcesBeam.Add(EnabledInternalForcesForBeam.FZ);
|
||||
SlabBeamInteraction = ConcreteTypes.BeamSectionType.WithSlabBeamInteraction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transversal calculation type ( compression, bending, excentric bending....)
|
||||
/// </summary>
|
||||
public ConcreteTypes.CalculationType TransversalCalculationType { get { return EnabledInternalForces.GetTransversalCalculationType(); } }
|
||||
|
||||
/// <summary>
|
||||
/// Longitudinal calculation type (shearing, tortion, ...)
|
||||
/// </summary>
|
||||
public ConcreteTypes.CalculationType LongitudinalCalculationType { get { return EnabledInternalForces.GetLongitudinalCalculationType(); } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns EnabledInternalForces based on EnabledInternalForcesBeam
|
||||
/// </summary>
|
||||
public List<ConcreteTypes.EnabledInternalForces> EnabledInternalForces
|
||||
{
|
||||
get
|
||||
{
|
||||
List<ConcreteTypes.EnabledInternalForces> EInternalForces = new List<ConcreteTypes.EnabledInternalForces>();
|
||||
foreach (EnabledInternalForcesForBeam enabledInternalForcesBeam in EnabledInternalForcesBeam)
|
||||
{
|
||||
EInternalForces.Add((EnabledInternalForces)enabledInternalForcesBeam);
|
||||
}
|
||||
return EInternalForces;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+189
@@ -0,0 +1,189 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage.Framework;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Values validator for column label.
|
||||
/// </summary>
|
||||
public class ValueValidatorColumn : IFieldValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the value.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="field">The field.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="unit">The unit.</param>
|
||||
/// <returns>Information about data validation.</returns>
|
||||
public bool ValidateValue(object entity, string field, object value, DisplayUnitType unit)
|
||||
{
|
||||
if (field == "CreepCoefficient")
|
||||
{
|
||||
return (double)value > 0;
|
||||
}
|
||||
|
||||
if (field == "LengthCoefficientY" || field == "LengthCoefficientZ")
|
||||
{
|
||||
return (double)value >= 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Container for RC column element material and calculation options
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("LabelColumn", "68099b9b-ed86-443a-859c-49cb40842a50")]
|
||||
[Categories(new string[] { "CalculationOptions", "Buckling", "LongitudinalReinforcement", "TransversalReinforcement" }, new int[] { 1, 2, 3, 4 })]
|
||||
public class LabelColumn : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of simple calculation type objects
|
||||
/// representing calculation options chosen by the user
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "ColumnCalculationType")]
|
||||
[EnumControl(Description = "EnabledInternalForces", Category = "CalculationOptions", EnumType = typeof(ConcreteTypes.EnabledInternalForces), Presentation = PresentationMode.OptionList, Item = PresentationItem.ImageWithText, ImageSize = ImageSize.Medium, Context = "ColumnLabel")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ListValue(Name = "EnabledInternalForces", Index = 1, Localizable = true, LocalizableValue = true)]
|
||||
public List<ConcreteTypes.EnabledInternalForces> EnabledInternalForces { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creep coefficient
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "CreepCoefficient", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Description = "CreepCoefficient", Category = "CalculationOptions", IsVisible = true, IsEnabled = true, Index = -1, Localizable = true, FieldValidator = typeof(ValueValidatorColumn))]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "CreepCoefficient", Index = 2, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public Double CreepCoefficient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Take into account buckling on direction Y when calculating element
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "BucklingDirectionY")]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.CheckBox(Category = "Buckling", Description = "BucklingDirectionY", IsVisible = true, IsEnabled = true, Index = 2, Localizable = true)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "BucklingDirectionY", Index = 3, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public bool BucklingDirectionY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Value of the buckling coefficietn on direction Y
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "LengthCoefficientY", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Category = "Buckling", Description = "LengthCoefficientY", IsVisible = true, IsEnabled = true, Index = 3, Localizable = true)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "LengthCoefficientY", Index = 4, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public Double LengthCoefficientY { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Structure type on direction Y: Sway or No-sway
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "ColumnStructureTypeY")]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.EnumControl(EnumType = typeof(ConcreteTypes.ColumnStructureType), Presentation = Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.PresentationMode.Combobox, Item = Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.PresentationItem.Text, Category = "Buckling", Description = "ColumnStructureType", IsVisible = true, IsEnabled = true, Index = 4, Localizable = true)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "ColumnStructureType", Index = 5, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public ConcreteTypes.ColumnStructureType ColumnStructureTypeY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Take into account buckling on direction Z when calculating element
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "BucklingDirectionZ")]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.CheckBox(Category = "Buckling", Description = "BucklingDirectionZ", IsVisible = true, IsEnabled = true, Index = 5, Localizable = true)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "BucklingDirectionZ", Index = 6, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public bool BucklingDirectionZ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Value of the buckling coefficietn on direction Z
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "LengthCoefficientZ", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Category = "Buckling", Description = "LengthCoefficientZ", IsVisible = true, IsEnabled = true, Index = 6, Localizable = true)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "LengthCoefficientZ", Index = 7, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public Double LengthCoefficientZ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Structure type on direction Z: Sway or No-sway
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "ColumnStructureTypeZ")]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.EnumControl(EnumType = typeof(ConcreteTypes.ColumnStructureType), Presentation = Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.PresentationMode.Combobox, Item = Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.PresentationItem.Text, Category = "Buckling", Description = "ColumnStructureType", IsVisible = true, IsEnabled = true, Index = 7, Localizable = true)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "ColumnStructureType", Index = 8, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public ConcreteTypes.ColumnStructureType ColumnStructureTypeZ { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for longitudinal reinforcement
|
||||
///</summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "LongitudinalReinforcement")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "LongitudinalReinforcement")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.SubSchemaElement(LocalizableValue = true, Name = "LongitudinalReinforcement", Index = 9, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema LongitudinalReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for transversal reinforcement
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "TransversalReinforcement")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "TransversalReinforcement")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.SubSchemaElement(LocalizableValue = true, Name = "TransversalReinforcement", Index = 10, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema TransversalReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates default LabelColumn
|
||||
/// </summary>
|
||||
public LabelColumn()
|
||||
{
|
||||
LongitudinalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
CreepCoefficient = 2.0;
|
||||
TransversalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
EnabledInternalForces = new List<ConcreteTypes.EnabledInternalForces>();
|
||||
EnabledInternalForces.Add(ConcreteTypes.EnabledInternalForces.MY);
|
||||
EnabledInternalForces.Add(ConcreteTypes.EnabledInternalForces.FX);
|
||||
LengthCoefficientY = 1.0;
|
||||
LengthCoefficientZ = 1.0;
|
||||
BucklingDirectionY = true;
|
||||
BucklingDirectionZ = true;
|
||||
ColumnStructureTypeY = ConcreteTypes.ColumnStructureType.NonSway;
|
||||
ColumnStructureTypeZ = ConcreteTypes.ColumnStructureType.NonSway;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transversal calculation type ( compression, bending, excentric bending....)
|
||||
/// </summary>
|
||||
public ConcreteTypes.CalculationType TransversalCalculationType
|
||||
{
|
||||
get { return EnabledInternalForces.GetTransversalCalculationType(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Longitudinal calculation type (shearing, tortion, ...)
|
||||
/// </summary>
|
||||
public ConcreteTypes.CalculationType LongitudinalCalculationType
|
||||
{
|
||||
get { return EnabledInternalForces.GetLongitudinalCalculationType(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using CT = CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering.Concrete.ConcreteTypes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample
|
||||
{
|
||||
/// <summary>
|
||||
/// Values validator for beam label.
|
||||
/// </summary>
|
||||
public class ValueValidatorFloor : IFieldValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the value.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="field">The field.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="unit">The unit.</param>
|
||||
/// <returns>Information about data validation.</returns>
|
||||
public bool ValidateValue(object entity, string field, object value, DisplayUnitType unit)
|
||||
{
|
||||
if (field == "CreepCoefficient")
|
||||
{
|
||||
return (double)value > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Container for RC floor and slab foundation elements material and calculation options
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("LabelFloor", "7606E4E9-7A81-4975-A231-0052599F6939")]
|
||||
public class LabelFloor : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Classification of available forces for column
|
||||
/// </summary>
|
||||
public enum EnabledInternalForcesForFloor
|
||||
{
|
||||
/// <summary>
|
||||
/// Axial force. The force acting along the element.
|
||||
/// </summary>
|
||||
FX = ConcreteTypes.EnabledInternalForces.FX,
|
||||
/// <summary>
|
||||
/// Bending moment. Bending around the Y axis.
|
||||
/// </summary>
|
||||
MY = ConcreteTypes.EnabledInternalForces.MY,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collection of beam simple calculation
|
||||
/// representing calculation options chosen by the user
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "FloorCalculationType")]
|
||||
[EnumControl(Description = "EnabledInternalForces", Category = "CalculationOptions", EnumType = typeof(EnabledInternalForcesForFloor), Presentation = PresentationMode.OptionList, Item = PresentationItem.ImageWithText, ImageSize = ImageSize.Medium, Context = "FloorLabel")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ListValue(Name = "EnabledInternalForces", Index = 1, Localizable=true, LocalizableValue = true)]
|
||||
public List<EnabledInternalForcesForFloor> EnabledInternalForcesFloor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for primary reinforcement
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "PrimaryRnfSteelParameters")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "PrimaryRnfSteelParameters")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "PrimaryRnfSteelParameters", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema PrimaryReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for secondary reinforcement
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "SecondaryRnfSteelParameters")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "SecondaryRnfSteelParameters")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "SecondaryRnfSteelParameters", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema SecondaryReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creep coefficient
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "CreepCoefficient", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Description = "CreepCoefficient", Category = "CalculationOptions", IsVisible = true, IsEnabled = true, Index = -1, Localizable = true, FieldValidator = typeof(ValueValidatorFloor))]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "CreepCoefficient", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public Double CreepCoefficient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Longitudinal calculation type (shearing, tortion, ...)
|
||||
/// </summary>
|
||||
public ConcreteTypes.CalculationType LongitudinalCalculationType { get { return EnabledInternalForces.GetLongitudinalCalculationType(); } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns EnabledInternalForces based on EnabledInternalForcesFloor
|
||||
/// </summary>
|
||||
public List<ConcreteTypes.EnabledInternalForces> EnabledInternalForces
|
||||
{
|
||||
get
|
||||
{
|
||||
List<ConcreteTypes.EnabledInternalForces> EInternalForces = new List<ConcreteTypes.EnabledInternalForces>();
|
||||
foreach (EnabledInternalForcesForFloor enabledInternalForcesFloor in EnabledInternalForcesFloor)
|
||||
{
|
||||
EInternalForces.Add((ConcreteTypes.EnabledInternalForces)enabledInternalForcesFloor);
|
||||
}
|
||||
return EInternalForces;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates default LabelFloor
|
||||
/// </summary>
|
||||
public LabelFloor()
|
||||
{
|
||||
PrimaryReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
SecondaryReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
CreepCoefficient = 2.0;
|
||||
EnabledInternalForcesFloor = new List<EnabledInternalForcesForFloor>();
|
||||
EnabledInternalForcesFloor.Add(EnabledInternalForcesForFloor.MY);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using CT = CodeCheckingConcreteExample.ConcreteTypes;
|
||||
using Autodesk.Revit.DB.CodeChecking.Engineering.Concrete.ConcreteTypes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes;
|
||||
using Autodesk.Revit.UI.ExtensibleStorage.Framework;
|
||||
|
||||
namespace CodeCheckingConcreteExample
|
||||
{
|
||||
/// <structural_toolkit_2015>
|
||||
|
||||
/// <summary>
|
||||
/// Values validator for beam label.
|
||||
/// </summary>
|
||||
public class ValueValidatorWall : IFieldValidator
|
||||
{
|
||||
/// <summary>
|
||||
/// Validates the value.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="field">The field.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="unit">The unit.</param>
|
||||
/// <returns></returns>
|
||||
public bool ValidateValue(object entity, string field, object value, DisplayUnitType unit)
|
||||
{
|
||||
if (field == "CreepCoefficient")
|
||||
{
|
||||
return (double)value > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Represents labels.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("LabelWall", "47899fc7-3396-4c02-b8a1-98d720d540d2")]
|
||||
public class LabelWall : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Classification of available forces for column
|
||||
/// </summary>
|
||||
public enum EnabledInternalForcesForWall
|
||||
{
|
||||
/// <summary>
|
||||
/// Axial force. Fxx and Fyy.
|
||||
/// </summary>
|
||||
FX = ConcreteTypes.EnabledInternalForces.FX,
|
||||
MX = ConcreteTypes.EnabledInternalForces.MY,
|
||||
}
|
||||
/// <summary>
|
||||
/// Collection of beam simple calculation
|
||||
/// representing calculation options chosen by the user
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "WallCalculationType")]
|
||||
[EnumControl(Description = "EnabledInternalForces", Category = "CalculationOptions", EnumType = typeof(EnabledInternalForcesForWall), Presentation = PresentationMode.OptionList, Item = PresentationItem.ImageWithText, ImageSize = ImageSize.Medium, Context = "WallLabel")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ListValue(Name = "EnabledInternalForces", Index = 1, Localizable=true, LocalizableValue = true)]
|
||||
public List<EnabledInternalForcesForWall> EnabledInternalForcesWall { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for vertical reinforcement
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "VerticalRnfSteelParameters")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "VerticalRnfSteelParameters")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "VerticalRnfSteelParameters", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema VerticalReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rebar parameters component for horizontal reinforcement
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "HorizontalRnfSteelParameters")]
|
||||
[CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParameters(Category = "HorizontalRnfSteelParameters")]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "HorizontalRnfSteelParameters", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema HorizontalReinforcement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creep coefficient
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(FieldName = "CreepCoefficient", Unit = Autodesk.Revit.DB.UnitType.UT_Number, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_GENERAL)]
|
||||
[Autodesk.Revit.UI.ExtensibleStorage.Framework.Attributes.TextBox(Description = "CreepCoefficient", Category = "CalculationOptions", IsVisible = true, IsEnabled = true, Index = -1, Localizable = true, FieldValidator = typeof(ValueValidatorWall))]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ValueWithName(LocalizableValue = true, Name = "CreepCoefficient", Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = true)]
|
||||
public Double CreepCoefficient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Longitudinal calculation type (shearing, tortion, ...)
|
||||
/// </summary>
|
||||
public ConcreteTypes.CalculationType LongitudinalCalculationType { get { return EnabledInternalForces.GetLongitudinalCalculationType(); } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns EnabledInternalForces based on EnabledInternalForcesFloor
|
||||
/// </summary>
|
||||
public List<ConcreteTypes.EnabledInternalForces> EnabledInternalForces
|
||||
{
|
||||
get
|
||||
{
|
||||
List<ConcreteTypes.EnabledInternalForces> EInternalForces = new List<ConcreteTypes.EnabledInternalForces>();
|
||||
foreach (EnabledInternalForcesForWall enabledInternalForcesWall in EnabledInternalForcesWall)
|
||||
{
|
||||
EInternalForces.Add((ConcreteTypes.EnabledInternalForces)enabledInternalForcesWall);
|
||||
}
|
||||
return EInternalForces;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates default LabelWall
|
||||
/// </summary>
|
||||
public LabelWall()
|
||||
{
|
||||
VerticalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
HorizontalReinforcement = new CodeCheckingConcreteExample.UIComponents.RCSteelParameters.RCSteelParametersSchema();
|
||||
CreepCoefficient = 2.0;
|
||||
EnabledInternalForcesWall = new List<EnabledInternalForcesForWall>();
|
||||
EnabledInternalForcesWall.Add(EnabledInternalForcesForWall.FX);
|
||||
EnabledInternalForcesWall.Add(EnabledInternalForcesForWall.MX);
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for RC beam results data
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("ResultBeam", "37824421-6bfb-44a5-b1e7-1d382e5e8ee1")]
|
||||
public class ResultBeam : ResultLinearElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates default ResultBeam
|
||||
/// </summary>
|
||||
public ResultBeam()
|
||||
: base()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for RC column results data
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("ResultColumn", "7952996a-4318-4be9-ac18-9fa090ce8be1")]
|
||||
public class ResultColumn : ResultLinearElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates default ResultColumn
|
||||
/// </summary>
|
||||
public ResultColumn()
|
||||
: base()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for RC floor and slab foundation results data
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("ResultFloor", "1EC6295D-BDED-4B07-8713-45D985339AB3")]
|
||||
public class ResultFloor : ResultSurfaceElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates default ResultFloor
|
||||
/// </summary>
|
||||
public ResultFloor()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for RC linear element results data
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("ResultLinearElement", "94c5ab24-8e77-47a2-b437-750f43451b23")]
|
||||
public class ResultLinearElement : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Collection of values representing element results in raw format
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(Unit = Autodesk.Revit.DB.UnitType.UT_Length, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_METERS)]
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.Attributes.ListValue(Name = "ValuesInPoints", LocalizableValue = false, Level = Autodesk.Revit.DB.ExtensibleStorage.Framework.Documentation.DetailLevel.General, Localizable = false)]
|
||||
public List<Double> ValuesInPointsData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets results in point formatted as a list of ResultInPointLinear elements
|
||||
/// </summary>
|
||||
/// <returns>List of ResultInPointLinear</returns>
|
||||
public List<ResultInPointLinear> GetResultsInPointsCollection()
|
||||
{
|
||||
IEnumerable<ResultTypeLinear> linearResultTypes = Enum.GetValues(typeof(ResultTypeLinear)).OfType<ResultTypeLinear>();
|
||||
|
||||
int numberOfResultTypes = linearResultTypes.Count(),
|
||||
numberOfPoints = ValuesInPointsData.Count / numberOfResultTypes;
|
||||
|
||||
List<ResultInPointLinear> resultsInPoints = new List<ResultInPointLinear>();
|
||||
for (int ptId = 0; ptId < numberOfPoints; ptId++)
|
||||
{
|
||||
resultsInPoints.Add(new ResultInPointLinear(ValuesInPointsData.GetRange(ptId * numberOfResultTypes, numberOfResultTypes)));
|
||||
}
|
||||
|
||||
return resultsInPoints;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates default ResultLinearElement
|
||||
/// </summary>
|
||||
public ResultLinearElement()
|
||||
{
|
||||
ValuesInPointsData = new List<double>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
using CodeCheckingConcreteExample.Utility;
|
||||
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for surface element results data
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("ResultSurface", "37147943-1A9A-44E8-8BAC-20628BC26896")]
|
||||
public class ResultSurfaceElement : Autodesk.Revit.DB.ExtensibleStorage.Framework.SchemaClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of values representing element results in raw format
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(Unit = Autodesk.Revit.DB.UnitType.UT_Length, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_METERS)]
|
||||
public List<Double> ValuesInPointsData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Information that the surface object is multilayer.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty()]
|
||||
public bool MultiLayer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Collection of layer thickness
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty(Unit = Autodesk.Revit.DB.UnitType.UT_Length, DisplayUnit = Autodesk.Revit.DB.DisplayUnitType.DUT_METERS)]
|
||||
public List<Double> StructuralLayersThickness { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Collection of layer materials name
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.SchemaProperty()]
|
||||
public List<String> StructuralLayersMaterialName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Informationa about structural layers for multilayers object
|
||||
/// </summary>
|
||||
/// <returns>List of names and thickness of structural layers</returns>
|
||||
public List<Tuple<string, double>> GetStructuralLayers()
|
||||
{
|
||||
int numberOfLayers = StructuralLayersThickness.Count();
|
||||
if (numberOfLayers != StructuralLayersMaterialName.Count())
|
||||
throw new Exception("Invalid layers properties");
|
||||
|
||||
List<Tuple<string, double>> layers = new List<Tuple<string, double>>();
|
||||
for (int layersId = 0; layersId < numberOfLayers; layersId++)
|
||||
{
|
||||
layers.Add(new Tuple<string, double>(StructuralLayersMaterialName[layersId],StructuralLayersThickness[layersId]));
|
||||
}
|
||||
return layers;
|
||||
}
|
||||
/// <summary>
|
||||
/// Removing information about all structural layers
|
||||
/// </summary>
|
||||
public void ClearStructuralLayers()
|
||||
{
|
||||
StructuralLayersThickness.Clear();
|
||||
StructuralLayersMaterialName.Clear();
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds new structural layer
|
||||
/// </summary>
|
||||
/// <param name="materialName">Material name for layer</param>
|
||||
/// <param name="thickness">Thickness of layer</param>
|
||||
public void AddStructuralLayer(string materialName, double thickness)
|
||||
{
|
||||
StructuralLayersThickness.Add(thickness);
|
||||
StructuralLayersMaterialName.Add(materialName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets results in point formatted as a list of ResultInPointSurface elements
|
||||
/// </summary>
|
||||
/// <returns>List of ResultInPointSurface</returns>
|
||||
public List<ResultInPointSurface> GetResultsInPointsCollection()
|
||||
{
|
||||
IEnumerable<ResultTypeSurface> vType = Enum.GetValues(typeof(ResultTypeSurface)).OfType<ResultTypeSurface>();
|
||||
|
||||
int numberOfValsInPoint = vType.Count(),
|
||||
numberOfPoints = ValuesInPointsData.Count / numberOfValsInPoint;
|
||||
|
||||
List<ResultInPointSurface> resultsInPoints = new List<ResultInPointSurface>();
|
||||
for (int ptId = 0; ptId < numberOfPoints; ptId++)
|
||||
{
|
||||
resultsInPoints.Add(new ResultInPointSurface(ValuesInPointsData.GetRange(ptId * numberOfValsInPoint, numberOfValsInPoint)));
|
||||
}
|
||||
|
||||
return resultsInPoints;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates default ResultSurfaceElement
|
||||
/// </summary>
|
||||
public ResultSurfaceElement()
|
||||
{
|
||||
ValuesInPointsData = new List<double>();
|
||||
StructuralLayersThickness = new List<double>();
|
||||
StructuralLayersMaterialName = new List<string>();
|
||||
MultiLayer = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// (C) Copyright 2003-2013 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Autodesk.Revit.DB.ExtensibleStorage;
|
||||
using Autodesk.Revit.DB;
|
||||
/// <structural_toolkit_2015>
|
||||
namespace CodeCheckingConcreteExample.Main
|
||||
{
|
||||
/// <summary>
|
||||
/// Container for RC wall results data
|
||||
/// </summary>
|
||||
[Autodesk.Revit.DB.ExtensibleStorage.Framework.Attributes.Schema("ResultWall", "31828720-0F98-47B2-BD7E-F4C5C12C43BD")]
|
||||
public class ResultWall : ResultSurfaceElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates default ResultWall
|
||||
/// </summary>
|
||||
public ResultWall()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
/// </structural_toolkit_2015>
|
||||
Reference in New Issue
Block a user