<?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 get object geometry openings in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668749#M10488</link>
    <description>&lt;P&gt;Hi, Maybe I'm not fully understand what you meant the opening. You cannot get the opening geometry only as it's represented by wall. I mean if you get the wall geometry, than you can a piece of wall with a hole (opening) geometry.&lt;/P&gt;
&lt;P&gt;HTH.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jul 2025 04:25:30 GMT</pubDate>
    <dc:creator>Hiromichi Shinkawa</dc:creator>
    <dc:date>2025-07-07T04:25:30Z</dc:date>
    <item>
      <title>How to get object geometry openings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/667744#M10476</link>
      <description>&lt;P&gt;Hi I am trying to get object geometries using ArchiCAD API and convert them to .obj files but I couldn't get the openings on the walls. I only got whole geometry of a wall even if it have windows or doors placed on it. What I am missing? Any help is appreciated.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;for (Int32 ibody = info3D.fbody; ibody &amp;lt;= info3D.lbody; ibody++) {
	API_Component3D component = {};
	component.header.typeID = API_BodyID;
	component.header.index = ibody;
	err = ACAPI_ModelAccess_GetComponent(&amp;amp;component);
	if (err != NoError)
		continue;

	nVert = component.body.nVert;
	nEdge = component.body.nEdge;
	nPgon = component.body.nPgon;

	// Collect vertices
	std::vector&amp;lt;API_VertType&amp;gt; verts(nVert + 1);
	for (j = 1; j &amp;lt;= nVert; j++) {
		component.header.typeID = API_VertID;
		component.header.index = j;
		err = ACAPI_ModelAccess_GetComponent(&amp;amp;component);
		if (err == NoError) {
			verts[j] = component.vert;
			char buf[128];
			snprintf(buf, sizeof(buf), "v %f %f %f\n", component.vert.x, component.vert.y, component.vert.z);
			objContent += buf;
		}
	}

	// Collect edges
	std::vector&amp;lt;API_EdgeType&amp;gt; edges(nEdge + 1);
	for (j = 1; j &amp;lt;= nEdge; j++) {
		component.header.typeID = API_EdgeID;
		component.header.index = j;
		err = ACAPI_ModelAccess_GetComponent(&amp;amp;component);
		if (err == NoError) {
			edges[j] = component.edge;
		}
	}

	// Write faces
	for (j = 1; j &amp;lt;= nPgon; j++) {
		component.header.typeID = API_PgonID;
		component.header.index = j;
		err = ACAPI_ModelAccess_GetComponent(&amp;amp;component);
		if (err != NoError)
			continue;
		API_PgonType p = component.pgon;

		// Collect all contours (outer + holes)
		std::vector&amp;lt;std::vector&amp;lt;int&amp;gt;&amp;gt; contours;
		std::vector&amp;lt;int&amp;gt; currentContour;

		for (Int32 pedgIdx = p.fpedg; pedgIdx &amp;lt;= p.lpedg; ++pedgIdx) {
			component.header.typeID = API_PedgID;
			component.header.index = pedgIdx;
			err = ACAPI_ModelAccess_GetComponent(&amp;amp;component);
			if (err != NoError) break;
			API_PedgType pedg = component.pedg;

			if (pedg.pedg == 0) {
				// End of current contour, start a new one
				if (!currentContour.empty())
					contours.push_back(currentContour);
				currentContour.clear();
				continue;
			}

			Int32 edgeIdx = abs(pedg.pedg);
			if (edgeIdx &amp;lt; 1 || edgeIdx &amp;gt; nEdge) continue;
			const API_EdgeType&amp;amp; edge = edges[edgeIdx];

			int vIdx = (pedg.pedg &amp;gt; 0) ? edge.vert1 : edge.vert2;
			currentContour.push_back(vertexOffset + vIdx);
		}
		if (!currentContour.empty())
			contours.push_back(currentContour);

		// Only export the outer contour (first one) as a face
		if (!contours.empty() &amp;amp;&amp;amp; contours[0].size() &amp;gt;= 3) {
			const std::vector&amp;lt;int&amp;gt;&amp;amp; faceIndices = contours[0];
			for (size_t k = 1; k + 1 &amp;lt; faceIndices.size(); ++k) {
				char buf[128];
				snprintf(buf, sizeof(buf), "f %d %d %d\n", faceIndices[0], faceIndices[k], faceIndices[k + 1]);
				objContent += buf;
			}
		}
	}
	vertexOffset += nVert;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 11:55:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/667744#M10476</guid>
      <dc:creator>HalitYagar</dc:creator>
      <dc:date>2025-06-27T11:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get object geometry openings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668585#M10484</link>
      <description>&lt;P&gt;Hi, I'd suggest you to try pass the window/door guid and call the following command:&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;elemHead.guid = window_guid;
err = ACAPI_ModelAccess_Get3DInfo(elemHead, &amp;amp;info3D);
if (err) return;

for (Int32 i = info3D.fbody; i &amp;lt;= info3D.lbody; i++) {
	API_Component3D component{};

	component.header.typeID = API_BodyID;
	component.header.index = i;
	err = ACAPI_ModelAccess_GetComponent(&amp;amp;component);
...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 21:06:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668585#M10484</guid>
      <dc:creator>Hiromichi Shinkawa</dc:creator>
      <dc:date>2025-07-04T21:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get object geometry openings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668695#M10487</link>
      <description>&lt;P&gt;Yes I am also putting window/door guids into that function and it gives me complete geometry of the object. However I cannot get the openings on the walls that have windows on it. I have a simple project with a wall and a windows on it. I can get the wall and windows using guids and Model_Access_API. But I cannot see the opening on the wall where the window should be. Is there a way to get that?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HalitYagar_5-1751756037153.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/89086i1BFCF04443568AA8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HalitYagar_5-1751756037153.png" alt="HalitYagar_5-1751756037153.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HalitYagar_6-1751756046440.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/89087iD6F4DCFE1478AF22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HalitYagar_6-1751756046440.png" alt="HalitYagar_6-1751756046440.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HalitYagar_7-1751756068506.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/89088i3EA9F494F0AA076E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HalitYagar_7-1751756068506.png" alt="HalitYagar_7-1751756068506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jul 2025 22:56:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668695#M10487</guid>
      <dc:creator>HalitYagar</dc:creator>
      <dc:date>2025-07-05T22:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get object geometry openings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668749#M10488</link>
      <description>&lt;P&gt;Hi, Maybe I'm not fully understand what you meant the opening. You cannot get the opening geometry only as it's represented by wall. I mean if you get the wall geometry, than you can a piece of wall with a hole (opening) geometry.&lt;/P&gt;
&lt;P&gt;HTH.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2025 04:25:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/668749#M10488</guid>
      <dc:creator>Hiromichi Shinkawa</dc:creator>
      <dc:date>2025-07-07T04:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get object geometry openings</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/669193#M10493</link>
      <description>&lt;P&gt;&amp;nbsp;I expect the wall should have a hole in its geometry representation where the window placed. But maybe I am thinking wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 15:28:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-get-object-geometry-openings/m-p/669193#M10493</guid>
      <dc:creator>HalitYagar</dc:creator>
      <dc:date>2025-07-09T15:28:34Z</dc:date>
    </item>
  </channel>
</rss>

