-
Notifications
You must be signed in to change notification settings - Fork 407
FontFamilyName getting overwritten #471
Comments
Read this. It is the same kind of problem, your Default text style is being overwritten by the one already present in your DxfDocument. |
It's just like adding a block to a drawing that already has that block definition. Running into these errors with code can be a little tricky. If your code breaks after your drawing has a text style or block incorrectly defined then you will always get that wrong definition inserting a new style or block with the same name, until you remove all references to it and then purge it out. You don't get the warning prompt |
Thank you for the quick reply. Did I get it right, that its the normal behavior of the DXF-Definition? |
There is a defualt dimstyle already present in a new doc, as is clearly stated in the link that will solve your problem. Read the link and try using the code which was supplied to you in it. |
A Text entity holds a reference to a TextStyle, so when the text is added to the document so does the style, same thing happens with its layer. All classes derived form TableObject behave in the same way, the destination document always takes precedence. If for whatever reason you want to change this behavior it is your responsibility to check if a table already exists with the same name and act in consequence. |
Thanks for your replies. I will keep that in mind. |
When I want to add a Text to my DxfDocument, the FontFamilyName gets overwritten.
Code to reproduce the bug:
I can open the exported DXF-File with my CAD program an the text is at right position, but the Font is now "simplex"
The only workaround that I found was to add the following line after adding the entity:
The text was updated successfully, but these errors were encountered: