<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Locked Element in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260163#M3436</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;I'm investigating the locking system. As far as I know, there are 4 different ways to make elements unable to modify in AC:&lt;BR /&gt;- Edit/Lock&lt;BR /&gt;- Layer Lock&lt;BR /&gt;- Teamwork Lock&lt;BR /&gt;- Being a member of hotlink&lt;BR /&gt;&lt;BR /&gt;I found a detailed example of Teamwork lock here but what about nonTeamwork files?&lt;BR /&gt;&lt;A href="https://Archicad-talk.Graphisoft.com/viewtopic.php?f=23&amp;amp;t=48644&amp;amp;p=240838&amp;amp;hilit=lock#p24083" target="_blank" rel="noopener"&gt;https://Archicad-talk.Graphisoft.com/viewtopic.php?f=23&amp;amp;t=48644&amp;amp;p=240838&amp;amp;hilit=lock#p24083&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;If locked doesn't indicate layer lock status should go with Layer Index and check its visibility?&lt;/DIV&gt;</description>
    <pubDate>Wed, 05 Oct 2022 11:31:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-05T11:31:57Z</dc:date>
    <item>
      <title>Locked Element</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260163#M3436</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I'm investigating the locking system. As far as I know, there are 4 different ways to make elements unable to modify in AC:&lt;BR /&gt;- Edit/Lock&lt;BR /&gt;- Layer Lock&lt;BR /&gt;- Teamwork Lock&lt;BR /&gt;- Being a member of hotlink&lt;BR /&gt;&lt;BR /&gt;I found a detailed example of Teamwork lock here but what about nonTeamwork files?&lt;BR /&gt;&lt;A href="https://Archicad-talk.Graphisoft.com/viewtopic.php?f=23&amp;amp;t=48644&amp;amp;p=240838&amp;amp;hilit=lock#p24083" target="_blank" rel="noopener"&gt;https://Archicad-talk.Graphisoft.com/viewtopic.php?f=23&amp;amp;t=48644&amp;amp;p=240838&amp;amp;hilit=lock#p24083&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;If locked doesn't indicate layer lock status should go with Layer Index and check its visibility?&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Oct 2022 11:31:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260163#M3436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-05T11:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Locked Element</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260164#M3437</link>
      <description>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.&lt;BR /&gt;
&lt;BR /&gt;
1. Edit/Lock&lt;BR /&gt;
- if the element is locked then the value of elem.header.lockId is 1&lt;BR /&gt;
- 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.&lt;BR /&gt;
2. Layer Lock&lt;BR /&gt;
- 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.&lt;BR /&gt;
- you must modify the element's layer using ACAPI_Attribute_Modify to lock the layer.&lt;BR /&gt;
3. Teamwork Lock&lt;BR /&gt;
- your link leads to a good example, so I don't go into the details here.&lt;BR /&gt;
4. Hotlinked element&lt;BR /&gt;
- if the element is a member of a hotlink then the elem.header.hotlinkGuid is not APINULLGuid.</description>
      <pubDate>Thu, 08 Nov 2018 16:54:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260164#M3437</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2018-11-08T16:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Locked Element</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260165#M3438</link>
      <description>Hi!&lt;BR /&gt;
Does the API_Elem_Head.lockId logic still apply for AC21 &amp;amp; AC22? I am trying to get the locked state of elements in a model that isn't using Teamwork, but lockId stays 0 all the time.&lt;BR /&gt;
Br,&lt;BR /&gt;
Lars</description>
      <pubDate>Wed, 13 Nov 2019 16:52:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260165#M3438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-13T16:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Locked Element</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260166#M3439</link>
      <description>Hi Lars,&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
Alternatively, you can use ACAPI_Element_Filter (elemGuid, APIFilt_IsEditable) if you are checking that an element is editable.&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
      <pubDate>Mon, 02 Dec 2019 12:56:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Locked-Element/m-p/260166#M3439</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2019-12-02T12:56:34Z</dc:date>
    </item>
  </channel>
</rss>

