mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-09 21:23:32 +00:00
integrate Revit 2025 SDK
This commit is contained in:
-135
@@ -1,135 +0,0 @@
|
||||
//
|
||||
// (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>
|
||||
-130
@@ -1,130 +0,0 @@
|
||||
//
|
||||
// (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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user