<?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: Info of selected items in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62626#M6884</link>
    <description>Thanks, Oleg. I will probably not be able to really work on this tomorrow, but it looks like you have all the elements I was struggling with.&lt;BR /&gt;
&lt;BR /&gt;
I owe you big time for this!</description>
    <pubDate>Mon, 31 Oct 2005 16:10:01 GMT</pubDate>
    <dc:creator>TomWaltz</dc:creator>
    <dc:date>2005-10-31T16:10:01Z</dc:date>
    <item>
      <title>Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62612#M6869</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;A lot of the API examples show how to get/assign parameters of clicked elements.&lt;BR /&gt;&lt;BR /&gt;Does anyone have any tips on getting the API_ElemTypeID typeID, and changing parameters on SELECTED elements?&lt;BR /&gt;&lt;BR /&gt;I'm struggling with which myriad of "change/get/set" functions does what I want!&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Aug 2023 09:33:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62612#M6869</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2023-08-07T09:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62613#M6870</link>
      <description>Use the ACAPI_Goodies function with APIAny_NeigIDToElemTypeID to convert a neig type to a element type.&lt;BR /&gt;
&lt;BR /&gt;
Then you can then change parameters as you would in a notification handler</description>
      <pubDate>Thu, 13 Oct 2005 01:18:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62613#M6870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-13T01:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62614#M6871</link>
      <description>Adam&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
does that apply to parameters inside door &amp;amp; window objects as well?</description>
      <pubDate>Fri, 14 Oct 2005 17:05:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62614#M6871</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-14T17:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62615#M6872</link>
      <description>You can use the ACAPI_Goodies function with APIAny_NeigIDToElemTypeID to convert any neig type to an element type. Windows, doors, dimensions. See the docs.&lt;BR /&gt;
&lt;BR /&gt;
To set the parameters do like the example in the docs under APIAny_OpenParametersID, but use ACAPI_Element_ChangeParameters instead of changeDefauts. You can use ACAPI_Element_ChangeParameters straight up without the goodie functions, but the parameter script in gdl won't run so don't.&lt;BR /&gt;
&lt;BR /&gt;
This is to change parameters (like those in gdl). It is different to changing 'members' of an element, ie. everything you see under API_Element in the docs. To do this use ACAPI_Element_Change. This is things like door position in a wall.</description>
      <pubDate>Wed, 19 Oct 2005 01:23:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62615#M6872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-19T01:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62616#M6873</link>
      <description>Thanks, Adam. I really appreciate your help so far.&lt;BR /&gt;
&lt;BR /&gt;
It seems I was on the right path, but must have some other problem. I copied in that bit of code, compiled it, and while no errors are generated, nor can I make the parameter actually change. &lt;BR /&gt;
&lt;BR /&gt;
I was experimenting with two different ideas: changing the "A" value of the object and changing the "width" and "height" of the window. Neither approach seemed to work. I actually want to change the "gs_detlevel_3D" parameter, but used these as test cases.&lt;BR /&gt;
&lt;BR /&gt;
I added a ton of debugging "WriteReport" statements, and not one displays an error. All my message statements show the "successful" path was taken and no err statements were generated.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;		API_ParamOwnerType 		paramOwner;
		API_ChangeParamType 		chgParam;
		API_GetParamsType 		getParams;
		API_Element 				element, mask;
		API_ElementMemo 			memo;
		GSErrCode 				err, err2;

		BNZeroMemory (&amp;amp;paramOwner, sizeof (API_ParamOwnerType)); 
		paramOwner.libInd = 0; 					// no library part
		paramOwner.typeID = API_WindowID;	 	// window element
		paramOwner.index = 0; 					// element default 
	

		BNZeroMemory (&amp;amp;getParams, sizeof (APIAny_GetActParametersID));

		err = ACAPI_Goodies (APIAny_OpenParametersID, &amp;amp;paramOwner, NULL);
		if (!err) {
			BNZeroMemory (&amp;amp;chgParam, sizeof (API_ChangeParamType));

			err = ACAPI_Goodies (APIAny_GetActParametersID, &amp;amp;getParams, NULL);
			if (!err) {
				chgParam.index = 0;
				// junk parameter for testing
				CHCopyC ("A", chgParam.name);
				chgParam.realValue = 2.1;
				// what I actually want to change
				//CHCopyC ("gs_detlevel_3D", chgParam.name);
				// chgParam.strValue = "Off";
				err2 = ACAPI_Goodies (APIAny_ChangeAParameterID, &amp;amp;chgParam, NULL);
				if (!err2){
					err = ACAPI_Goodies (APIAny_GetActParametersID, &amp;amp;getParams, NULL);
					&lt;FONT color="#0024ff"&gt;if (!err){
						WriteReport_Err("APIAny_GetActParametersID successful: ", err);
					}else{
						WriteReport_Err("APIAny_GetActParametersID error: ", err);
					}&lt;/FONT&gt;
					WriteReport_Err("ACAPI_Goodies (APIAny_ChangeAParameterID) successful: ", err2);
				}else{
					WriteReport_Err("ACAPI_Goodies (APIAny_ChangeAParameterID) error: ", err2);
				}
			}else {
				WriteReport_Err("ACAPI_Goodies (APIAny_OpenParametersID) error: ", err);
			}
			ACAPI_Goodies (APIAny_CloseParametersID, NULL, NULL);
			WriteReport_Err("APIAny_OpenParametersID successful: ", err);
		}else {
			WriteReport_Err("APIAny_OpenParametersID error: ", err);
		}

		if (!err) { 			// If typeID = Window
			BNZeroMemory (&amp;amp;element, sizeof (API_Element));
			BNZeroMemory (&amp;amp;memo, sizeof (API_ElementMemo));
			element.header.typeID = API_WindowID;
			element.window.width = 1.2;
			element.window.height = 2.1;
			ACAPI_ELEMENT_MASK_CLEAR (mask);
			ACAPI_ELEMENT_MASK_SET (mask, API_WindowType, width);
			ACAPI_ELEMENT_MASK_SET (mask, API_WindowType, height);
			memo.params = getParams.params;
			err2 = ACAPI_Element_ChangeParameters (elemHead, elemCount, &amp;amp;element, &amp;amp;memo, &amp;amp;mask);
			&lt;FONT color="#0024ff"&gt;if (!err2){
				WriteReport_Err("ACAPI_Element_ChangeParameters successful: ", err2);
			}else{ 
				WriteReport_Err("ACAPI_Element_ChangeParameters error: ", err2);
			}&lt;/FONT&gt;
			WriteReport_Err("ACAPI_Goodies (APIAny_ChangeAParameterID) successful: ", err);
		}else{
			WriteReport_Err("ACAPI_Goodies (APIAny_ChangeAParameterID) error:: ", err);
		}&lt;/PRE&gt;

Is there anything you (or anyone else) see that is wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any ideas!</description>
      <pubDate>Thu, 20 Oct 2005 12:18:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62616#M6873</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-20T12:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62617#M6874</link>
      <description>.... and the output in my Report window:
&lt;PRE&gt;Demo layer is on
Existing layer is on
Window #14
Selected element is a Window
Element is set to existing
APIAny_GetActParametersID successful: : 0
ACAPI_Goodies (APIAny_ChangeAParameterID) successful: : 0
APIAny_OpenParametersID successful: : 0
ACAPI_Element_ChangeParameters successful: : 0
ACAPI_Goodies (APIAny_ChangeAParameterID) successful: : 0&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Oct 2005 12:20:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62617#M6874</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-20T12:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62618#M6875</link>
      <description>has a quick look and you don't appear to be setting the element index anywhere. eg. chgParam.index, (*elemhead)[0].index&lt;BR /&gt;
&lt;BR /&gt;
how does it know what element your changing?&lt;BR /&gt;
you should try with a regular parameter as a and b are kindof special</description>
      <pubDate>Fri, 21 Oct 2005 03:02:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62618#M6875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-21T03:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62619#M6876</link>
      <description>&lt;BLOCKQUOTE&gt;TomWaltz wrote:&lt;BR /&gt;I was experimenting with two different ideas: changing the "A" value of the object and changing the "width" and "height" of the window. Neither approach seemed to work.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;		API_ParamOwnerType 		paramOwner;
		BNZeroMemory (&amp;amp;paramOwner, sizeof (API_ParamOwnerType)); 
		paramOwner.libInd = 0; 					// no library part
		paramOwner.typeID = API_WindowID;	 	// window element
		paramOwner.index = 0; 					// element default 
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
Can you clarify what you are trying to do here? Your opening question suggests you are trying to modify a selected element, but this code would modify the default settings for placing a new Window element (you only specify the typeID and not the index of a specific element. Is that what you want? Take a look at the API documentation on the type API_ParamOwnerType for more information on this.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;TomWaltz wrote:&lt;BR /&gt;&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;		API_GetParamsType       getParams;
		BNZeroMemory (&amp;amp;getParams, sizeof(APIAny_GetActParametersID));
&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
There is a type mismatch here - getParams is the type API_GetParamsType, but you zero it using the size of APIAny_GetActParametersID. You could also write: 
&lt;PRE&gt;BNZeroMemory (&amp;amp;getParams, sizeof(getParams));&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2005 17:17:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62619#M6876</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-10-27T17:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62620#M6877</link>
      <description>&lt;BLOCKQUOTE&gt;Can you clarify what you are trying to do here? &lt;/BLOCKQUOTE&gt;

Ralph,&lt;BR /&gt;
&lt;BR /&gt;
my intention is to change one of the parameters of the selected door or window.&lt;BR /&gt;
&lt;BR /&gt;
The change is being done based on user information being entered into a custom panel on the settings menu.</description>
      <pubDate>Thu, 27 Oct 2005 17:22:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62620#M6877</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-27T17:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62621#M6878</link>
      <description>&lt;BLOCKQUOTE&gt;TomWaltz wrote:&lt;BR /&gt;my intention is to change one of the parameters of the selected door or window.&lt;/BLOCKQUOTE&gt;
In that case, you need to specify the index for each selected window to be changed:
&lt;PRE&gt;paramOwner.index = &amp;lt;index of a selected window&amp;gt;;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2005 17:38:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62621#M6878</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-10-27T17:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62622#M6879</link>
      <description>Ralph,&lt;BR /&gt;
I used the API_ParamOwnerType documentation as a starting point, and it never mentioned the index. It makes sense, though.&lt;BR /&gt;
&lt;BR /&gt;
Is something more like this what you were describing?:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;	API_Elem_Head		**elemHead;
	API_ElemTypeID		typeID = API_ZombieElemID;
	API_ParamOwnerType 		paramOwner;
	API_ChangeParamType 		chgParam;
	API_GetParamsType 		getParams;
	API_Element 				element, mask;
	API_ElementMemo 			memo;
	GSErrCode 				err, err2;
	API_AddParType			** addPars;

        elemHead = (API_Elem_Head **) BMAllocateHandle (sizeof (API_Elem_Head), ALLOCATE_CLEAR, 0);
	BNZeroMemory (&amp;amp;paramOwner, sizeof (API_ParamOwnerType)); 
	paramOwner.libInd = 0; 					// no library part
	paramOwner.typeID = API_DoorID;	 	// Door element
	paramOwner.index = 0; 					// element default 

	BNZeroMemory (&amp;amp;getParams, sizeof (APIAny_GetParamValuesID));

	err = ACAPI_Goodies (APIAny_OpenParametersID, &amp;amp;paramOwner, NULL);
	if (!err) {
		BNZeroMemory (&amp;amp;chgParam, sizeof (API_ChangeParamType)); 

		err = ACAPI_Goodies (APIAny_GetActParametersID, &amp;amp;getParams, NULL);
		if (!err) {
			chgParam.index = 0;
			CHCopyC ("gs_detlevel_3D", chgParam.name);
			chgParam.strValue = "Off";

			addPars = getParams.params;

			char 		parName[32];
			double 	val = 0;
			long 		ii;
			long  	addParNum = BMGetHandleSize (reinterpret_cast (*addPars)) / sizeof (API_AddParType);
			char		buffer [256];
			
			for (ii = 0; ii &amp;lt; addParNum; ii++) {
				CHCopyC ((*addPars)[ii].name, buffer);
				ACAPI_WriteReport (buffer, false); // print name for debugging
				
				if (strncmp (parName,(*addPars)[ii].name, 8)==0) {
					WriteReport("Parameter Matched",  parName); 
					paramOwner.index = ii;  
					chgParam.index = ii;
				}
				if (CHCompareCStrings ((*addPars)[ii].name, parName, CS_CaseInsensitive) == 0) { 
					chgParam.index = ii;
					CHCopyC ((*addPars)[ii].name , chgParam.name);
					CHCopyC ("Off", chgParam.strValue);
					WriteReport("Parameter variables set ", buffer); 
			         	break;
				}
			}
			err2 = ACAPI_Goodies (APIAny_ChangeAParameterID, &amp;amp;chgParam, NULL);&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2005 18:23:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62622#M6879</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-27T18:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62623#M6880</link>
      <description>&lt;BLOCKQUOTE&gt;TomWaltz wrote:&lt;BR /&gt;Ralph,&lt;BR /&gt;
I used the API_ParamOwnerType documentation as a starting point, and it never mentioned the index. It makes sense, though.&lt;BR /&gt;
Is something more like this what you were describing?:&lt;BR /&gt;

&lt;PRE&gt;	BNZeroMemory (&amp;amp;paramOwner, sizeof (API_ParamOwnerType)); 
	paramOwner.libInd = 0; 					// no library part
	paramOwner.typeID = API_DoorID;	 	// Door element
	paramOwner.index = 0; 					// element default 
	err = ACAPI_Goodies (APIAny_OpenParametersID, &amp;amp;paramOwner, NULL);&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
No, you haven't specified the index of the element to be modified in paramOwner.index. The documentation on API_ParamOwnerType states:&lt;BR /&gt;
&lt;BR /&gt;
"This structure is used to specify the target of which the parameter list should be opened to edit. Possible targets are:
&lt;UL&gt;&lt;LI&gt;- parameters of a placed element (Library Part instance)&lt;BR /&gt;
- default parameters of an element (default tool settings)&lt;BR /&gt;
- default parameters of a Library Part itself"&lt;/LI&gt;&lt;/UL&gt;

The values required by API_ParamOwnerType are different for each case. Your code would be suitable for the 2nd case (library part default), but you want to do the first (placed element). You should specify the index of a selected element in paramOwner.index in order to modify it. Do you know how to get the index of a selected element?&lt;BR /&gt;
&lt;BR /&gt;
BTW, I notice the following error in your code comes from an example in the API documentation:&lt;BR /&gt;

&lt;PRE&gt;BNZeroMemory (&amp;amp;getParams, sizeof (APIAny_GetActParametersID));&lt;/PRE&gt;

It should be:&lt;BR /&gt;

&lt;PRE&gt;BNZeroMemory (&amp;amp;getParams, sizeof (API_GetParamsType));&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2005 08:24:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62623#M6880</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-10-28T08:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62624#M6881</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;Do you know how to get the index of a selected element?&lt;BR /&gt;
&lt;BR /&gt;
BTW, I notice the following error in your code comes from an example in the API documentation:&lt;/BLOCKQUOTE&gt;

I believe I do. That would be:
&lt;PRE&gt;{
	API_SelectionInfo 	selectionInfo;
	API_Neig			**selNeigs = NULL;
	API_ElemTypeID 	typeID;
	char				buffer[256];
	char 				msgStr[256];
	GSErrCode		err;

	// ------- Check selection -------
	err = ACAPI_Selection_Get (&amp;amp;selectionInfo, &amp;amp;selNeigs, false);
	if (err != NoError) {
		WriteReport_Err ("ACAPI_Selection_Get", err);
		return API_ZombieElemID;
	}
	index = elemHead.index;

	// ------- Enumerate the selection -------
	for (long i = 0; i &amp;lt; selectionInfo.sel_nElem; i++) {
		typeID = Neig_To_ElemID ((*selNeigs)&lt;I&gt;.neigID);
		if (typeID != API_ZombieElemID) {
			sprintf (buffer, "%s #%d", ElemID_To_Name (typeID), (*selNeigs)&lt;I&gt;.index);
			WriteReport (buffer);
		}
	}
	return;
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

I guess my question is whether I return the elemHead.index or the selNeigs.index?</description>
      <pubDate>Fri, 28 Oct 2005 18:28:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62624#M6881</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-28T18:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62625#M6882</link>
      <description>There is some rough way, snippets. So I hope you can find a way to solve your task. I didnt tested it, just tried once, so there may be number of bugs, check the source closely.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;// helper function
template&amp;lt;class T&amp;gt; inline void ApiClearIt(T &amp;amp; obj)
{
	BNZeroMemory(&amp;amp;obj,sizeof(T));
}

GSErrCode StartElementParamsEditing( API_ElemTypeID elem_type, long elem_index )
{
	API_ParamOwnerType param_owner;
	ApiClearIt( param_owner );
	param_owner.typeID = elem_type;
	param_owner.index = elem_index;
	return ACAPI_Goodies (APIAny_OpenParametersID, &amp;amp;param_owner, NULL); 
}

GSErrCode EndParamsEditing()
{
	return ACAPI_Goodies ( APIAny_CloseParametersID, NULL, NULL );
}

GSErrCode EditParameter( const char* name, const char* value )
{
	API_ChangeParamType param;
	ApiClearIt( param );
	CHCopyC( name, param.name );
	param.strValue = const_cast&amp;lt;char*&amp;gt;(value);
	return ACAPI_Goodies ( APIAny_ChangeAParameterID, &amp;amp;param, NULL );
}

GSErrCode GetParamsEdited( API_GetParamsType&amp;amp; params )
{
	return ACAPI_Goodies ( APIAny_GetActParametersID, &amp;amp;params, NULL );
}

GSErrCode UpdateElementParameters(	API_ElemTypeID elem_type,
									long elem_index,
									API_AddParType** params )
{
	API_Element elem, mask;
	API_ElementMemo memo;
	ApiClearIt( elem );
	ApiClearIt( mask );
	ApiClearIt( memo );
	elem.header.typeID = elem_type;
	elem.header.index = elem_index;
	memo.params = params;
	return ACAPI_Element_Change ( &amp;amp;elem, &amp;amp;mask, &amp;amp;memo, APIMemoMask_AddPars, true );
}

GSErrCode ChangeElementParameter(	API_ElemTypeID elem_type,
									long elem_index,
									const char* name,
									const char* value )
{
	GSErrCode err = StartElementParamsEditing( elem_type, elem_index );
	if ( !err )
	{
		err = EditParameter( name, value );
		// more parameters to edit
		if ( !err )
		{
			API_GetParamsType params;
			params.params = 0;
			err = GetParamsEdited( params );
			if ( !err )
				err = UpdateElementParameters( elem_type, elem_index, params.params );
			ACAPI_DisposeAddParHdl( &amp;amp;params.params );
		}
		EndParamsEditing();
	}	
	return err;
}

GSErrCode ChangeParameterOfSelectedWinDoors( const char* pname, const char* value )
{
	API_SelectionInfo sel; 
	API_Neig** neigs = 0;
	ApiClearIt( sel );
	GSErrCode err = ACAPI_Selection_Get (&amp;amp;sel, &amp;amp;neigs, true);
    BMKillHandle ((GSHandle *) &amp;amp;sel.marquee.coords);
	if ( !err &amp;amp;&amp;amp; neigs &amp;amp;&amp;amp; sel.typeID == API_SelElems )
	{
		GSSize count = BMGetHandleSize ((GSHandle) neigs) / sizeof (API_Neig);
		for ( GSSize i = 0; i&amp;lt;count; ++i )
		{
			API_ElemTypeID elem_type = API_ZombieElemID;
			ACAPI_Goodies (APIAny_NeigIDToElemTypeID, &amp;amp;(*neigs)&lt;I&gt;.neigID, &amp;amp;elem_type );
			if ( elem_type == API_WindowID || elem_type == API_DoorID )
			{
				long elem_index = (*neigs)&lt;I&gt;.index;
				GSErrCode edit_err = ChangeElementParameter(elem_type,elem_index,pname,value);
				if ( edit_err )
					err = edit_err;
			}
		}
	}
    BMKillHandle ((GSHandle *) &amp;amp;neigs);
	return err;
}

GSErrCode ChangeDetLevelOfSelectedWinDoors()
{
	ACAPI_OpenUndoableSession ( "Test" );
	GSErrCode err = ChangeParameterOfSelectedWinDoors( "gs_detlevel_3D", "Off" );
	ACAPI_CloseUndoableSession();
	return err;
}
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Oct 2005 21:12:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62625#M6882</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2005-10-29T21:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62626#M6884</link>
      <description>Thanks, Oleg. I will probably not be able to really work on this tomorrow, but it looks like you have all the elements I was struggling with.&lt;BR /&gt;
&lt;BR /&gt;
I owe you big time for this!</description>
      <pubDate>Mon, 31 Oct 2005 16:10:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62626#M6884</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-10-31T16:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Info of selected items</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62627#M6886</link>
      <description>&lt;BLOCKQUOTE&gt;TomWaltz wrote:&lt;BR /&gt;I guess my question is whether I return the elemHead.index or the selNeigs.index?&lt;/BLOCKQUOTE&gt;

They are both the same thing - an index to a particular element in the Element database. The main difference between the handling of API_Elem_Head and API_Neig in this context is that the type specified in API_Neig describes not only the element type, but some specific part of that type, e.g. a point on a wall, or a reference line on a wall. That's why the type specified in the API_Neig has to be converted to an API_ElemTypeID before you can use it to find the target element.</description>
      <pubDate>Tue, 01 Nov 2005 21:33:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Info-of-selected-items/m-p/62627#M6886</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-11-01T21:33:03Z</dc:date>
    </item>
  </channel>
</rss>

