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

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 7 Jul 2011, 13:20

    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
    • T Offline
      TIG Moderator
      last edited by 7 Jul 2011, 16:06

      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 12 Jul 2011, 07:49

        Thank you TIG !

        It works perfectly.

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

        Advertisement