Hi there,
I am currently trying to automate the creation of a set of attributes to be assigned to the Building structure so that they can be directly connected to the IfcBuilding entity when exporting the model to IFC.
I have created specific attributes using "AllplanBaseEle.AttributeService.AddUserAttribute()" and then try to assign them using "AllplanBaseElements.ProjectAttributeService.ChangeAttributesFromCurrentProject()", but this doesn't seem to work.
The newly created attribute is not listed by the line "AllplanBaseElements.ProjectAttributeService.GetAttributesFromCurrentProject()". Furthermore, when I check the attributes using the GUI, these are not listed under "Building structure attributes".
I am guessing the project attributes and attributes assigned to the Building structure are not the same thing. Nonetheless, I am not seeing another way of getting this done. Please note the short script below.
svc = AllplanBaseEle.AttributeService vec = AllplanUtil.VecStringList() new_id = svc.AddUserAttribute( self.document, svc.AttributeType.String, "KUBA_ALG Id Bauwerk_PR", "Empty|Empty", 0.0, 0.0, "", svc.AttributeControlType.ComboBoxFixed, vec ) TestAtt=[(new_id,"Empty")] AllplanBaseElements.ProjectAttributeService.ChangeAttributesFromCurrentProject(TestAtt,self.document)
Let me know if there is any particularity about Project attributes that I am missing.
Cheers,