ezdxf python text size and position manipulation

22 views Asked by At

I have code in Python that will be used to manipulate DXF files, the only thing I need is to manipulate the text precisely, that is, the position and size of the text has to be as close as possible to what was requested from the program.

I've tried countless ways, using msp.add_text(), using text2path, Matrix44, etc.. and even the part of putting the text in the file I can do it quite easily, my problem is positioning it in specific coordinates and with the exact size.

An important observation is that the text does not have a defined size, but it must always have the same X and Y size.

for example:

"base" and "welding point" must occupy the same area (specific need for the work in which the DXF file will be used)

honestly I could even show my codes but as none of them worked I found it unnecessary, I just need an idea or example of how to do this.

I tried using an ezdxf text element and then repositioning it and resizing it but it didn't work,

I also tried using text2path as well as make_path_from_str and make_paths_from_str to convert the string to path to try to resize and reposition it and I was also unsuccessful.

Finally, I spent the last few days (I don't know how many, but close to two weeks) browsing the internet, trying absolutely everything that seemed to go in the direction I needed, but nothing worked.

I just hope to get an element with the requested text that has the requested specific size in the requested specific position

0

There are 0 answers