28.02.2024 - 10:10
I want to copy the attribute from one object to another, this does work for all Enum types but for this one not. For this, I readout the attribute list of object 1 and set the attr_list for object 2 like:
attr_list.add_attribute(attr_id, attr_value) # 209, "Straßen, Wege, Plätze"
This will not work and leave the attribute unset in the attribute UI.
Reading out the index of this Enum like:
value_list = AllplanBaseElements.AttributeService.GetEnumValues(doc, attr_id) index = value_list.index(attr_value)will give me "68".
This is strage because the AttributeManager say it should be "80".
and if I set
attr_list.add_attribute(attr_id, attr_enum_index) # 209, 80This works! The Attribute is set correct in the UI....
What I am missing, or what could cause this problem?