I have a model with many elements that is classified as ifcbuildingelementproxy (or unclassified as that is the standard of the ifc exporting software aka ifcObject). I have a code that finds all the elements i want to change the classification of, but i cant seem to find a way to change it. What i want to do is to get my script to reclassify all elements whos name begins with "whatever" to IfcWindow instead of IfcBuildingElementProxy.
def re_classify():
ifc_loc='thefile.ifc'
ifcfile = ifcopenshell.open(ifc_loc)
create_guid = lambda: ifcopenshell.guid.compress(uuid.uuid1().hex)
owner_history = ifcfile.by_type("IfcOwnerHistory")[0]
element = ifcfile.by_type("IfcElement")
sets = ifcfile.by_type("IfcPropertySet")
search_word_in_name='M_Muntin'
for e in element:
if e.is_a('IfcBuildingElementProxy'):
if e.Name.startswith(search_word_in_name,0,len(search_word_in_name)):
e.is_a()==e.is_a('IfcWindow') #<--- THIS DOES NOTHING
print (e)
print(e.Name,' - ', e.is_a())
re_classify()
I expect that f.ex
# 13505=IfcBuildingElementProxy('3OAbz$kW1DyuZY2KLwUwkk',#41,'M_Muntin Pattern_2x2:M_Muntin Pattern_2x2:346152',$,'M_Muntin Pattern_2x2',#13504,#13499,'346152',$)
will show
# 13505=IfcWindow('3OAbz$kW1DyuZY2KLwUwkk',#41,'M_Muntin Pattern_2x2:M_Muntin Pattern_2x2:346152',$,'M_Muntin Pattern_2x2',#13504,#13499,'346152',$)