Skip to main content
Solved

Text Entities changing to MText Entities when writing to AutoCAD


tbarker1986
Contributor
Forum|alt.badge.img+4

I am working on an AutoCAD to AutoCAD conversion where I am changing the text of text and Mtext objects and writing out the changes. The AutoCAD writer uses the input file as a template as the only parts I want to change are the text elements (whether text/mtext/attributes in a block).

 

I am having a problem where Text entities (autocad_entity = autocad_text) are being written as MText entities in the output which is effecting the positioning of the text. This is happening for all text entities (autocad_text), where I have and haven't made changes

 

Is there any reason why text entities would be written as Mtext, when they are clearly defined as text entities in FME? I have posted some images of before and after below for reference:

Text Settings in FME just before writing

Original Text Settings in FME just before writingAutoCAD file read into FME

Input AutoCAD fileAutoCAD file written from FME

Written AutoCAD File

Best answer by virtualcitymatt

OK this is a bit of a long shot but...

 

I found this in the doc for "autocad_true_type_font":

 

"The name of the TrueType font used to display the text string.

For text entities, this attribute is only used by the AutoCAD writer, since single-line text entities do not have support for TrueType fonts.

If this attribute is specified on an autocad_text feature, a multiline text entity will be created and written instead of a single-line text entity."

 

In your screen shot it looks like the "autocad_true_type_font" is set to null - Maybe try any use a NullAttributeMapper to map it to missing to see if that helps.

 

Regardless I suspect somewhere in there is a parameter which is cuaing these text features to get converted - it's just a case of hunting it down...

View original
Did this help you find an answer to your question?

5 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

OK this is a bit of a long shot but...

 

I found this in the doc for "autocad_true_type_font":

 

"The name of the TrueType font used to display the text string.

For text entities, this attribute is only used by the AutoCAD writer, since single-line text entities do not have support for TrueType fonts.

If this attribute is specified on an autocad_text feature, a multiline text entity will be created and written instead of a single-line text entity."

 

In your screen shot it looks like the "autocad_true_type_font" is set to null - Maybe try any use a NullAttributeMapper to map it to missing to see if that helps.

 

Regardless I suspect somewhere in there is a parameter which is cuaing these text features to get converted - it's just a case of hunting it down...


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • January 9, 2024

Try the DWGEntitySetter custom transformer from the hub.


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
caracadrian wrote:

Try the DWGEntitySetter custom transformer from the hub.

All that does I think is set the "autocad_entity" attribute - in this case the attribute is already set correctly. It looks like the writer is doing some extra stuff somewhere to overrule this format attribute


tbarker1986
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • January 10, 2024

@virtualcitymatt​ thank you so much, mapping the "autocad_true_type_font" from null to missing worked!


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
tbarker1986 wrote:

@virtualcitymatt​ thank you so much, mapping the "autocad_true_type_font" from null to missing worked!

Ahh great stuff - silly that a value of null is enough to break it here. maybe someone at safe can add a ticket to the system to have this fixed or something. @andreaatsafe​ ?

 

At least there is a work around for this


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings