icon

Blocking attributes & ifc ID handling


Hi there,

I am currently looking into a way to block some user-defined attributes. Meaning restricting editing after generation with the API. Is this feature available somehow?

Furthermore, is there a way to assign the attribute ifc ID to an element through the API? This is easily achievable with the user Interface but not so much through the API.

Looking forward to hearing from you.

Cheers,
Nery

Show most helpful answer Hide most helpful answer

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

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

Hi Bart,

Thank your for your prompt reply.
One of these days I am going to give your reverse Engineering suggestion a try.

Regarding the Ifc ID - yes, one cannot modify the attribute through the UI. But one can use the UI to assign the Ifc ID to an element before exporting to IFC. Here, I would like to know if there is a way to assign the ifc ID to an element using the API (without having to modify it).

Cheers,
Nery