In API_Element there is lockId which should work as bool in offline mode. I tried both with locking and layers but it's always 0. Is there any special function for filling this property or its wrong one?
If locked doesn't indicate layer lock status should go with Layer Index and check its visibility?
Yes, you are right those are the 4 different ways, but the Edit/Lock does not count when the current project is a Teamwork project, and the "Teamwork Lock" does not count when it's a normal (not Teamwork) project. The ACAPI_TeamworkControl_HasConnection function tells whether the currently opened project is a Teamwork project.
- if the element is locked then the value of elem.header.lockId is 1
- the elem.header.lockId is a read-only field, so to lock/unlock an element use ACAPI_Element_Tool with APITool_Lock/APITool_Unlock parameters.
2. Layer Lock
- you can get the index of the element's layer from elem.header.layer and you have to retrieve the layer attribute using ACAPI_Attribute_Get to get the flags of the layer. If the flags of the layer contains APILay_Locked then the layer is locked, so the element is on a locked layer.
- you must modify the element's layer using ACAPI_Attribute_Modify to lock the layer.
3. Teamwork Lock
- your link leads to a good example, so I don't go into the details here.
4. Hotlinked element
- if the element is a member of a hotlink then the elem.header.hotlinkGuid is not APINULLGuid.
Yes, it applies. An element can also be locked if it is on a locked layer (so check the layer attribute as), not just when it is locked directly.
Alternatively, you can use ACAPI_Element_Filter (elemGuid, APIFilt_IsEditable) if you are checking that an element is editable.