sketchucation logo sketchucation
    • Login
    1. Home
    2. Dhruv
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    D
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 25
    • Groups 1

    Dhruv

    @Dhruv

    10
    Reputation
    1
    Profile views
    25
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online
    Age 39

    Dhruv Unfollow Follow
    registered-users

    Latest posts made by Dhruv

    • RE: Changing scenes from Ruby

      Thanks Rick and Jim ๐Ÿ˜„ that helped!

      posted in Developers' Forum
      D
      Dhruv
    • RE: Changing scenes from Ruby

      Here is the corrected part of javascript. But still I am facing the same problem. Actually that was a typo in my previous post.

      <input type="button" onclick="callRuby('selected_page') value ="Scene1">ย 
      <input type="button" onclick="callRuby('pages1.selected_page') value = "Scene2">ย 
      <input type="button" onclick="callRuby('pages2.selected_page')" value="Scene 3">

      posted in Developers' Forum
      D
      Dhruv
    • RE: User defined DC functions

      Thanks Scott ๐Ÿ˜„

      posted in Dynamic Components
      D
      Dhruv
    • Changing scenes from Ruby

      **What I am trying to do,

      I am trying to change scenes through web-dialogue, Inside web dialogue I have buttons upon which clicken on , scenes will change.

      Here is part of my ruby code.**

      @@xzybit_dlg.add_action_callback("get_data") do |web_dialog,action_name|
      if action_name=="selected_page"
      #For scene 1
      pages = Sketchup.active_model.pages
      pages.selected_page = pages["Scene 1"]
      #js_command = "passFromRubyToJavascript("+ selected_page.to_s + ")"
      web_dialog.execute_script(js_command)
      end

            # For scene 2
            if action_name="selected_page"
                pages1 = Sketchup.active_model.pages
                pages1.selected_page = pages1["Scene 2"]
                #js_command = "passFromRubyToJavascript("+ selected_page.to_s + ")"
                web_dialog.execute_script(js_command)
            end
      
            # For scene 3 , bug for now, it goes to scene 2 when clicked upon scene 3 
            if action_name="selected_page"
                pages2 = Sketchup.active_model.pages
                pages2.selected_page = pages2["Scene 3"]
                #js_command = "passFromRubyToJavascript("+ selected_page.to_s + ")"
            web_dialog.execute_script(js_command) 
            end
      end
      

      Here is part of my javascript code

      function callRuby(actionName) {
      query = 'skp:get_data@' + actionName;
      window.location.href = query;
      }
      <input type="button" onclick="callRuby('selected_page')">ย 
      <input type="button" onclick="callRuby('pages1.selected_page')">ย 
      <input type="button" onclick="callRuby('pages2.selected_page')" value="Scene 3">

      scene 1 and 2 are working fine. But when I click on Scene 3 it goes to scene 2 and not scene 3, which needs to be fixed.

      Thank you,
      Dhruv

      posted in Developers' Forum
      D
      Dhruv
    • RE: User defined DC functions

      Thanks Chris and Remus for your support ๐Ÿ˜„

      posted in Dynamic Components
      D
      Dhruv
    • RE: User defined DC functions

      I am trying to open a hyperlink basically, when user clicks I want it to direct to web-browser.

      posted in Dynamic Components
      D
      Dhruv
    • RE: User defined DC functions

      Can you show me how do I use imageURL with onClick function?

      Thanks a lot!
      Dhruv

      posted in Dynamic Components
      D
      Dhruv
    • RE: User defined DC functions

      Hey Remus,

      Can you show me a example? That would be really helpful!

      posted in Dynamic Components
      D
      Dhruv
    • RE: User defined functions

      or can I have something like this, when I leftclick on any object, it opens a webdialog?

      posted in Developers' Forum
      D
      Dhruv
    • RE: User defined DC functions

      Can anybody tell me how imageURL works?

      posted in Dynamic Components
      D
      Dhruv