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

    Dynamic Component rotation through Ruby code

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 305 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
      dagobo
      last edited by

      Hi all,

      I am trying to write a Ruby tool that needs to access a dynamic component's attributes.
      I created two attributes within my component : two rotation angles along two different axes.

      First issue I had : the name I gave to the attributes wasn't the good one for the ruby code.
      So I downloaded the AttributeManager to see the real name of the attribute.

      Then, I tried to actually make my component rotate through the ruby code.
      But it seems like the value of the attribute has changed, but not the view in the design.
      So my component stays exactly at the same position and doesn't rotate at all.

      How can I do the refresh the value or refresh the view in my code, in order to make my component move each time I compute my code ?

      Thanks every one for your help,

      Marie

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

        After you have set the attributes in code you need a line like this to force the update...
        $dc_observers.get_latest_class.redraw_with_undo(dc_instance)

        TIG

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

          Thank you TIG !

          It works perfectly.

          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