<?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: How to change building material in column? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/305525#M2170</link>
    <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/11183"&gt;@Tibor Lorantfy&lt;/a&gt;&amp;nbsp;can you post some code to demonstrate how to change a rectangle column segment (only one segment) section size, ie:400x600, I'm new to develop C++ add-on, adding some columns to Archicad 24, but different section size&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void Do_CreateColumn (void) //创建柱
{
API_Coord point;

if (!ClickAPoint ("请点取要放置柱的点.", &amp;amp;point)) {
return;
}

API_Element element;
API_ElementMemo memo;
BNClear (element);
BNClear (memo);

element.header.typeID = API_ColumnID; //设置为柱
GSErrCode err = ACAPI_Element_GetDefaults (&amp;amp;element, &amp;amp;memo); //获取柱当前设置

if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_GetDefaults (Column) has failed with error code %ld!", true, err);
ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
return;
}

element.column.origoPos = point;
element.column.bottomOffset = -0.05;
element.column.topOffset = -0.05;
// element.column.height = 3.0;
// element.column.nSegments

err = ACAPI_Element_Create (&amp;amp;element, &amp;amp;memo); //创建柱
if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_Create (Column) has failed with error code %ld!", true, err);

//How to change section size?
   //please put some code here 

}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Sep 2021 13:38:04 GMT</pubDate>
    <dc:creator>Boling1</dc:creator>
    <dc:date>2021-09-10T13:38:04Z</dc:date>
    <item>
      <title>How to change building material in column?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/281173#M2167</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello.&lt;BR /&gt;&lt;BR /&gt;I try to chage column's building material in ArchiCAD24.&lt;BR /&gt;&lt;BR /&gt;But there is no buildingMaterial parameter in column. I remember there was existed buildingMaterial in ArchiCAD22.&lt;BR /&gt;&lt;BR /&gt;I found that at API_ColumnSegmentType. But I don't know how to change this.&lt;BR /&gt;&lt;BR /&gt;Could you please explain with example code?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:29:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/281173#M2167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T07:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to change building material in column?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/281174#M2168</link>
      <description>&lt;BLOCKQUOTE&gt;YongWoo wrote:&lt;BR /&gt;I found that at API_ColumnSegmentType. But I don't know how to change this.&lt;/BLOCKQUOTE&gt;
From Archicad 24 the columns can have multiple segments. Each segment can have different parameters, building materials. So the building material parameter belongs to the segments and not to the column itself.&lt;BR /&gt;
&lt;BR /&gt;
API_ColumnType has the nSegments member which defines the number of the segments. Using the ACAPI_Element_GetMemo function you can retrieve the array of the segments and you can find the building material paramters of the segments in the returned memo.
&lt;PRE&gt;API_ElementMemo memo = {};
ACAPI_Element_GetMemo (element.header.guid, &amp;amp;memo, APIMemoMask_ColumnSegment);

if (memo.columnSegments != nullptr) {
	for (UIndex idx = 0; idx &amp;lt; element.column.nSegments; ++idx) {
		API_ColumnSegmentType&amp;amp; columnSegment = memo.columnSegments[idx];
		// modify attributes of columnSegment here
	}

	API_Element maskElem;
	ACAPI_ELEMENT_MASK_CLEAR (maskElem);	// change only the parameters of the segments

	ACAPI_Element_Change (&amp;amp;element, &amp;amp;maskElem, &amp;amp;memo, APIMemoMask_ColumnSegment, true);
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jul 2021 13:12:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/281174#M2168</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2021-07-13T13:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to change building material in column?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/281175#M2169</link>
      <description>Thank you.&lt;BR /&gt;
&lt;BR /&gt;
I only checked the element and didn't check the memo.</description>
      <pubDate>Mon, 19 Jul 2021 06:44:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/281175#M2169</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-19T06:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to change building material in column?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/305525#M2170</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/11183"&gt;@Tibor Lorantfy&lt;/a&gt;&amp;nbsp;can you post some code to demonstrate how to change a rectangle column segment (only one segment) section size, ie:400x600, I'm new to develop C++ add-on, adding some columns to Archicad 24, but different section size&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void Do_CreateColumn (void) //创建柱
{
API_Coord point;

if (!ClickAPoint ("请点取要放置柱的点.", &amp;amp;point)) {
return;
}

API_Element element;
API_ElementMemo memo;
BNClear (element);
BNClear (memo);

element.header.typeID = API_ColumnID; //设置为柱
GSErrCode err = ACAPI_Element_GetDefaults (&amp;amp;element, &amp;amp;memo); //获取柱当前设置

if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_GetDefaults (Column) has failed with error code %ld!", true, err);
ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
return;
}

element.column.origoPos = point;
element.column.bottomOffset = -0.05;
element.column.topOffset = -0.05;
// element.column.height = 3.0;
// element.column.nSegments

err = ACAPI_Element_Create (&amp;amp;element, &amp;amp;memo); //创建柱
if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_Create (Column) has failed with error code %ld!", true, err);

//How to change section size?
   //please put some code here 

}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 13:38:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-change-building-material-in-column/m-p/305525#M2170</guid>
      <dc:creator>Boling1</dc:creator>
      <dc:date>2021-09-10T13:38:04Z</dc:date>
    </item>
  </channel>
</rss>

