I have not tried this, but I would try using the format attributes instead of creating a label point.
The format attributes can be found in the Feature type settings:
Hope this helps.
HI.
1. extract bounds of text using Boundsexctractor.
2. replace by centerpoint and extract coordinates.
3 use a Affiner to move the centerpoint to intended labelinsertionpoint.
use Target - Center - 1/2 of bounds
in affiner this would be:
A: 1,0,@Value(T_x)-@Value(C_x)-(@Value(_xmax)-@Value(_xmin))/2
B:@Value(T_y)-@Value(C_y) -(@Value(_ymax)-@Value(_ymin))/2
4 use labelpointreplacer on text attribute.
Previous process conumes the text, but it is in "fme_text_string". Use attributeexposer and expose it prior to using the Affiner.
i alkso believe that the format attributes should be usefull in this respect, never used dgn writers before though.
Hi @raimond,
I think your approach is perfect: first creating a point with VertexCreator and then replacing it with a text using LabelPointReplacer absolutely makes sense. If this text feature was written into DGN right away, it would have the default LB (left bottom) justification. So the next step is setting the proper text justification. You are right, this can be done with a format attribute, however the correct attribute to use is igds_justification rather than igds_original_justifiation (igds_original_justification is attribute read by the Reader that indicates what justification was used when the text was placed in MicroStation, this attribute is not used by the Writer). Although, as an alternative to setting igds_justification value manually, I would like to suggest using DGNStyler:
The output text feature might still appear slightly offset. E.g. with the attached workspace I got text coordinates 0.0414,0.0000 instead of 0.0000,0.0000 for the text that has height and width 10 and uses ENGINEERING font. This happens because all fonts have different proportions which DGN Writer is not aware of, i.e. DGN Writer can not calculate the text bounding box and therefore text center location precisely - it can only estimate. The offset depends on the font used and the size of the text feature - in many cases it will be minimal if present at all.
When inspecting your output with Data Inspector, please check igds_original_justification, igds_insertion_x, and igds_insertion_y attribute values as these attributes describe the text original insertion point and justification while other attributes store values calculated for the left bottom corner of the text bounding box (i.e. as if the text had LB justification, this is how MicroSnone2dgnv8.fmwtation handles the texts).
Hi @raimond,
I think your approach is perfect: first creating a point with VertexCreator and then replacing it with a text using LabelPointReplacer absolutely makes sense. If this text feature was written into DGN right away, it would have the default LB (left bottom) justification. So the next step is setting the proper text justification. You are right, this can be done with a format attribute, however the correct attribute to use is igds_justification rather than igds_original_justifiation (igds_original_justification is attribute read by the Reader that indicates what justification was used when the text was placed in MicroStation, this attribute is not used by the Writer). Although, as an alternative to setting igds_justification value manually, I would like to suggest using DGNStyler:
The output text feature might still appear slightly offset. E.g. with the attached workspace I got text coordinates 0.0414,0.0000 instead of 0.0000,0.0000 for the text that has height and width 10 and uses ENGINEERING font. This happens because all fonts have different proportions which DGN Writer is not aware of, i.e. DGN Writer can not calculate the text bounding box and therefore text center location precisely - it can only estimate. The offset depends on the font used and the size of the text feature - in many cases it will be minimal if present at all.
When inspecting your output with Data Inspector, please check igds_original_justification, igds_insertion_x, and igds_insertion_y attribute values as these attributes describe the text original insertion point and justification while other attributes store values calculated for the left bottom corner of the text bounding box (i.e. as if the text had LB justification, this is how MicroSnone2dgnv8.fmwtation handles the texts).
I would just like to add this link for reference, which I've found very helpful when working with igds_insertion_x/y earlier, if you want to set the values manually rather than through the DGNStyler.
Hi @raimond,
I think your approach is perfect: first creating a point with VertexCreator and then replacing it with a text using LabelPointReplacer absolutely makes sense. If this text feature was written into DGN right away, it would have the default LB (left bottom) justification. So the next step is setting the proper text justification. You are right, this can be done with a format attribute, however the correct attribute to use is igds_justification rather than igds_original_justifiation (igds_original_justification is attribute read by the Reader that indicates what justification was used when the text was placed in MicroStation, this attribute is not used by the Writer). Although, as an alternative to setting igds_justification value manually, I would like to suggest using DGNStyler:
The output text feature might still appear slightly offset. E.g. with the attached workspace I got text coordinates 0.0414,0.0000 instead of 0.0000,0.0000 for the text that has height and width 10 and uses ENGINEERING font. This happens because all fonts have different proportions which DGN Writer is not aware of, i.e. DGN Writer can not calculate the text bounding box and therefore text center location precisely - it can only estimate. The offset depends on the font used and the size of the text feature - in many cases it will be minimal if present at all.
When inspecting your output with Data Inspector, please check igds_original_justification, igds_insertion_x, and igds_insertion_y attribute values as these attributes describe the text original insertion point and justification while other attributes store values calculated for the left bottom corner of the text bounding box (i.e. as if the text had LB justification, this is how MicroSnone2dgnv8.fmwtation handles the texts).
Hi Lena,
Thank you for your answer.
But how can I style text with DGNStyler? I can only style color, cells and lines.
I have not tried this, but I would try using the format attributes instead of creating a label point.
The format attributes can be found in the Feature type settings:
Hope this helps.
I already tried this, but this doesn't work
HI.
1. extract bounds of text using Boundsexctractor.
2. replace by centerpoint and extract coordinates.
3 use a Affiner to move the centerpoint to intended labelinsertionpoint.
use Target - Center - 1/2 of bounds
in affiner this would be:
A: 1,0,@Value(T_x)-@Value(C_x)-(@Value(_xmax)-@Value(_xmin))/2
B:@Value(T_y)-@Value(C_y) -(@Value(_ymax)-@Value(_ymin))/2
4 use labelpointreplacer on text attribute.
Previous process conumes the text, but it is in "fme_text_string". Use attributeexposer and expose it prior to using the Affiner.
i alkso believe that the format attributes should be usefull in this respect, never used dgn writers before though.
When I do the BoundsExtractor, I get th bounds of the point and not the text
When I do the BoundsExtractor, I get th bounds of the point and not the text
Boundsextractor on the text object.
If u have a point with text attribute u must first "place" the text.
Hi Lena,
Thank you for your answer.
But how can I style text with DGNStyler? I can only style color, cells and lines.
Hi @raimond,
It sounds like an older FME. Do you use FME 2014? FME 2015 DGNStyler has Text GroupBox with many text style related settings:
Would you consider an upgrade? You can download the most recent install from http://www.safe.com/support/support-resources/fme-downloads/ If you have a valid AMC, your old license will work. If your AMC has expired, please contact Safe Support through https://support.safe.com/knowledgeSubmitCase to discuss your options.
Hi @raimond,
It sounds like an older FME. Do you use FME 2014? FME 2015 DGNStyler has Text GroupBox with many text style related settings:
Would you consider an upgrade? You can download the most recent install from http://www.safe.com/support/support-resources/fme-downloads/ If you have a valid AMC, your old license will work. If your AMC has expired, please contact Safe Support through https://support.safe.com/knowledgeSubmitCase to discuss your options.
Hi @Lena,
I use FME 2015.0. DGNStyler has only Color, Cells en Lines settings.
I will download 2016 and try with this one.
Hi @raimond,
It sounds like an older FME. Do you use FME 2014? FME 2015 DGNStyler has Text GroupBox with many text style related settings:
Would you consider an upgrade? You can download the most recent install from http://www.safe.com/support/support-resources/fme-downloads/ If you have a valid AMC, your old license will work. If your AMC has expired, please contact Safe Support through https://support.safe.com/knowledgeSubmitCase to discuss your options.
output.dgnworkbench.fmwinput.xlsxHi @Lena,
I am using FME 2016 now.
I almost have the result I want.
As example I have an excelsheet with a text and coordinates.
I transform it with the workbench and the text is placed with center-center.
When I snap on the text, the snappoint is exactly the coordinate, but it is not the middle of the text.
When I choose edit text in Microstation and don't change the text but simply accept it, then the snappoint is the middle of the text, but not the correct coordinate.
FME doesn't place the middle of the text on the coordinate.
Hi @raimond,
It sounds like an older FME. Do you use FME 2014? FME 2015 DGNStyler has Text GroupBox with many text style related settings:
Would you consider an upgrade? You can download the most recent install from http://www.safe.com/support/support-resources/fme-downloads/ If you have a valid AMC, your old license will work. If your AMC has expired, please contact Safe Support through https://support.safe.com/knowledgeSubmitCase to discuss your options.
Hi @LenaAtSafe
I changed the font type to number 1 (Working) and the problem was solved.
Thanks for your help