@@ -1859,72 +1859,6 @@ def create_explicit_type(self, ifc_class, name, representation_3d, representatio
18591859 ifcopenshell .api .project .assign_declaration (self .file , definitions = [element ], relating_context = self .library )
18601860 return element
18611861
1862- def create_layer_set_type (self , name , data ):
1863- element = ifcopenshell .api .root .create_entity (self .file , ifc_class = data ["type" ], name = name )
1864- element .Description = data ["Description" ]
1865- rel = ifcopenshell .api .material .assign_material (self .file , products = [element ], type = "IfcMaterialLayerSet" )
1866- layer_set = rel .RelatingMaterial
1867- for layer_data in data ["Layers" ]:
1868- layer = ifcopenshell .api .material .add_layer (
1869- self .file , layer_set = layer_set , material = self .materials [layer_data [1 ]]["ifc" ]
1870- )
1871- layer .Name = layer_data [0 ]
1872- layer .LayerThickness = layer_data [2 ]
1873- ifcopenshell .api .project .assign_declaration (self .file , definitions = [element ], relating_context = self .library )
1874- return element
1875-
1876- def create_layer_type (self , ifc_class , name , thickness ):
1877- element = ifcopenshell .api .root .create_entity (self .file , ifc_class = ifc_class , name = name )
1878- rel = ifcopenshell .api .material .assign_material (self .file , products = [element ], type = "IfcMaterialLayerSet" )
1879- layer_set = rel .RelatingMaterial
1880- layer = ifcopenshell .api .material .add_layer (
1881- self .file , layer_set = layer_set , material = self .materials ["TBD" ]["ifc" ]
1882- )
1883- layer .LayerThickness = thickness
1884- ifcopenshell .api .project .assign_declaration (self .file , definitions = [element ], relating_context = self .library )
1885- return element
1886-
1887- def create_profile_type (self , ifc_class , name , profile ):
1888- element = ifcopenshell .api .root .create_entity (self .file , ifc_class = ifc_class , name = name )
1889- rel = ifcopenshell .api .material .assign_material (self .file , products = [element ], type = "IfcMaterialProfileSet" )
1890- profile_set = rel .RelatingMaterial
1891- material_profile = ifcopenshell .api .material .add_profile (
1892- self .file ,
1893- profile_set = profile_set ,
1894- material = self .material ,
1895- # material=self.materials["TBD"]["ifc"]
1896- )
1897- ifcopenshell .api .material .assign_profile (self .file , material_profile = material_profile , profile = profile )
1898- ifcopenshell .api .project .assign_declaration (self .file , definitions = [element ], relating_context = self .library )
1899-
1900- def create_type (self , ifc_class , name , representations ):
1901- element = ifcopenshell .api .root .create_entity (self .file , ifc_class = ifc_class , name = name )
1902- for rep_name , obj_name in representations .items ():
1903- obj = bpy .data .objects .get (obj_name )
1904- representation = ifcopenshell .api .geometry .add_representation (
1905- self .file ,
1906- context = self .representations [rep_name ],
1907- blender_object = obj ,
1908- geometry = obj .data ,
1909- total_items = max (1 , len (obj .material_slots )),
1910- )
1911- styles = []
1912- for slot in obj .material_slots :
1913- style = ifcopenshell .api .style .add_style (self .file , name = slot .material .name )
1914- ifcopenshell .api .style .add_surface_style (
1915- self .file ,
1916- style = style ,
1917- ifc_class = "IfcSurfaceStyleRendering" ,
1918- attributes = tool .Style .get_surface_rendering_attributes (slot .material ),
1919- )
1920- styles .append (style )
1921- if styles :
1922- ifcopenshell .api .style .assign_representation_styles (
1923- self .file , shape_representation = representation , styles = styles
1924- )
1925- ifcopenshell .api .geometry .assign_representation (self .file , product = element , representation = representation )
1926- ifcopenshell .api .project .assign_declaration (self .file , definitions = [element ], relating_context = self .library )
1927-
19281862
19291863if __name__ == "__main__" :
19301864 path = Path (__file__ ).parents [1 ] / "bonsai/bim/data/libraries"
0 commit comments