How do i change the property name dynamically.
import hm
import hm.entities as ent
import prettytable as pt
model = hm.Model()
Create a collection of all properties in the model
prop_data = []
props = hm.Collection(model, ent.Property)
assem = WHEEL_HOUSE_LHS
compntnm = MUD_TOP
Printing a table of properties and their respective material if exist
for p in props:
prop_name = p.name
prop_cardimage = p.cardimage
if prop_cardimage == "SHELLSECTION":
prop_thickness = p.TK
# Build new name using assembly, component, and thickness
new_name = f"{assem}{compntnm}{prop_thickness}"
p.name = new_name # update property name in HyperMesh
prop_data.append([new_name, prop_cardimage, prop_thickness])
else:
continue
tab = pt.PrettyTable(["Prop Name", "Prop Cardimage", "Prop Thickness"])
tab.add_rows(prop_data)
print(tab)
may i know what is wrong in above code