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

    arnouff

    @arnouff

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

    arnouff Unfollow Follow
    registered-users

    Latest posts made by arnouff

    • RE: Sketchup's API and Ruby

      To share, this is a post i found about it (by cphillips)

      Additionnal stuff:
      http://www.suwiki.org/suwiki/index.php?title=Ruby_Tutorial_-Dialog_Boxes_and_WIN32API%28Advanced%29

      the Win32API.so link below wont work
      you can get Win32API.so from there
      After you install ruby into a folder, say c:\RUBY, then Win32Api.so will be in
      c:\RUBY\lib\ruby\1.8\i386-mswin32

      the original post:
      http://groups.google.com/group/Ruby-API/browse_thread/thread/52ade11766148a57

      -The function is called "cleanSlate()".
      -It will remove all the menus and the window boarder.
      -You need to manually disable any toolbars you dont want.
      -Requires win32API.so lib(attached).

      NOTES:
      -It works by looking for a window named "Sketchup - Untitled".
      Therefore it will only work when no model is loaded. You could change
      this by editing the ruby.
      -It wont fully work at startup because the "Plugins" menu gets created
      after the cleanSlate() function is run.

      Enjoy
      Chris
      http://groups.google.com/group/sketchup-Pro-Groups/web/win32API.so
      http://groups.google.com/group/sketchup-Pro-Groups/web/cleanSlate.rb

      <code>
      require "sketchup.rb"
      require "Win32API"

      def cleanSlate()
      #setup win32 calls.
      findWindow=Win32API.new("user32.dll", "FindWindow", ['P','P'], 'N')
      sendMessage=Win32API.new("user32.dll", "SendMessage",['N','N','N','P'], 'N')
      getMenu=Win32API.new("user32.dll", "GetMenu", ['N'], 'N')
      getMenuItemCount=Win32API.new("user32.dll", "GetMenuItemCount",['N'], 'N')
      getSubMenu=Win32API.new("user32.dll", "GetSubMenu", ['N','N'], 'N')
      deleteMenu=Win32API.new("user32.dll", "DeleteMenu", ['N','N','N',],'N')
      drawMenuBar=Win32API.new("user32.dll", "DrawMenuBar", ['N'], 'N')
      setWindowLong=Win32API.new("user32.dll", "SetWindowLong",['N','N','N'], 'N')

      #find the sketchup window
      pw=findWindow.call(0,"Untitled - Sketchup")
      
      #remove the menu
      menu=getMenu.call(pw)
      while(getMenuItemCount.call(menu)>0)
      	menu=getMenu.call(pw)
      	deleteMenu.call(menu,0,0x400)
      	drawMenuBar.call(menu)
      end
      
      #force the layout to update.
      sendMessage.call(pw,0x0047,0,"")
      
      #remove the window boarders
      setWindowLong.call(pw,-16,0x00800000|0x10000000|0x00080000|0x00040000)
      

      end
      </code>

      posted in Developers' Forum
      A
      arnouff
    • RE: Sketchup's API and Ruby

      mmm, legal, it's not.
      but im tricky for school.

      ... possible to fit the "drawing zone" into a webdialog ?
      ... is there any "transparency" property for a webdialog?

      i suppose the best way ("or the easy way") is a floating webdialog as a control bar
      over a naked sketchup original window.

      control bar connected to Ruby functions.

      posted in Developers' Forum
      A
      arnouff
    • Sketchup's API and Ruby

      my question:

      Is it possible to extract the "drawing zone" from sketchup and then, use it somewhere else using Ruby and Sketchup's API?

      Id like to insert the drawing zone in a selfmade form....... and use it code behind with Ruby. Or, remove all from the original sketchup's main screen.....menus, toolbars and the rest.

      first: is it possible ?
      if yes, how can i do ?

      thanks
      PL

      posted in Developers' Forum
      A
      arnouff