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

Get the world coordinate of a character in a text/element

BenjiDev
Enthusiast

Hi

Given the nth character in a text element, is it possible to easily get that characters position in world coordinates?

It could probably be calculated from a combination of API_TextType, API_ParagraphType and maybe API_FontType but it would be tricky to cover every case. Is there an easy way to do it? I could not find anything readily available in the API documentation. 

BenjiDev_0-1711573074007.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hi Benji,

 

I don't know of any readily available function. I only found ACAPI_Element_GetTextLineLength. With that it might be worth a try to get the line length of the substring ending just before the character you are interested in. That could at least simplify that part.

 

Hope that helps,
Bernd

View solution in original post

2 REPLIES 2
Solution

Hi Benji,

 

I don't know of any readily available function. I only found ACAPI_Element_GetTextLineLength. With that it might be worth a try to get the line length of the substring ending just before the character you are interested in. That could at least simplify that part.

 

Hope that helps,
Bernd

Ah, surely will be useful for what I'm trying to do, thanks Bern!