Search code examples
ruby-on-railsrubysketchup

ruby - How can I associate text with a construction point with sketchup api?


I'm developing a sketchup plugin with ruby, I have coded the parsing process succesfully and I got the cpoints from csv file to sketchup. The csv file also contains a description within coordinates of every point like : ["15461.545", "845152.56", "5464.59", "tower1"]. I want to get the tower1 as a text associated to every point.

How can I do that ?

PS : You don't need to get the tower1 from the array, i've already done that. I have it now in an independant variable like : desc_array = ["tower1", "beacon48", "anna55", ...]

Please help me


Solution

  • I did that by

    @@todraw_su.each do |todraw|

    @@desc_array.each do |desc|

    @model.entities.add_text desc, todraw

    end

    end

    But I found a problem with each statement, it loops for every todraw in desc
    If you know how I can do it, answer on this question Each statement inside another each malfunctions?