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

    Text in the corner of a rendered image

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 332 Views 3 Watching
    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.
    • K Offline
      kiesewetter
      last edited by

      hi everybody!

      is it possible to create a text in the corner of an image that is rendered with view.write_image at which the resolution of the rendered image differs from the width and height of the current view.
      for example:

      current view = 1600*1200

      an image rendered with view.write_image 800, 800

      (to save information of the current model on the image)

      thanks for your time.
      tim

      1 Reply Last reply Reply Quote 0
      • A Offline
        Aerilius
        last edited by

        I don't know if there is a more elegant way, I would just temporarily create an onscreen text and delete it later:
        model.add_note "test", 0.1, 0.1
        whereas 0.1 = 10% of the viewport width/height

        1 Reply Last reply Reply Quote 0
        • K Offline
          kiesewetter
          last edited by

          soungs good. and how to delete the note?

          1 Reply Last reply Reply Quote 0
          • K Offline
            kiesewetter
            last edited by

            i know meanwhile how to...
            thanks a lot.

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              I posted a blurp at the bottom of the API page:

              @dan said:

              Model.add_note
              returns a Sketchup::Text object associated with the View (has no point, leader or arrow.)
              [ie, there is no such object class as Note or Sketchup::Note.]

              Bug: (on PC as of v7.1,) The note (Text object,) will NOT be displayed if there are no other DrawingElements to render. A note added to an empty model will not be displayed until some element is added to the model. If all other DrawingElements execpt the note are deleted, the note will NOT be displayed (but is still in the Entities collection.)

              So modify the previous example:
              mynote = model.add_note "test", 0.1, 0.1

              ... later in the code, delete the Sketchup::Text object referenced by mynote

              mynote.erase!
              or
              Sketchup.active_model.entities.erase_entities( mynote )

              I'm not here much anymore.

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

              Advertisement