// // (C) Copyright 2003-2007 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.Text; using System.ComponentModel; using Autodesk.Revit; using Autodesk.Revit.Elements; using Autodesk.Revit.Parameters; using Autodesk.Revit.Enums; namespace Revit.SDK.Samples.Materials.CS { /// /// derived class of MaterialParameters /// public class MaterialWoodParameters : MaterialParameters { private MaterialWood m_materialWood;// reference to MaterialWood /// /// original Type : Double /// public string Bending { get { return DoubleToString(m_materialWood.Bending, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.Bending = newValue; } } } /// /// original Type : Double /// public string CompressionParallelToGrain { get { return DoubleToString(m_materialWood.CompressionParallel, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.CompressionParallel = newValue; } } } /// /// original Type : Double /// public string CompressionPerpendicularToGrain { get { return DoubleToString(m_materialWood.CompressionPerpendicular, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.CompressionPerpendicular = newValue; } } } /// /// original Type : string /// public string Grade { get { return m_materialWood.Grade; } set { m_materialWood.Grade = value; } } /// /// original Type : Double /// public string PoissonRatio { get { return DoubleToString(m_materialWood.PoissonModulus, UnitType.No); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.No)) { m_materialWood.PoissonModulus = newValue; } } } /// /// original Type : Double /// public string ShearModulus { get { return DoubleToString(m_materialWood.ShearModulus, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.ShearModulus = newValue; } } } /// /// original Type : Double /// public string ShearParallelToGrain { get { return DoubleToString(m_materialWood.ShearParallel, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.ShearParallel = newValue; } } } /// /// original Type : Double /// public string TensionPerpendicularToGrain { get { return DoubleToString(m_materialWood.ShearPerpendicular, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.ShearPerpendicular = newValue; } } } /// /// original Type : string /// public string Species { get { return m_materialWood.Species; } set { m_materialWood.Species = value; } } /// /// original Type : Double /// public string ThermalExpansionCoefficient { get { return DoubleToString(m_materialWood.ThermalExpansionCoefficient, UnitType.Temperature); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Temperature)) { m_materialWood.ThermalExpansionCoefficient = newValue; } } } /// /// original Type : Double /// public string UnitWeight { get { return DoubleToString(m_materialWood.UnitWeight, UnitType.UnitWeight); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.UnitWeight)) { m_materialWood.UnitWeight = newValue; } } } /// /// original Type : Double /// public string YoungModulus { get { return DoubleToString(m_materialWood.YoungModulus, UnitType.Stress); } set { double newValue; if (StringToDouble(value, out newValue, UnitType.Stress)) { m_materialWood.YoungModulus = newValue; } } } /// /// MaterialWoodParameters's constructor /// /// a instance of MaterialWood public MaterialWoodParameters(MaterialWood materialWood) : base(materialWood) { m_materialWood = materialWood; } } }