<?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 Change Wall parameters through ACAPI_Element_Change in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128191#M5873</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I would like to change the volume (height,width,length), and the filler material of a wall. How is it possible through ACAPI_Element_Change, currently I have the API_Guid both GSGuid of an element?&lt;BR /&gt;&lt;BR /&gt;Please also attend some example code to start with if possible.&lt;BR /&gt;&lt;BR /&gt;Thank you: Andor&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 14:36:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-01T14:36:17Z</dc:date>
    <item>
      <title>Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128191#M5873</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I would like to change the volume (height,width,length), and the filler material of a wall. How is it possible through ACAPI_Element_Change, currently I have the API_Guid both GSGuid of an element?&lt;BR /&gt;&lt;BR /&gt;Please also attend some example code to start with if possible.&lt;BR /&gt;&lt;BR /&gt;Thank you: Andor&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 14:36:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128191#M5873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T14:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128192#M5874</link>
      <description>This is my current code (almost the same as in the documentation), but it does not work. Any help is appreciated.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;void changeWall(const API_Guid* ArchAPIGUID){
	API_Element         element, mask;
	API_Coord           c1, c2;
	GSErrCode           err = NoError;
	double				height;
	double				width;

	BNZeroMemory (&amp;amp;element, sizeof (API_Element));
	API_Guid currAPIGuid = *ArchAPIGUID;
	element.header.guid = currAPIGuid;
	err = ACAPI_Element_Get (&amp;amp;element);
	if (err != NoError)
		DBPrintf("hiba");

	c1 = element.wall.begC;
	c2 = element.wall.endC;
	height = element.wall.height;
	width = element.wall.thickness;
	DBPrintf("width XXXXXX %d", width);

	if (err == NoError) {
		ACAPI_ELEMENT_MASK_CLEAR (mask);
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, begC);
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, endC);
		//ACAPI_ELEMENT_MASK_SET (mask, API_WallType, height);
		//ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness);

		element.wall.begC = c2;
		element.wall.endC = c1;
		//element.wall.height = 100*height;
		//element.wall.thickness = width;

		err = ACAPI_Element_Change (&amp;amp;element, &amp;amp;mask, NULL, 0, true);
		if (err == NoError) {
			DBPrintf("Fal megvan");
			err = ACAPI_Element_Get (&amp;amp;element);
			width = element.wall.thickness;
			DBPrintf("width YYYYYY %d", width);
		}

	}


}

//getelements

void getElements (void) 
{ 
	API_Quantity      quantity, mask; 
	API_Quantities    quantities; 
	API_QuantityPar   params; 
	GSErrCode         err; 



	GS::Array&amp;lt;API_Guid&amp;gt; elemList;
	ACAPI_Element_GetElemList(API_WallID,&amp;amp;elemList);

	ACAPI_ELEMENT_QUANTITY_MASK_CLEAR (mask); 
	ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface1); 
	ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface2); 
	ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, volume);
	quantities.quantityData = &amp;amp;quantity; 
	params.minOpeningSize = EPS; 

	DBPrintf ("number of walls = %ld,", elemList.GetSize ());

	short visible = 0;
	short onStory = 0;
	short inView = 0;
	for (GS::Array&amp;lt;API_Guid&amp;gt;::ConstIterator it = elemList.Enumerate (); it != NULL; ++it) {

		if (ACAPI_Element_Filter (*it, APIFilt_OnVisLayer))
			++visible;
		if (ACAPI_Element_Filter (*it, APIFilt_OnActFloor))
			++onStory;
		if (ACAPI_Element_Filter (*it, APIFilt_InCroppedView))
			++inView;


		//get quantities
		err = ACAPI_Element_GetQuantities (*it, &amp;amp;params, &amp;amp;quantities, &amp;amp;mask);
		if (err == NoError) { 
			DBPrintf ("surface1: %.2lf  surface2: %.2lf  volume: %.2lf", quantity.wall.surface1, quantity.wall.surface2, quantity.wall.volume); 	   
		}
		changeWall(&amp;amp;it.GetCurrent());
	}
	//DBPrintf ("%d visible, %d on the view\'s floor, %d in the cropped view\n", visible, onStory, inView);
} &lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Jan 2014 09:06:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128192#M5874</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-25T09:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128193#M5875</link>
      <description>Szia Andor, &lt;BR /&gt;
 &lt;BR /&gt;
Your code is absolutely perfect. It works good, it switches the beginning and end coordinates of the walls. &lt;BR /&gt;
 &lt;BR /&gt;
If you check in ArchiCAD on the Wall Settings dialog you can't modify the thickness of the walls in the user interface also. That is because those wall's type is APIWtyp_Normal. &lt;BR /&gt;
Check API_WallType, there are thickness (at the beginning point) and thickness1 (at the end point) and type (the geometry of the wall) attributes. &lt;BR /&gt;
If the type is APIWtyp_Normal, it means that the wall has parallel sides, so you can't change thickness because the sides won't be parallel after the modification. &lt;BR /&gt;
So if you want to change thickness you must change the type too. &lt;BR /&gt;
 
&lt;PRE&gt;void changeWall (const API_Guid* ArchAPIGUID) 
{ 
	API_Element			element, mask; 
	API_Coord			c1, c2; 
	GSErrCode			err = NoError; 
	double				height; 
	double				width; 
 
	BNZeroMemory (&amp;amp;element, sizeof (API_Element)); 
	API_Guid currAPIGuid = *ArchAPIGUID; 
	element.header.guid = currAPIGuid; 
	err = ACAPI_Element_Get (&amp;amp;element); 
	if (err != NoError) 
		DBPrintf("hiba"); 
 
	c1 = element.wall.begC; 
	c2 = element.wall.endC; 
	height = element.wall.height; 
	width = element.wall.thickness; 
	DBPrintf("width XXXXXX %d", width); 
 
	if (err == NoError) { 
		ACAPI_ELEMENT_MASK_CLEAR (mask); 
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, begC); 
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, endC); 
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, height); 
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness); 
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness1); 
		ACAPI_ELEMENT_MASK_SET (mask, API_WallType, type); 
 
		element.wall.begC = c2; 
		element.wall.endC = c1; 
		element.wall.height = height*2; 
		element.wall.thickness = width*2; 
		element.wall.thickness1 = width*2; 
		element.wall.type = APIWtyp_Trapez; 
 
		err = ACAPI_Element_Change (&amp;amp;element, &amp;amp;mask, NULL, 0, true); 
		if (err == NoError) { 
			DBPrintf("Fal megvan"); 
			err = ACAPI_Element_Get (&amp;amp;element); 
			width = element.wall.thickness; 
			DBPrintf("width YYYYYY %d", width); 
		} 
	} 
}&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Best Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Mon, 27 Jan 2014 10:21:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128193#M5875</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2014-01-27T10:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128194#M5876</link>
      <description>Szia!&lt;BR /&gt;
&lt;BR /&gt;
Thank you for the code, but it still does not work. It gives me the error: APIERR_REFUSEDCMD.&lt;BR /&gt;
&lt;BR /&gt;
If I try to modify the database with the following code gives the error: APIERR_BADDATABASE:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;		err = ACAPI_Database(APIDb_ChangeCurrentDatabaseID, &amp;amp;element.detail.databaseID);
		if(err == NoError){
		}
		else {
			DBPrintf("%d",(Int32)err);
		}
&lt;/PRE&gt;

What could be the problem?</description>
      <pubDate>Mon, 27 Jan 2014 19:07:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128194#M5876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-27T19:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128195#M5877</link>
      <description>Szia Andor, &lt;BR /&gt;
 &lt;BR /&gt;
Your code worked good for me, so the context of the API function call could be wrong. &lt;BR /&gt;
Which API function call gives you APIERR_REFUSEDCMD error code? &lt;BR /&gt;
 &lt;BR /&gt;
Can you describe me the situation when you call your AddOn function? (view type, placed elements, maybe a screenshot could help also) &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Tue, 28 Jan 2014 08:47:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128195#M5877</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2014-01-28T08:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128196#M5878</link>
      <description>&lt;BLOCKQUOTE&gt;AndorSzamos wrote:&lt;BR /&gt;It gives me the error: APIERR_REFUSEDCMD.&lt;/BLOCKQUOTE&gt;
Are you bounding this operation with &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_OpenUndoableSession&lt;E&gt;&lt;/E&gt; and &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_CloseUndoableSession&lt;E&gt;&lt;/E&gt;?</description>
      <pubDate>Wed, 29 Jan 2014 00:24:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128196#M5878</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2014-01-29T00:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128197#M5879</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Actually I have a very simple code. I just try to draw a wall in ArchiCAD, and then modify the parameters of it. &lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;#include "APIEnvir.h" 

// ---------------------------------- Includes --------------------------------- 

#include   &amp;lt;math.h&amp;gt; 

#include   &amp;lt;string.h&amp;gt; 


#include   "ACAPinc.h"               // also includes APIdefs.h 
//#include   "Model.hpp" 
#include   "APICommon.h" 

#include   "DGModule.hpp" 

#include   "DG.h" 



#include   "MDIDs_APICD.h" 


//non-AC 
#include &amp;lt;iostream&amp;gt; 
#include &amp;lt;fstream&amp;gt; 
#include &amp;lt;string&amp;gt; 


//program includes 



// ---------------------------------- Types ------------------------------------ 

#define EvaluateButton          1 
#define CancelButton          2 
#define   UserArea             3 
#define Consumption1          5 
#define Consumption2          7 



using namespace std; 



// ---------------------------------- Variables -------------------------------- 


// ---------------------------------- Prototypes ------------------------------- 




// ============================================================================= 
// 
// Dialog control functions 
// 
// ============================================================================= 


void doEvaluation(void){ 
   DBPrintf("bla"); 
} 



// ----------------------------------------------------------------------------- 
// Main dialog callback function 
// ----------------------------------------------------------------------------- 

static short DGCALLBACK   DialogMessageHandler (short message, 
   short dialId, 
   short itemId, 
   DGUserData userData, 
   DGMessageData msgData) 
{ 
   UNUSED_PARAMETER (msgData); 
   UNUSED_PARAMETER (dialId); 
   UNUSED_PARAMETER (userData); 
   //INNEN FOLYTASD A GOMBOKRA A REAGALAST 

   switch (message) { 
   case DG_MSG_CLOSE: 
      break; 
   case DG_MSG_CLICK: 
      switch (itemId) { 
         //case 2: // Close button 
      case EvaluateButton: 
         doEvaluation(); 
         break; 
      case CancelButton: 
         return(1); 
         break; 
      default: 
         return(1); 
         break; 
      } 
   default: 
      break; 
   } 
   return 0; 
}       // DialogMessageHandler 





// ============================================================================= 
// 
// Main functions 
// 
// ============================================================================= 

#ifdef __APPLE__ 
#pragma mark - 
#endif 

// ----------------------------------------------------------------------------- 
// Call the list data dialog 
// ----------------------------------------------------------------------------- 


//------------------------------------------------------------------------------ 
// Get Element properties 2 
//------------------------------------------------------------------------------ 




//change properties 

void changeWall (const API_Guid* ArchAPIGUID) 
{ 
   API_Element         element, mask; 
   API_Coord         c1, c2; 
   GSErrCode         err = NoError; 
   double            height; 
   double            width; 

   BNZeroMemory (&amp;amp;element, sizeof (API_Element)); 
   API_Guid currAPIGuid = *ArchAPIGUID; 
   element.header.guid = currAPIGuid; 
   err = ACAPI_Element_Get (&amp;amp;element); 
   if (err != NoError) 
      DBPrintf("hiba"); 

   c1 = element.wall.begC; 
   c2 = element.wall.endC; 
   height = element.wall.height; 
   width = element.wall.thickness; 
   DBPrintf("width XXXXXX %d", width); 

   if (err == NoError) { 
      //we need to change the database we are working with to the current database of the current element 
      err = ACAPI_Database(APIDb_ChangeCurrentDatabaseID, &amp;amp;element.detail.databaseID); 
      if(err == NoError){ 
      } 
      else { 
         DBPrintf("%d",(Int32)err); 
      } 

      ACAPI_ELEMENT_MASK_CLEAR (mask); 
      ACAPI_ELEMENT_MASK_SET (mask, API_WallType, begC); 
      ACAPI_ELEMENT_MASK_SET (mask, API_WallType, endC); 
      ACAPI_ELEMENT_MASK_SET (mask, API_WallType, height); 
      ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness); 
      ACAPI_ELEMENT_MASK_SET (mask, API_WallType, thickness1); 
      ACAPI_ELEMENT_MASK_SET (mask, API_WallType, type); 

      element.wall.begC = c2; 
      element.wall.endC = c1; 
      element.wall.height = height*2; 
      element.wall.thickness = width*2; 
      element.wall.thickness1 = width*2; 
      element.wall.type = APIWtyp_Trapez; 

      err = ACAPI_Element_Change (&amp;amp;element, &amp;amp;mask, NULL, 0, true); 
      if (err == NoError) { 
         DBPrintf("Fal megvan"); 
      } 
      else{ 
         DBPrintf("%d",(Int32)err); 
      } 
      err = ACAPI_Element_Get (&amp;amp;element); 
      width = element.wall.thickness; 
      DBPrintf("width YYYYYY %d", width); 
   } 
} 


void getElements (void) 
{ 
   API_Quantity      quantity, mask; 
   API_Quantities    quantities; 
   API_QuantityPar   params; 
   GSErrCode         err; 



   GS::Array&amp;lt;API_Guid&amp;gt; elemList; 
   ACAPI_Element_GetElemList(API_WallID,&amp;amp;elemList); 

   ACAPI_ELEMENT_QUANTITY_MASK_CLEAR (mask); 
   ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface1); 
   ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface2); 
   ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, volume); 
   quantities.quantityData = &amp;amp;quantity; 
   params.minOpeningSize = EPS; 

   DBPrintf ("number of walls = %ld,", elemList.GetSize ()); 

   short visible = 0; 
   short onStory = 0; 
   short inView = 0; 
   for (GS::Array&amp;lt;API_Guid&amp;gt;::ConstIterator it = elemList.Enumerate (); it != NULL; ++it) { 

      if (ACAPI_Element_Filter (*it, APIFilt_OnVisLayer)) 
         ++visible; 
      if (ACAPI_Element_Filter (*it, APIFilt_OnActFloor)) 
         ++onStory; 
      if (ACAPI_Element_Filter (*it, APIFilt_InCroppedView)) 
         ++inView; 


      //get quantities 
      err = ACAPI_Element_GetQuantities (*it, &amp;amp;params, &amp;amp;quantities, &amp;amp;mask); 
      if (err == NoError) { 
         DBPrintf ("surface1: %.2lf  surface2: %.2lf  volume: %.2lf", quantity.wall.surface1, quantity.wall.surface2, quantity.wall.volume);        
      } 
      changeWall(&amp;amp;it.GetCurrent()); 
   } 
   //DBPrintf ("%d visible, %d on the view\'s floor, %d in the cropped view\n", visible, onStory, inView); 
} 

static void   Evaluate (void) 
{ 
   API_ListData   param; 
   GSResModule    saveResModule; 

   BNZeroMemory (&amp;amp;param, sizeof (param)); 
   param.header.setIndex = 1; 
   param.header.typeID   = API_ComponentID; 

   saveResModule = ACAPI_UseOwnResModule (); 
   DGModalDialog (32510, DialogMessageHandler, (DGUserData) (&amp;amp;param)); 
   ACAPI_ResetResModule (saveResModule); 

   getElements(); 
   return; 
}      //Evaluate 


// ----------------------------------------------------------------------------- 
// MenuCommandHandler 
//      called to perform the user-asked command 
// ----------------------------------------------------------------------------- 

GSErrCode __ACENV_CALL   MenuCommandHandler (const API_MenuParams *params) 
{ 
   UNUSED_PARAMETER (params); 

   Evaluate (); 

   return NoError; 
}   // DoCommand 


// ============================================================================= 
// 
// Required functions 
// 
// ============================================================================= 


//------------------------------------------------------ 
// Dependency definitions 
//------------------------------------------------------ 
API_AddonType   __ACENV_CALL   CheckEnvironment (API_EnvirParams* envir) 
{ 
   if (envir-&amp;gt;serverInfo.serverApplication != APIAppl_ArchiCADID) 
      return APIAddon_DontRegister; 

   GSResModule saveResModule = ACAPI_UseOwnResModule (); 
   ACAPI_Resource_GetLocStr (envir-&amp;gt;addOnInfo.name, 32000, 1); 
   ACAPI_Resource_GetLocStr (envir-&amp;gt;addOnInfo.description, 32000, 2); 
   ACAPI_ResetResModule (saveResModule); 

   return APIAddon_Normal; 
}      /* CheckEnvironment */ 


//------------------------------------------------------ 
// Interface definitions 
//------------------------------------------------------ 
GSErrCode   __ACENV_CALL   RegisterInterface (void) 
{ 
   ACAPI_Register_Menu (32500, 0, MenuCode_DocExtras, MenuFlag_Default); 
   return NoError; 
}      /* RegisterInterface */ 


//------------------------------------------------------ 
// Called when the Add-On has been loaded into memory 
// to perform an operation 
//------------------------------------------------------ 
GSErrCode   __ACENV_CALL Initialize   (void) 
{ 
   GSErrCode err = ACAPI_Install_MenuHandler (32500, MenuCommandHandler); 
   if (err != NoError) 
      DBPrintf ("Energy-Budget Evaluator:: Initialize() ACAPI_Install_MenuHandler failed\n"); 


   return err; 
}      /* Initialize */ 


// ----------------------------------------------------------------------------- 
// FreeData 
//      called when the Add-On is going to be unloaded 
// ----------------------------------------------------------------------------- 

GSErrCode __ACENV_CALL   FreeData (void) 
{ 
   return NoError; 
} 

&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jan 2014 07:47:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128197#M5879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-29T07:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128198#M5880</link>
      <description>Szia Andor, &lt;BR /&gt;
 &lt;BR /&gt;
Ralph pointed out your mistake. &lt;BR /&gt;
If you want to change something through the API, then before the modification you must open an undoable session (ACAPI_OpenUndoableSession) and after you made the changes close the undoable session (ACAPI_CloseUndoableSession). This will guarantee that the user can click to the undo button and revert all the changes the Add-On made. &lt;BR /&gt;
 &lt;BR /&gt;
So put an ACAPI_OpenUndoableSession call in the beginning of the MenuCommandHandler function and an ACAPI_CloseUndoableSession to the end: &lt;BR /&gt;
 
&lt;PRE&gt;GSErrCode __ACENV_CALL	MenuCommandHandler (const API_MenuParams *menuParams) 
{ 
	UNUSED_PARAMETER (params); 
 
	GSErrCode err = ACAPI_OpenUndoableSession ("Undo changes"); 
	if (err != NoError) { 
		DBPrintf ("MenuCommandHandler cannot open undoable session: %d\n", err); 
		return err; 
	} 
 
	Evaluate (); 
 
	ACAPI_CloseUndoableSession (); 
 
	return NoError; 
}	// DoCommand&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Wed, 29 Jan 2014 09:09:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128198#M5880</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2014-01-29T09:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change Wall parameters through ACAPI_Element_Change</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128199#M5881</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Thanks both of you, it solved the problem.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Andor</description>
      <pubDate>Wed, 29 Jan 2014 09:37:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Change-Wall-parameters-through-ACAPI-Element-Change/m-p/128199#M5881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-29T09:37:24Z</dc:date>
    </item>
  </channel>
</rss>

