Archicad C++ API
About Archicad add-on development using the C++ API.

Getting correct UV coordinates (APIAny_GetTextureCoordID)

Anonymous
Not applicable
Hi,

I'm building a custom exporter for ArchiCAD 8.1 (using API Development Kit 5.1) and I'm having trouble getting the correct UV coordinates. I've been trying to use ACAPI_Goodies with APIAny_GetTextureCoordID to get the UV coordinates, but without much success.

The function takes a pointer to API_TexCoordPars and API_UVCoord. First struct specifies the body and polygon indeces and a surface point in local coordinate system.

So far what I've tried to do is:
  •  
  • Gather the vertices for the polygon in their local coordinate space (ie. without applying the body matrix to vertices), which are correct and verified
  •  
  • For each vertex, call the ACAPI_Goodies(APIAny_GetTextureCoordID, &txpars, &uv) where txpars is API_TexCoordPars filled with body and polygon indices and the vertex.
No errors happen, but the returned UV-coordinates are something other than they should be (like, really huge numbers).

Any ideas? What am I missing here?
1 REPLY 1
stefan
Expert
Have you had any success in solving it?
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad27/Revit2023/Rhino8/Unity/Solibri/Zoom
MBP2023:14"M2MAX/Sonoma+Win11
Archicad-user since 1998
my Archicad Book