• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Create Text-object

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 2 Posters 436 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    tafkab76
    last edited by 9 Aug 2012, 08:50

    Searching this Forum and the Sketchup-API I couldn´t find a way to create a text-object, but only found methods to manipulate existing text-objects.
    What I´m trying to do ist creating labels for faces and edges to identitfy them, like "Edge_01". I´m aware of the fact, that there is no easy way to attach these labels to the corresponding entity by ruby, but that wouldn´t be to bad, since the labels will just disappear when the model or the camera-view changes.

    But is there really no way to create a text-object using ruby?

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 9 Aug 2012, 09:01

      I've moved this to the Developers' Forum as it's more appropriate.
      The various Text methods you have found relate to manipulating existing text...
      https://developers.google.com/sketchup/docs/ourdoc/text
      To add text you need to use an Entities method.
      https://developers.google.com/sketchup/docs/ourdoc/entities#add_text
      You will see that is where you add many kinds of object into the model.
      The 'entities' can be model.entities, model.active_entities, group.entities or definition.entities - so where you add objects is very flexible...
      For example: group=model.active_entities.add_group() adds a new group into the 'current context', then group.entities.add_text(string, point, vector) adds some text inside the group...

      TIG

      1 Reply Last reply Reply Quote 0
      • T Offline
        tafkab76
        last edited by 9 Aug 2012, 09:08

        Of course you´re right, I only browsed the Entity-Classes, not the Collection-classes, although I already created some faces using add_face...shame on me.

        thx for your quick response!

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        1 / 1
        • First post
          3/3
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement