我也尝试将带有变量的文本追加到列表中。问题是当我添加文本句子和变量后,结果也被添加到列表中。似乎太松散了。
我该如何使用顶部图片之类的附加内容,也获得底部图片之类的列表。
# Properties
def create_pset():
file = "Parameter_template.txt"
antall_linjer = 0
global index
index = 0
#åpner fil
with open(file, "r") as f:
data = f.readlines()
#Counts lines in .txt file
for parametere in data:
antall_linjer += len(parametere[0])
if "Pset_KS" not in myset:
print("Pset lages")
property_values = []
while index < antall_linjer:
property_values.append(ifcfile.createIfcPropertySingleValue(data[index][:-1], data[index][:-1],ifcfile.create_entity("IfcBoolean", False),None),)
index += 1
print(property_values)
for space in spaces:
property_values
property_set = ifcfile.createIfcPropertySet(create_guid(), owner_history, "Pset_KS", str(space.Name), property_values)
ifcfile.createIfcRelDefinesByProperties(create_guid(), owner_history, None, None, [space], property_set)
ifcfile.write(fil)
else:
print("Pset finnes")
sg.PopupError("Pset er allerede oprettet i modell.")
sys.exit()
create_pset()