Get text width from text in CAD file

Hello everyone,

Is there any way to get text width from the text in CAD file? Because I want to shift the origin point in blue to the center of the text. Any thoughts would be appreciated! Thank you.

Try with BimorphNodes package.

1 Like

unfortunately, we can only get the widthfactor but cannot get the width of text

I think there is no way to get width of a text. You can only calculate aprox from text size and length of the string.

1 Like

thanks for your reply @Hyunu_Kim I hope someone in the forum may have a way to get it or can shift the point to the center.

Hello,

it seems (need to be confirmed) that during a dxf export Revit converts all texts to MText, a workaround would be to read the exported dxf with the netDxf library (as BimorphNodes ) and then calculate the midpoint with these properties

3 Likes

I have the same problem, do you find a workaround please? Can you let me know?

unfortunately, not yet until now :slight_smile:

Hi @suliuxin, the general idea is to make sure the original point closes to the detail item as much as possible so instead of getting the text width, I can get the vector perpendicular to the detail item then move the original point by that vector.

@TonyNguyen
We can get MText dimensions with DynamepPackage:


But Mtext User Width has to be justified. (Or dimensions will be wrong).
To justify Mtext User Width we can explode Mtext and get it back with TXT2MTXT in Autocad.
The export from DWG to DXF is possible with dynamo from revit, as i can see.

2 Likes