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

    Anchor the leader for text entity

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 244 Views 2 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.
    • D Offline
      dolzenko
      last edited by

      When working with the Text tool you can anchor the created leader to Endpoint or Face of the component. Then when you move the component the leader follows the original point on component (or face, etc.).

      Is there a way to add a text with the leader by

      add_text (Sketchup;;Entities)
      

      function, with leader being anchored to specific Endpoint in my component?

      Thanks in advance.

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

        So far I have found these links, both of which indirectly confirm that this is impossible with the current API. Can anybody confirm/deny this?

        http://groups.google.com/group/sketchupruby/browse_thread/thread/4561e6ec1f3e41cc/55d97084b224a2eb?lnk=gst&q=leader#55d97084b224a2eb

        http://groups.google.com/group/Ruby-API/browse_thread/thread/434fc8f36f394a7b/9d00a83d3f7084a7#9d00a83d3f7084a7

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

          I seem to have been involved in these earlier debates - although I don't recall it ! It was some 'years' ago...

          Currently it seems impossible to link text/leader with an entity using the API commands directly...

          My idea was that once we've made the text we know the thing its related to - let's assume here it's a face - so we can then link the text and face together by giving the face an attribute set that tells us the text's id and initial location... So far so good... now we add an observer to the face which spots if it's changed and finds the text from its id and transforms the text's location to match; it'd also change the attribute value to have the text's new location for a matching transformation next time...

          That's the only way I can see to do it...

          TIG

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

            Thank you for your quick reply.

            And yeah I noticed your suggestion in one of the above links too.

            The observer solution seems a little kludgey to me, especially when you can create the needed leader manually with the Text tool.

            So I'm still pretty new to SketchUp development, how that observers solution would work when say I would like to move my *.skp file to the other PC? I would obviously have to move it with the script which sets up observers?

            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