Hi!
I'm trying create a textnode with different TextStyles for each line, but I can't get it to work.For example: First line with height 50 mm and second line with height 25 mm.
I've tried to set the active TextStyle before adding another line to the Node, but that didn't work.
Maybe someone could help me please?
Stephan
I suggest that you try modifying the text after you've created the text node.
Create the node as usual and add it to the DGN model. Then read back the node and step through its components.
Set the style of each component and rewrite it.
As I wrote above, this is suggestion — let us know if it works!
Regards, Jon Summers LA Solutions
Answer Verified By: Stephan L.
Thank you very much, it works.
Now i want to modify existing textnodes. I try it the same way. At the moment there are problems with line spacing. I want linespacing "0" and type "exact". But if i just iterate through TextNode.GetSubElements and change the textstyle of each line the linespacing of old lines is kept. Maybe I have to drop the textnode and create a new textnode....
Unknown said:Maybe I have to drop the textnode and create a new textnode....
Text nodes are an element type that evolved in the days of IGDS three decades ago. I think you are attempting to go beyond what they were designed to accomplish. Rather than hammering at a text node to bend it to your will, I suggest a different approach.
Try using a cell to store your text elements. Each text component is fully under your control. When you create a cell with text elements, you have full control of each text element's location and style. You're not attempting to override the default behaviour of a text node element.
Thank you Jon. That's an interesting approach. I'm not sure that it is what I'm looking for in that specific case, but I'll give a try....