Ejemplo n.º 1
0
        private void CreateMaterialLayers(IBimBuildingElementType tType, XbimBuildingElementType sType)
        {
            foreach (XbimMaterialLayer layer in sType.MaterialLayers)
            {
                string matName = layer.Material.Name;
                
                IBimMaterial material = Target.GetMaterial(matName);
                if (material == null) material = Source.MaterialHelper.Convert(layer.Material);

                int layerIndex = sType.MaterialLayers.IndexOf(layer);
                tType.AddMaterialLayer(material, layer.Thickness, false, sType.GetMaterialFunction(layerIndex));
            }
        }
Ejemplo n.º 2
0
        private IBimBuildingElementType BaseConversion(IBimBuildingElementType tType, XbimBuildingElementType sType)
        {

            //set guid
            tType.GlobalId = sType.Guid;

            //set material layers if it exists in the object and object has appropriate type
            CreateMaterialLayers(tType, sType);

            //parameters
            PropertiesHelper.Convert(tType.Properties, sType.Properties);

            //add converted element to the stack of converted elements
            Source.AddConvertedObject(sType);

            return tType;


        }
Ejemplo n.º 3
0
 public IBimBuildingElementType ConvertSlabType(IBimBuildingElementType type)
 {
     XbimSlabType sType = type as XbimSlabType;
     if (sType == null) throw new ArgumentException("Unexpected type");
     CheckName(sType);
     IBimBuildingElementType tType = Target.NewSlabType(sType.Name, sType.Description, sType.PredefinedType);
     return BaseConversion(tType, sType);
 }
Ejemplo n.º 4
0
 public IBimBuildingElementType ConvertCoveringType(IBimBuildingElementType type)
 {
     XbimCoveringType sType = type as XbimCoveringType;
     if (sType == null) throw new ArgumentException("Unexpected type");
     CheckName(sType);
     IBimBuildingElementType tType = Target.NewCeilingType(sType.Name, sType.Description);
     return BaseConversion(tType, sType);
 } 
Ejemplo n.º 5
0
 public IBimBuildingElementType ConvertWindowType(IBimBuildingElementType type)
 {
     XbimWindowStyle sType = type as XbimWindowStyle;
     if (sType == null) throw new ArgumentException("Unexpected type");
     CheckName(sType);
     IBimBuildingElementType tType = Target.NewWindowType(sType.Name, sType.Description, sType.ConstructionType, sType.OperationType);
     return BaseConversion(tType, sType);
 }