How to create a script that puts text in an object

i have quite a few objects where the focus is not on the object. When creating text, the newly created text will be outside the object. is there a way to create a python script that puts these text in the object. Thanks everyone

Moved to Scripting category.

1 Like

It’s not all that easy to do, but I have an idea. What kind of text are you wanting to put in - sequential numbering, object name or…?

1 Like

Good morning Mitch! You can come up with ideas with sequential numbering. I’m still stuck in determining the inside point to add text

OK, you can try this one out - can be modified to suit. (2.6 KB)

It works by creating a fine planar mesh from each curve, then finding the mesh vertex point furthest from the curve. Curves must be closed and planar. Exact location will still be somewhat unpredictable, but the text insertion point will always be inside the closed curve.

As it internally creates a surface and relatively fine mesh from each curve, it may take a bit of time for large numbers of curves, a couple of hundred took like 3 seconds here.

great ! The script works just like what I needed. thank you very much!