sketchucation logo sketchucation
    • Login
    1. Home
    2. sachi
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 10
    • Posts 16
    • Groups 1

    sachi

    @sachi

    10
    Reputation
    1
    Profile views
    16
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    sachi Unfollow Follow
    registered-users

    Latest posts made by sachi

    • RE: Web dialog pass data from Ruby to webdialog

      Hi,

      I have been working on those materials and I came to a solution. But still there's a problem.
      This is details.rb file

      ` dialog = UI::WebDialog.new("Details", true, "", 410, 875, 1030, 0, true)
      dialog.add_action_callback("pass_data"){|dialog,htmlpage|
      java = "set_details(#{@name.inspect},#{@description.inspect})"
      dialog.execute_script(java)
      }

      dialog.set_file 'C:\Program Files\Google\Google SketchUp 8\Plugins\set_id\details.html'
      dialog.show()`

      This is details.html file

      <html>
      <head>
      <script>
      function callRuby(htmlpage) {
      query = 'skp:pass_data@' + htmlpage;
      window.location.href = query;
      document.write(query);}

          function set_details(a,b){
      document.write(a);
      document.write(b);}
      
       </script>
      

      </head>

      <body onload="callRuby('pull_selection_count');">
      </body>

      </html>

      only "skp:pass_data@pull_selection_count" is the result on the webdialog box.
      What i want is to display the values of the Ruby variables name and description.

      Do you have any ideas for fixing this?
      Thank you in advance.

      posted in Developers' Forum
      S
      sachi
    • RE: Web dialog pass data from Ruby to webdialog

      Thank you very much. Thomthom
      I'll go through it.

      posted in Developers' Forum
      S
      sachi
    • Web dialog pass data from Ruby to webdialog

      Dear All,
      I want to implement a webdialog in Sketchup to display data from a database.
      This below link was very useful.
      http://sketchupapi.blogspot.com/2008/02/sharing-data-between-sketchup-ruby-and.

      What I want to do is as following.

      1)From the Ruby program, the database will be accessed and necessary data will be retrieved.
      2)Then this data passed to the webdialog and show to the user.

      However in the above example, the webdialog contains a refresh button. users has to click that refresh button to view the data.

      What i want to is display data directly without a refresh button.

      Is there a way to pass string data from Ruby to HTML directly.

      Do you have any suggestions and any of you have try working with webdialogs?
      its bit difficult for me because i have to learn HTML and Javascript too.

      posted in Developers' Forum
      S
      sachi
    • How to draw parallel lines

      Dear all,

      I’m working on a school project. I’m developing a 3D model using Sketchup through Ruby extension. I want to draw a parallel line for a curved line.

      The curved line was drawn using Ruby API command entities.add edges. The points of the curved line were provided by a Ruby array.
      Now I want to draw a parallel line for this curved line. Do you have any suggestions please?
      Thank you

      posted in Developers' Forum
      S
      sachi
    • Web access for 3D model

      Dear all,

      I need to access a Sketchup 3d model through a web browser. The real model will be saved in a server. Clients should be able to explore the SU model. they should be able to orbit around and walk through the model. This should be just like browsing the internet and viewing web pages. Users don't have to download and install any plugin to view the model.
      is this possible to achieve?
      Thank you in advance

      posted in Developers' Forum
      S
      sachi
    • Offset a line Ruby command

      Dear all,
      Does anybody know about a Ruby API command to offset a line? I already checked the API.
      It has a command to offset a point.

      point1 = point2.offset vector

      But i need to offset a line, like a parallel line. Is there any command in Ruby API which i can work with or any suggestions to offset a line(draw a parallel line)?

      please help me, im stuck here

      thank you in advance

      posted in Developers' Forum
      S
      sachi
    • Calculating angle between a line and North

      Dear all,

      I need to calculate the angle between North and a line connecting two latlong points. I have number of pairs(about 50) latlong points. For each and every case, i need to calculate the angle between North and the line.
      Later, I wished to use this, calculated angle to rotate an object.
      Do SketchUp and Ruby API has a specific function to facilitate this need?(when you have two latlong points, it gives you the angle between north and the line) or do you have any suggestions to make this happen?

      Thank you in advance

      posted in Newbie Forum sketchup
      S
      sachi
    • Layer controllability over html web dialog box

      Dear all,
      I like to control the layer visibility over html web dialog box for displaying purposes. layers should be controlled by ticking in a html check box.
      is this possible? and i would be appreciate your suggestions. i think i saw something like this, somewhere in the internet. but now i cant find it.
      thanks in advance.

      posted in Developers' Forum
      S
      sachi
    • RE: Add entities to a layer

      thank you very much for the detailed explanation TIG. It cleared the doubted areas about the layers.

      posted in Developers' Forum
      S
      sachi
    • RE: Add entities to a layer

      thank you very much.it worked.i tested it for a simple program.now i'm going to apply it to my original code.
      thanks again 👍

      posted in Developers' Forum
      S
      sachi