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

    I want text tool to show attributes other than area etc.

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 4 Posters 224 Views 4 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.
    • DavidBoulderD Offline
      DavidBoulder
      last edited by

      So when you use the text tool as a label you get the following.

      if face then - area
      if edge then - distance
      if component/group then - name

      Has anyone tried to create a similar tool that uses a different entity attribute such as material or a custom attribute field (cost for example).

      Now another issue with these text labels is that they aren't dynamic. It would be great if an observer could update this when entities are changed. Or if nothing else a manual (re-calculate all) button.

      --

      David Goldwasser
      OpenStudio Developer
      National Renewable Energy Laboratory

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        That is all do-able, and I don't think anyone has done it yet. The auto-regeneration might need to have a button like you suggest, but maybe not. I am not sure how those observer's work, or don't work... But making your own tool to add text notes is easy enough for sure. I can mock up an example later today if you would like. Its all of about 20 lines of code or less. Maybe under 10.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

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

          I'm working on an AreaTag Tool so so and EdgeTag and InstanceTag Tool would be a simple progression - it's a week or two down the list... 😞

          TIG

          1 Reply Last reply Reply Quote 0
          • DavidBoulderD Offline
            DavidBoulder
            last edited by

            Chris, if you don't mind, that would be great. I've wanted labels to be more dynamic for a long time.

            Looking at the Text class
            http://code.google.com/intl/zh-CN/apis/sketchup/docs/ourdoc/text.html

            It seems like if you create a text object via ruby vs. with the existing text tool you can use this method to apply text
            Text.text=

            I guess you can grab the variable from the attribute_dictionary to use.

            Then if you want to update a set of text labels (within some set of rules for what type of attribute to use for different types of objects) you could have a script iterate through all text objects to update. Maybe I would use layers as a way to determine what type of data I want for a label. The active layer could be used when first creating a text object to determine what I want to show, and then if I move the text object to another layer and re-calculate, it would change the attribute to match the layer. Just thinking . . .

            --

            David Goldwasser
            OpenStudio Developer
            National Renewable Energy Laboratory

            1 Reply Last reply Reply Quote 0
            • T Offline
              todd burch
              last edited by

              Got one already:

              favicon

              (www.smustard.com)

              Todd

              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