sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    No tabs possible in text?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 6 Posters 125 Views 6 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.
    • liquid98L Offline
      liquid98
      last edited by

      Hi,

      I have a string = "t\tt"
      In console it prints:

      t		t
      

      But ents.add_text string, [0,0,0]
      Gives 'tt'

      why??
      Is there a magic workaround whose existence I'm not aware ? πŸ˜’ πŸ˜’

      Thnx guys!!

      Liquid

      Things that flourish fall into decay. This is not-Tao, And what is not-Tao soon ends ~ Lao tse

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        hm.. I see the same thing. And I can't even add tabs to a Text entity using the native tool...

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          The 'newline' \n will work OK... BUT a \t doesn't.
          So you can't 'align' Sketchup's 2d Text using tabs.
          Tabs are rendered as 'empty characters'.
          You can of course replace any 'tabs' in the string with some spaces before using it - e.g.
          text.gsub!(/\t/,' ')
          for three spaces...
          Tab \t does work OK in the UI.messagebox methods.

          TIG

          1 Reply Last reply Reply Quote 0
          • fredo6F Offline
            fredo6
            last edited by

            @tig said:

            Tab \t does work OK in the UI.messagebox methods.

            ...but it does not work in contextual menu texts, to right-align the short text. I think it was broken in v8.

            Fredo

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

              @unknownuser said:

              ...but it does not work in contextual menu texts, to right-align the short text. I think it was broken in v8.

              By "short text" are you referring to accelerator keystrokes ??

              They are not supposed to be specified in the menu item text. The OS adds them to the menu item, after an accelerator is assigned to the UI::Command object, that is in turn assigned to the menu item.

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • D Offline
                driven
                last edited by

                finally, something that actually works on a mac, but not on a PC?

                ` > tab=("t\tt")
                t t

                coordinates = [0, 0, 0]
                model = Sketchup.active_model
                entities = model.entities
                point = Geom::Point3d.new coordinates
                text = entities.add_text tab, point
                #Sketchup::Text:0x1c013cec`
                the screen text has the tab...

                john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 Reply Last reply Reply Quote 0
                • liquid98L Offline
                  liquid98
                  last edited by

                  Thanks guys. It seems this is a PC only bug. So far no reason to buy a mac..

                  Things that flourish fall into decay. This is not-Tao, And what is not-Tao soon ends ~ Lao tse

                  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