/// <summary> /// Sets the Autodesk.Revit.DB.MaterialFunctionAssignment of the layer at the specified index. /// </summary> /// <param name="compoundStructure">A CompoundStructure</param> /// <param name="layerIndex">Index of the layer</param> /// <param name="layerFunction">The material function of the layer</param> /// <returns name="compoundStructure">The modifed CompoundStructure</returns> public static CompoundStructure SetLayerFunction(CompoundStructure compoundStructure, int layerIndex, revitDB.MaterialFunctionAssignment layerFunction) { compoundStructure.internalCompoundStructure.SetLayerFunction(layerIndex, layerFunction); return(compoundStructure); }
/// <summary> /// Sets the properties of a layer at the specified index in the CompoundStructure. /// </summary> /// <param name="compoundStructure">The CompoundStructure to modify.</param> /// <param name="layerIndex">Index of the layer to be modified.</param> /// <param name="width">Width of the layer.</param> /// <param name="layerFunction">Autodesk.Revit.DB.MaterialFunctionAssignment enumeration of the layer.</param> /// <param name="material">Autodesk.Revit.DB.Materials of the layer. Dynamo wrapped Revit.Material objects will not work.</param> /// <returns name="compoundStructure">The modified CompoundStructure.</returns> public static CompoundStructure SetLayer(CompoundStructure compoundStructure, int layerIndex, double width, revitDB.MaterialFunctionAssignment layerFunction, revitDB.Material material) { CompoundStructure.SetLayerWidth(compoundStructure, layerIndex, width); CompoundStructure.SetLayerFunction(compoundStructure, layerIndex, layerFunction); CompoundStructure.SetLayerMaterial(compoundStructure, layerIndex, material); return(compoundStructure); }
/// <summary> /// Returns the properties of a Autodesk.Revit.DB.CompoundStructureLayer as a dictionary. /// </summary> /// <param name="layer">Autodesk.Revit.DB.CompoundStructureLayer</param> /// <param name="doc">Autodesk.Revit.DB.Document</param> /// <returns></returns> internal static cg.Dictionary <string, object> _RevitLayerToDictionary(revitCSLayer layer, revitDoc doc) { double width = layer.Width; revitDB.MaterialFunctionAssignment layerFunction = layer.Function; revitDB.Material material = (revitDB.Material)doc.GetElement(layer.MaterialId); return(new cg.Dictionary <string, object> { { "Width", width }, { "Layer Function", layerFunction }, { "Material", material } }); }
/// <summary> /// Creates a new layer at the specified index in the CompoundStructure. /// </summary> /// <param name="compoundStructure">The CompoundStructure to modify.</param> /// <param name="layerIndex">Index of the layer to be inserted.</param> /// <param name="width">Width of the layer.</param> /// <param name="layerFunction">Autodesk.Revit.DB.MaterialFunctionAssignment enumeration of the layer.</param> /// <param name="material">Autodesk.Revit.DB.Materials of the layer. Dynamo wrapped Revit.Material objects will not work.</param> /// <returns name="compoundStructure">The modified CompoundStructure.</returns> public static CompoundStructure InsertLayerAtIndex(CompoundStructure compoundStructure, int layerIndex, double width, revitDB.MaterialFunctionAssignment layerFunction, revitDB.Material material) { revitCSLayer layer = new revitCSLayer(width, layerFunction, material.Id); cg.IList <revitCSLayer> layers = compoundStructure.internalCompoundStructure.GetLayers(); layers.Insert(layerIndex, layer); compoundStructure.internalCompoundStructure.SetLayers(layers); return(compoundStructure); }
/// <summary> /// Creates a CompoundStructureLayer from properties of the layer. /// </summary> /// <param name="width">Width of the layer.</param> /// <param name="layerFunction">Autodesk.Revit.DB.MaterialFunctionAssignment enumeration of the layer.</param> /// <param name="materialId">The Element ID of the material for the layer.</param> /// <returns name="layer">A CompoundStructureLayer element.</returns> public static revitCSLayer CompoundStructureLayerByList(double width, revitDB.MaterialFunctionAssignment layerFunction, revitDB.ElementId materialId) { return(new revitCSLayer(width, layerFunction, materialId)); }