Hi,
Currently API does not allow to create an attribute definition, that would make the attribute unchangeable. Implementing it is planned, but not anytime soon. To achieve your goal without API, your script would have to edit the XML file (AttributeDefinitionCollection...xml) containing the attribute definition of your attribute by changing the flags _Modify_ and _Visible_ to:
<AttributeDefinition>
...
<Modify>false</Modify>
<Visible>true</Visible>
</AttributeDefinition>
But I don't think, this is easily doable - you have to first reliably establish, where is the XML file with your definition (among project or office resources), parse it, modify and serialize back to XML. Could be tricky. And it's technically reverse engineering, not best practice
Regarding Ifc ID - I don't think, you can set that with ALLPLAN UI. It's an attribute managed entirely by ALLPLAN. I didn't found a way to modify it with UI.
Maybe you mean another attribute?
Cheers,
Bart