<?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 Re: [SOLVED] How to get the Reserved status of an Attribute in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257337#M5528</link>
    <description>Thanks Tibor.&lt;BR /&gt;
&lt;BR /&gt;
I am interested in getting the reserved status of a specific Surface.  I cannot see how that is possible via the API.  Perhaps I am missing something.  &lt;BR /&gt;
&lt;BR /&gt;
How can ACAPI_TeamworkControl_GetLockableStatus () be used for a specific surface pls?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Paul</description>
    <pubDate>Wed, 08 Apr 2015 10:39:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-08T10:39:14Z</dc:date>
    <item>
      <title>[SOLVED] How to get the Reserved status of an Attribute</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257334#M5525</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi - how can I cn the Reserve/Lock status of an Attribute (a Surface in particular). The following code only seems to work for Elements, not Attributes.&lt;BR /&gt;
&lt;PRE&gt;API_LockableStatus lockableStatus = ACAPI_TeamworkControl_GetLockableStatus (attrib.header.guid);&lt;/PRE&gt;
Thanks&lt;BR /&gt;&lt;BR /&gt;Paul&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:28:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257334#M5525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Reserved status of an Attribute</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257335#M5526</link>
      <description>Bumping to hopefully get a reply pls.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Paul</description>
      <pubDate>Tue, 07 Apr 2015 00:35:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257335#M5526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-07T00:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Reserved status of an Attribute</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257336#M5527</link>
      <description>Hi Paul, &lt;BR /&gt;
 &lt;BR /&gt;
Teamwork_Control example Add-On shows how to handle reservation of elements and attributes too. &lt;BR /&gt;
 &lt;BR /&gt;
Here is the solution for your problem: (copied from Teamwork_Control example Add-On) 
&lt;PRE&gt;// ---------------------------------- Types ------------------------------------ 
 
#define CitiesGuid				(APIGuidFromString ("5D8068E2-7430-4871-9D67-E06001F256A1")) 
#define CompositesGuid			(APIGuidFromString ("A36401CC-77B1-4410-BCEB-A7684706A17F")) 
#define FavoritesGuid			(APIGuidFromString ("F97013BD-662E-42a1-A749-9C73CD2D0790")) 
#define FillTypesGuid			(APIGuidFromString ("4C036A66-C2FF-4c3b-9FF4-F45A810B5F84")) 
#define LayerSettingsGuid		(ACAPI_TeamworkControl_FindLockableObjectSet ("LayerSettingsDialog")) 
#define LineTypesGuid			(APIGuidFromString ("702A8569-EA8F-4de8-900C-696980FB13D6")) 
#define MarkupStylesGuid		(APIGuidFromString ("156BCF98-CFA6-4be0-BC2C-8252D640A9FB")) 
#define SurfacesGuid			(APIGuidFromString ("5B6A4F99-C72D-4811-90A5-6D696E1AB51F")) 
#define MEPSystemsGuid			(APIGuidFromString ("258B2630-3098-48ea-8923-F712214FBDAE")) 
#define ModelViewOptionsGuid	(APIGuidFromString ("13E263C8-692B-494b-84E3-2B4BD0A77332")) 
#define OperationProfilesGuid	(APIGuidFromString ("0E6DC7E2-5AFC-4309-AB31-2A790CF57A53")) 
#define PenTablesGuid			(APIGuidFromString ("08B4B9BB-3DD6-4ea1-A084-80D80B8B7742")) 
#define ProfilesGuid			(APIGuidFromString ("4779D92D-ACFB-429d-91E5-1D585B9D2CE5")) 
#define ProjectInfoGuid			(APIGuidFromString ("D13F8A89-2AEC-4c32-B04E-85A5393F9C47")) 
#define ProjectPreferencesGuid	(ACAPI_TeamworkControl_FindLockableObjectSet ("PreferencesDialog")) 
#define ZoneCategoriesGuid		(APIGuidFromString ("B83F2FD1-0AD4-4c41-A8EB-6D7558B0A120")) 
#define BuildingMaterialsGuid	(APIGuidFromString ("50477294-5E20-4349-920B-EFC18BF54A0C")) 
 
 
// ============================================================================= 
// 
// Teamwork Reservation function for Attribute sets 
// 
// ============================================================================= 
 
void	ReserveOrRelease_Attributes (const API_Guid&amp;amp; objectSetGuid, const GS::UniString&amp;amp; objectSetName, bool showAlert = true) 
{ 
	bool hasCreateRight = ACAPI_TeamworkControl_HasCreateRight (objectSetGuid); 
	bool hasDeleteModifyRight = ACAPI_TeamworkControl_HasDeleteModifyRight (objectSetGuid); 
	if (!hasCreateRight &amp;amp;&amp;amp; !hasDeleteModifyRight) { 
		GS::UniString reportString ("You have insufficient privileges to modify "); 
		reportString.Append (objectSetName); 
		ACAPI_WriteReport (reportString.ToCStr ().Get (), true); 
		return; 
	} 
 
	GS::UniString reportString (objectSetName); 
	GS::PagedArray&amp;lt;GS::UniString&amp;gt; conflicts; 
	API_LockableStatus lockableStatus = ACAPI_TeamworkControl_GetLockableStatus (objectSetGuid, &amp;amp;conflicts); 
 
	if (lockableStatus == APILockableStatus_Free) {					// Free for Reservation - let's reserve it 
		GSErrCode errCode = ACAPI_TeamworkControl_ReserveLockable (objectSetGuid, &amp;amp;conflicts); 
		if (errCode == NoError) 
			reportString.Append (" - Reservation succeeded"); 
		else 
			reportString.Append (" - Reservation failed"); 
 
		lockableStatus = ACAPI_TeamworkControl_GetLockableStatus (objectSetGuid, &amp;amp;conflicts); 
 
	} else if (lockableStatus == APILockableStatus_Editable) {		// Editable - let's release it 
		GSErrCode errCode = ACAPI_TeamworkControl_ReleaseLockable (objectSetGuid); 
		if (errCode == NoError) 
			reportString.Append (" - Release succeeded"); 
		else 
			reportString.Append (" - Release failed"); 
 
		lockableStatus = ACAPI_TeamworkControl_GetLockableStatus (objectSetGuid, &amp;amp;conflicts); 
	} 
 
	reportString.Append ("\n  Teamwork status: "); 
	switch (lockableStatus) { 
		case APILockableStatus_Free:			reportString.Append ("Free for Reservation"); 
												break; 
 
		case APILockableStatus_Editable:		reportString.Append ("Editable"); 
												break; 
 
		case APILockableStatus_Locked:			if (conflicts.IsEmpty ()) { 
													reportString.Append ("Locked by other member"); 
												} else { 
													reportString.Append ("Locked by "); 
													reportString.Append (conflicts[0]); 
												} 
												break; 
 
		case APILockableStatus_NotAvailable:	reportString.Append ("Not available"); 
												break; 
 
		case APILockableStatus_NotExist:		reportString.Append ("Not exist"); 
												break; 
	} 
 
	ACAPI_WriteReport (reportString.ToCStr ().Get (), showAlert); 
}		// ReserveOrRelease_Attributes 
 
 
// ----------------------------------------------------------------------------- 
// 
// Few examples to use: 
// 
// ----------------------------------------------------------------------------- 
 
ReserveOrRelease_Attributes (LayerSettingsGuid,		"Layer Settings"); 
ReserveOrRelease_Attributes (LineTypesGuid,			"Line Types"); 
ReserveOrRelease_Attributes (FillTypesGuid,			"Fill Types"); 
ReserveOrRelease_Attributes (CompositesGuid,		"Composites"); 
ReserveOrRelease_Attributes (SurfacesGuid,			"Surfaces");&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Wed, 08 Apr 2015 07:28:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257336#M5527</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-04-08T07:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] How to get the Reserved status of an Attribute</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257337#M5528</link>
      <description>Thanks Tibor.&lt;BR /&gt;
&lt;BR /&gt;
I am interested in getting the reserved status of a specific Surface.  I cannot see how that is possible via the API.  Perhaps I am missing something.  &lt;BR /&gt;
&lt;BR /&gt;
How can ACAPI_TeamworkControl_GetLockableStatus () be used for a specific surface pls?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Paul</description>
      <pubDate>Wed, 08 Apr 2015 10:39:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257337#M5528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-08T10:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] How to get the Reserved status of an Attribute</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257338#M5529</link>
      <description>&lt;BLOCKQUOTE&gt;paulk wrote:&lt;BR /&gt;How can ACAPI_TeamworkControl_GetLockableStatus () be used for a specific surface pls?&lt;/BLOCKQUOTE&gt;
Reservation status belongs to an Attribute set, not a specific attribute.&lt;BR /&gt;
So it's not possible to lock only one specific attribute. Instead of that you should lock the related attribute set.&lt;BR /&gt;
&lt;BR /&gt;
You can't lock only one specific surface on the ArchiCAD UserInterface also, can you?</description>
      <pubDate>Wed, 08 Apr 2015 10:48:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257338#M5529</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-04-08T10:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] How to get the Reserved status of an Attribute</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257339#M5530</link>
      <description>&lt;BLOCKQUOTE&gt;Reservation status belongs to an Attribute set, not a specific attribute.&lt;BR /&gt;
So it's not possible to lock only one specific attribute. Instead of that you should lock the related attribute set.&lt;BR /&gt;
&lt;BR /&gt;
You can't lock only one specific surface on the ArchiCAD UserInterface also, can you?&lt;/BLOCKQUOTE&gt;Yes, you are right.  My understanding of how reserving worked was wrong.  Thank you for resolving this.&lt;BR /&gt;
&lt;BR /&gt;
Paul</description>
      <pubDate>Wed, 08 Apr 2015 11:40:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-How-to-get-the-Reserved-status-of-an-Attribute/m-p/257339#M5530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-08T11:40:17Z</dc:date>
    </item>
  </channel>
</rss>

