Add Text labels to the xsection

edited January 2013 in Ruby Scripting
I am trying to add labels to layers in the xsection using shape.text. I want to use one layer for the text labels.
If I create a new layer with a layer_index,
then add a shape (called lbl) for the text:
lbl = cell.shapes(layer_index).insert(RBA::Text::new)
how do I then add the actual text to that shape and its co-ordinates
something like
lbl.text = ("P Substrate")
lbl.text_trans(10000,1000)
which, of course, does not work!

Comments

  • edited November -1
    OK I found this works:
    lbl = cell.shapes(layer_index).insert(RBA::Text::new("hello",Trans::new(10000,1000)))

    is this the correct format. It does work but just seems a bit messy to me!
  • edited November -1

    Hallo,

    well, I couldn't have done it better ...

    I agree it's somewhat messy. It could be simplified somewhat, but in the end there are some parameters you need to specify and something like "cell.insert_text(layer_index, "hello", 10000, 1000)" isn't much shorter. But I want to provide more convenience overloads in the future so that "Text::new("hello", 10000, 1000)" is possible.

    Regards,

    Matthias

Sign In or Register to comment.