<?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: Morph's vertices, coordinates in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Morph-s-vertices-coordinates/m-p/226325#M5371</link>
    <description>Hi Andor, &lt;BR /&gt;
 &lt;BR /&gt;
please try at first with ACAPI_Element_Get3DInfo function. &lt;BR /&gt;
Example code: 
&lt;PRE&gt;// ----------------------------------------------------------------------------- 
// Dump a vertices of a body (VERT) 
// ----------------------------------------------------------------------------- 
 
static void		DumpVertices (Int32 ibody, const API_Coord&amp;amp; dbOffset) 
{ 
	API_Component3D 	component; 
	Int32				j, nVert; 
	API_Tranmat			tm; 
	GSErrCode			err; 
 
	WriteReport ("BODY #%d", ibody); 
 
	BNZeroMemory (&amp;amp;component, sizeof (component)); 
 
	component.header.typeID = API_BodyID; 
	component.header.index  = ibody; 
	err = ACAPI_3D_GetComponent (&amp;amp;component); 
	if (err != NoError) { 
		WriteReport ("    ERROR"); 
		return; 
	} 
 
	nVert = component.body.nVert; 
	tm = component.body.tranmat; 
 
	WriteReport ("  VERTs"); 
	for (j = 1; j &amp;lt;= nVert; j++) { 
		component.header.typeID = API_VertID; 
		component.header.index  = j; 
		err = ACAPI_3D_GetComponent (&amp;amp;component); 
		if (err == NoError) { 
			API_Coord3D	trCoord;	// world coordinates 
			trCoord.x = tm.tmx[0]*component.vert.x + tm.tmx[1]*component.vert.y + tm.tmx[2]*component.vert.z + tm.tmx[3]; 
			trCoord.y = tm.tmx[4]*component.vert.x + tm.tmx[5]*component.vert.y + tm.tmx[6]*component.vert.z + tm.tmx[7]; 
			trCoord.z = tm.tmx[8]*component.vert.x + tm.tmx[9]*component.vert.y + tm.tmx[10]*component.vert.z + tm.tmx[11]; 
			trCoord.x += dbOffset.x; 
			trCoord.y += dbOffset.y; 
			WriteReport ("    [%2d]  (%lf, %lf, %lf)", 
						 j, 
						 trCoord.x, trCoord.y, trCoord.z); 
		} 
	} 
	return; 
}		// DumpVertices 
 
//------------------------------------------------------------------------------------------ 
 
err = ACAPI_Element_Get3DInfo (elemHead, &amp;amp;info3D); 
if (err == APIERR_BADID) { 
	WriteReport_Alert ("This element does not have 3D information."); 
	return; 
} 
if (err != NoError) { 
	ErrorBeep ("Error in ACAPI_Element_Get3DInfo", err); 
	return; 
} 
 
for (Int32 ibody = info3D.fbody; ibody &amp;lt;= info3D.lbody; ibody++) 
	DumpVertices (ibody, dbOffset);&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
You can find a good example in the 3D_Test example Add-On. &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
    <pubDate>Wed, 03 Dec 2014 10:34:00 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2014-12-03T10:34:00Z</dc:date>
    <item>
      <title>Morph's vertices, coordinates</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Morph-s-vertices-coordinates/m-p/226324#M5370</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hey,&lt;BR /&gt;&lt;BR /&gt;How is it possible to get the vertices of a Morph in AC17? Mostly I read the data through the memo, but this time it doesn't seem to work.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Andor&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:58:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Morph-s-vertices-coordinates/m-p/226324#M5370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-01T11:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Morph's vertices, coordinates</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Morph-s-vertices-coordinates/m-p/226325#M5371</link>
      <description>Hi Andor, &lt;BR /&gt;
 &lt;BR /&gt;
please try at first with ACAPI_Element_Get3DInfo function. &lt;BR /&gt;
Example code: 
&lt;PRE&gt;// ----------------------------------------------------------------------------- 
// Dump a vertices of a body (VERT) 
// ----------------------------------------------------------------------------- 
 
static void		DumpVertices (Int32 ibody, const API_Coord&amp;amp; dbOffset) 
{ 
	API_Component3D 	component; 
	Int32				j, nVert; 
	API_Tranmat			tm; 
	GSErrCode			err; 
 
	WriteReport ("BODY #%d", ibody); 
 
	BNZeroMemory (&amp;amp;component, sizeof (component)); 
 
	component.header.typeID = API_BodyID; 
	component.header.index  = ibody; 
	err = ACAPI_3D_GetComponent (&amp;amp;component); 
	if (err != NoError) { 
		WriteReport ("    ERROR"); 
		return; 
	} 
 
	nVert = component.body.nVert; 
	tm = component.body.tranmat; 
 
	WriteReport ("  VERTs"); 
	for (j = 1; j &amp;lt;= nVert; j++) { 
		component.header.typeID = API_VertID; 
		component.header.index  = j; 
		err = ACAPI_3D_GetComponent (&amp;amp;component); 
		if (err == NoError) { 
			API_Coord3D	trCoord;	// world coordinates 
			trCoord.x = tm.tmx[0]*component.vert.x + tm.tmx[1]*component.vert.y + tm.tmx[2]*component.vert.z + tm.tmx[3]; 
			trCoord.y = tm.tmx[4]*component.vert.x + tm.tmx[5]*component.vert.y + tm.tmx[6]*component.vert.z + tm.tmx[7]; 
			trCoord.z = tm.tmx[8]*component.vert.x + tm.tmx[9]*component.vert.y + tm.tmx[10]*component.vert.z + tm.tmx[11]; 
			trCoord.x += dbOffset.x; 
			trCoord.y += dbOffset.y; 
			WriteReport ("    [%2d]  (%lf, %lf, %lf)", 
						 j, 
						 trCoord.x, trCoord.y, trCoord.z); 
		} 
	} 
	return; 
}		// DumpVertices 
 
//------------------------------------------------------------------------------------------ 
 
err = ACAPI_Element_Get3DInfo (elemHead, &amp;amp;info3D); 
if (err == APIERR_BADID) { 
	WriteReport_Alert ("This element does not have 3D information."); 
	return; 
} 
if (err != NoError) { 
	ErrorBeep ("Error in ACAPI_Element_Get3DInfo", err); 
	return; 
} 
 
for (Int32 ibody = info3D.fbody; ibody &amp;lt;= info3D.lbody; ibody++) 
	DumpVertices (ibody, dbOffset);&lt;/PRE&gt; &lt;BR /&gt;
 &lt;BR /&gt;
You can find a good example in the 3D_Test example Add-On. &lt;BR /&gt;
 &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Wed, 03 Dec 2014 10:34:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Morph-s-vertices-coordinates/m-p/226325#M5371</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2014-12-03T10:34:00Z</dc:date>
    </item>
  </channel>
</rss>

