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

    Posts

    Recent Best Controversial
    • Need walls that automatically disappear in 1 direction.

      Would love to have walls that are disappearing in 1 direction.

      So when you turn around a house only the internal walls are visual at the back. The walls in front of the camera should disappear so you can select and draw things ride trough it without always needing to hiding and unhide.

      Could be an option in material to color the back of a face not "transparent" but "non existing" 😉


      Untitled.png

      posted in SketchUp Feature Requests sketchup
      onidarbeO
      onidarbe
    • RE: [Plugin] 3D Text Editor

      For some reason it only shows a red cross where you click until selecting an other tool.

      So the pop-up to enter or edit the 3D text doesn't show up anymore in Sketchup 2019 😞

      posted in Plugins
      onidarbeO
      onidarbe
    • Sketchyphysics collision not working

      Hi,

      How can I prevent collisions? I can do this with 2 solid square blocks but not with something more complex. See attachment...

      Thank you.

      Sketchup Pro 8.0.16846 + SketchyPhysics 3.2-Dec2


      zoldertrap opvouw mdf sketchyphysics NEW.skp

      posted in SketchyPhysics
      onidarbeO
      onidarbe
    • RE: Calculate the needed width of a WebDialog

      Thanks!

      I found the solution...

      [update 2013-01-23]

      def popup(msg="", timeOut=0, posX=20, posY=70) # 2013-01-23 onidarbe () gmail 
      # Popup a message (including html-tags & \r) with a timout and auto-resize the window
      # A click on the popup-window will disable timeOut and has to be closed manually
        # To see how it's working, add  border;1px solid black;  in the <div style='...'>
        htmlCode = %{
          <html onclick='clicked();' >
            <div id='div' style='float;left; white-space;nowrap;' >
              #{msg.gsub(/\r/,"<br>\n")}
            </div>
            <script type='text/javascript'>
              width=document.getElementById('div').offsetWidth;
              height=document.getElementById('div').offsetHeight;
              document.write("<input type='hidden' id='width' value='" + width + "'/>");
              document.write("<input type='hidden' id='height' value='" + height + "'/>");
              function clicked() { location = 'skp;clicked' };
              document.body.scroll = "auto"; 
            </script>
          </html>
        }  
        win = UI;;WebDialog.new( "" )
        # NOTE; Variables made up on multiple lines have only a \n at the end of each line!
        #       "View source" with Windows Notepad needs to have \r\n
        win.set_html( htmlCode.gsub(/\r\n|\n\r|\n|\r/,"\r\n") )
        # Although WebDialog without pref_key doesn't keep size or location, set_size does!
        # Thereby start with a smaller window instead of a larger previous version
        win.set_size( 130, 30 )
        win.set_position( posX, posY )
        win.show
        UI;;start_timer( 0, false ) { 
          win.set_size( win.get_element_value("width").to_f+60,
                        [800, win.get_element_value("height").to_f+80].min )
        }
        if timeOut != 0
          timerID = UI;;start_timer( timeOut, false ) { win.close }  
          win.add_action_callback( "clicked" ) { UI.stop_timer( timerID ) }
        end
      end
      
      pluginPath = Sketchup.find_support_file( "Plugins" )
      Dir.chdir( pluginPath )
      rbFiles = Dir[ "*.rb" ]
      popup( "<B>All plugins;</B>\r#{pluginPath }\r\r#{rbFiles.join("\r")}", 2 )
      
      
      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: JScript innerHTML not working in WebDialog !

      Thanks again!

      So Sketchup uses IE instead of Chrome, although I uninstalled IE? strange

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • JScript innerHTML not working in WebDialog !

      Why does this produce an error in a WebDialog, but not if I run the HTML/JS in my Chrome browser?

      msg = %{
        <html>
          <table>
            <tbody id="test">
              <tr> <td>xxx</td> </tr>
            </tbody>
          </table>
          <script type="text/javascript">
              tbody.innerHTML = "<tr> <td>yyy</td> </tr>";
          </script>
        </html>
      }
      win = UI;;WebDialog.new( "" )
      win.set_html( msg )
      win.show
      

      Same problem using: document.getElementById("test").innerHTML

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: .gsub( /\n/, &quot;\n\r&quot; ) not working in WebDialog

      Thanks Dan!

      But in this case I want for those maybe using my stuff to make it readable in notepad to 😉

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: List of all possible functions

      Ok, I should look for more functions...

      But I just read somewhere that I can't assign shortcuts from within Ruby!
      There should be a place where the shortcut are kept, right? A file or registry?

      Does anyone know?

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: .gsub( /\n/, &quot;\n\r&quot; ) not working in WebDialog

      So this time it's not SU Ruby but MS-Windows 😉

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: .gsub( /\n/, &quot;\n\r&quot; ) not working in WebDialog

      Thank you all.

      However gsub! isn't the solution, still shows everything on one line in notepad!
      I know <br> is the new-line in html, but I'd like to give out a html that also has new-lines using "View source" in notepad. Makes it more readable 😉

      But I've found the problem so it is solved ☀
      It's stupid but I should have used .gsub(/\n/,"**\r\n**") not .gsub(/\n/,"**\n\r**")

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • .gsub( /\n/, &quot;\n\r&quot; ) not working in WebDialog

      Strange thing I don't grasp:

      htmlCode = %{ <html> test </html>} win = UI::WebDialog.new( "" ) win.set_html( htmlCode.gsub(/\n/,"\n\r") ) win.show p htmlCode[7]

      When I right-click the WebDialog on Windows 7 selecting "View source", notepad opens and shows no new-lines or carriage-returns, so everything is on 1 line like this:
      <html> test</html>
      Although selecting this and copy/paste it here or in notepad++ does show new-lines and carriage-returns like:
      %(#0000FF)[<html>
      test
      </html>]

      It is solved when I add a \n after each line in %{...}
      although the Ruby Console is showing a 10, telling me there is alreeady a newline, \n
      So why doesn't .gsub(/\n/,"\n\r") work?!

      Another test shows .gsub(/\n/,"\n\r") is working, only not in the WebDialog !!!
      "<html>\ntest</html>".gsub(/\n/,"\n\r")[7] 13
      while this still shows 1 line in Notepad with "View source"
      win = UI::WebDialog.new( "" ) win.set_html( "<html>\ntest</html>".gsub(/\n/,"\n\r") ) win.show

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: List of all possible functions

      So I've made my own list, pfffff
      How do I know if I got them all? I viewed the shortcut-functions in SU 2013 pro while selecting a component and nothing.... but maybe some functions only show up on other situations! ???

      For those that like the list of all commands that i found that could be assigned to a shortcut, starting with those that are the default Sketchup shortcuts (version 2013.0.4812)

      $SU_shortcuts = [
        "Ctrl+A\tEdit/Select All", 
        "Ctrl+C\tEdit/Copy",
        "Ctrl+X\tEdit/Cut",
        "Ctrl+Y\tEdit/Redo",
        "Ctrl+Z\tEdit/Undo",
        "Ctrl+V\tEdit/Paste",
        "Ctrl+Shift+E\tCamera/Zoom Extents",
        "Ctrl+N\tFile/New",
        "Ctrl+O\tFile/Open...",
        "Ctrl+P\tFile/Print...",
        "Ctrl+S\tFile/Save",
        "Ctrl+T\tEdit/Select None",
        "Alt+Backspace\tEdit/Undo",
        "Delete\tEdit/Delete",
        "Shift+Delete\tEdit/Cut",
        "Shift+F1\tSketchUp/Context Help",
        "Ctrl+Insert\tEdit/Copy",
        "Shift+Insert\tEdit/Paste",
        "PageDown\tView/Animation/Next Scene",
        "PageUp\tView/Animation/Previous Scene",
        "Ctrl+Shift+W\tCamera/Zoom Window",
        "Space\tTools/Select",
        "G\tEdit/Make Component...",
        "L\tDraw/Line",
        "E\tTools/Eraser",
        "T\tTools/Tape Measure",
        "B\tTools/Paint Bucket",
        "R\tDraw/Rectangle",
        "C\tDraw/Circle",
        "A\tDraw/Arc",
        "P\tTools/Push/Pull",
        "M\tTools/Move",
        "Q\tTools/Rotate",
        "S\tTools/Scale",
        "F\tTools/Offset",
        "O\tCamera/Orbit",
        "H\tCamera/Pan",
        "Z\tCamera/Zoom",
        "Shift+Z\tCamera/Zoom Extents"
      ]
      
      $SU_functions = [
        "Camera/Field Of View",
        "Camera/Image Igloo",
        "Camera/Look Around",
        "Camera/Match New Photo…",
        "Camera/Next",
        "Camera/Orbit",
        "Camera/Pan",
        "Camera/Parallel Projection",
        "Camera/Perspective",
        "Camera/Position Camera",
        "Camera/Previous",
        "Camera/Standard Views/Back",
        "Camera/Standard Views/Bottom",
        "Camera/Standard Views/Front",
        "Camera/Standard Views/Iso",
        "Camera/Standard Views/Left",
        "Camera/Standard Views/Right",
        "Camera/Standard Views/Top",
        "Camera/Two-Point Perspective",
        "Camera/Walk",
        "Camera/Zoom Extents",
        "Camera/Zoom To Photo",
        "Camera/Zoom Window",
        "Draw/Arc",
        "Draw/Circle",
        "Draw/Freehand",
        "Draw/Line",
        "Draw/Polygon",
        "Draw/Rectangle",
        "Drawing/Display Crosshairs",
        "Edit/Close Group/Component",
        "Edit/Copy",
        "Edit/Cut",
        "Edit/Delete",
        "Edit/Delete Guides",
        "Edit/Hide",
        "Edit/Intersect Faces/With Context",
        "Edit/Intersect Faces/With Model",
        "Edit/Intersect Faces/With Selection",
        "Edit/Item/Change Axes",
        "Edit/Item/Edit Component",
        "Edit/Item/Explode",
        "Edit/Item/Flip Along/Component's Blue",
        "Edit/Item/Flip Along/Component's Green",
        "Edit/Item/Flip Along/Component's Red",
        "Edit/Item/Intersect Faces/With Model",
        "Edit/Item/Make Unique",
        "Edit/Item/Reload",
        "Edit/Item/Reset Scale",
        "Edit/Item/Reset Skew",
        "Edit/Item/Save As",
        "Edit/Item/Scale Definition",
        "Edit/Item/Share Component…",
        "Edit/Item/Soften/Smooth Edges",
        "Edit/Item/Unglue",
        "Edit/Item/Zoom Extents",
        "Edit/Lock",
        "Edit/Make Component...",
        "Edit/Make Group",
        "Edit/Paste",
        "Edit/Paste In Place",
        "Edit/Redo",
        "Edit/Select All",
        "Edit/Select None",
        "Edit/Undo",
        "Edit/Unhide/All",
        "Edit/Unhide/Last",
        "Edit/Unhide/Selected",
        "Edit/Unlock/All",
        "Edit/Unlock/Selected",
        "File/3D Warehouse/Get Models…",
        "File/3D Warehouse/Share Component…",
        "File/3D Warehose/Share Model…",
        "File/Exit",
        "File/Export/2D Graphic…",
        "File/Export/3D Model…",
        "File/Export/Animation/Image Set…",
        "File/Export/Animation/Video…",
        "File/Export/Section Slice…",
        "File/Generate Report...",
        "File/Geo-location/Add Location…",
        "File/Geo-location/Clear Location",
        "File/Geo-location/Show Terrain",
        "File/Import...",
        "File/New",
        "File/Open...",
        "File/Print in Google Earth",
        "File/Print Preview...",
        "File/Print Setup…",
        "File/Print...",
        "File/Revert",
        "File/Save",
        "File/Save A Copy As...",
        "File/Save As Template…",
        "File/Save As...",
        "File/Send To Layout",
        "Help/About Sketchup…",
        "Help/Check For Update...",
        "Help/Contact Us",
        "Help/Knowledge Center",
        "Help/License/Authorize...",
        "Help/License/Lan License Monitor",
        "Help/License/License Info",
        "Help/License/Set Network License File...",
        "Help/License/Unauthorize",
        "Help/License/Unset Network License File",
        "Help/Welcome To Sketchup…",
        "SketchUp/Context Help",
        "Tools/3D Text",
        "Tools/Axes",
        "Tools/Dimensions",
        "Tools/Eraser",
        "Tools/Follow Me",
        "Tools/Move",
        "Tools/North Angle",
        "Tools/Offset",
        "Tools/Outer Shell",
        "Tools/Paint Bucket",
        "Tools/Protractor",
        "Tools/Push/Pull",
        "Tools/Rotate",
        "Tools/Scale",
        "Tools/Section Plane",
        "Tools/Select",
        "Tools/Solid Tools/Intersect",
        "Tools/Solid Tools/Split",
        "Tools/Solid Tools/Subtract",
        "Tools/Solid Tools/Trim",
        "Tools/Solid Tools/Union",
        "Tools/Tape Measure",
        "Tools/Text",
        "View/Animation/Add Scene",
        "View/Animation/Delete Scene",
        "View/Animation/Next Scene",
        "View/Animation/Play",
        "View/Animation/Previous Scene",
        "View/Animation/Settings",
        "View/Animation/Update Scene",
        "View/Axes",
        "View/Component Edit/Hide Rest Of Model",
        "View/Component Edit/Hide Similar Components",
        "View/Edge Style/Black Edges",
        "View/Edge Style/Depth Cue",
        "View/Edge Style/Edges",
        "View/Edge Style/Extension",
        "View/Edge Style/Profiles",
        "View/Face Style/Hidden Line",
        "View/Face Style/Monochrome",
        "View/Face Style/Shaded",
        "View/Face Style/Shaded With Textures",
        "View/Face Style/Wireframe",
        "View/Face Style/X-Ray",
        "View/Fog",
        "View/Guides",
        "View/Hidden Geometry",
        "View/Rendering/Edge/All Same",
        "View/Rendering/Edge/By Axis",
        "View/Rendering/Edge/By Material",
        "View/Rendering/Edge/None",
        "View/Rendering/Ground",
        "View/Rendering/Sky",
        "View/Rendering/Transparent Materials",
        "View/Rendering/Use Sun For Shading",
        "View/Reset Axis (World)",
        "View/Scene Tabs",
        "View/Section Cuts",
        "View/Section Planes",
        "View/Shadows",
        "View/Toolbars/Camera",
        "View/Toolbars/Construction",
        "View/Toolbars/Drawing",
        "View/Toolbars/Dynamic Components",
        "View/Toolbars/Face Style",
        "View/Toolbars/Getting Started",
        "View/Toolbars/Google",
        "View/Toolbars/Large Buttons",
        "View/Toolbars/Large Toos Set",
        "View/Toolbars/Layers",
        "View/Toolbars/Measurements",
        "View/Toolbars/Modification",
        "View/Toolbars/Principal",
        "View/Toolbars/Sandbox",
        "View/Toolbars/Sections",
        "View/Toolbars/Shadows",
        "View/Toolbars/Standard",
        "View/Toolbars/Views",
        "View/Toolbars/Walkthrough",
        "View/Toolbars…",
        "Window/Components",
        "Window/Component Attributes",
        "Window/Component Options",
        "Window/Entity Info",
        "Window/Extenson Warehouse",
        "Window/Fog",
        "Window/Hide Dialogs",
        "Window/Instructor",
        "Window/Layers",
        "Window/Match Photo",
        "Window/Materials",
        "Window/Model Info",
        "Window/Outliner",
        "Window/Preferences",
        "Window/Ruby Console",
        "Window/Scenes",
        "Window/Shadows",
        "Window/Soften Edges",
        "Window/Styles"
      ]
      
      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: List of all possible functions

      mmmm, how does System Preferences/Shortcuts/Function do it then?
      If I can't get the list from SU then I need to find a list of all standard functions and search through all added plugins to get the rest from .menu(...).add_item(...)

      So is there a list of all standard and hidden functions that I can assign shortcuts to as in: SketchUp/Context Help, Edit/Copy, View/Animation/Next Scene, Camera/Zoom Window, ...

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • List of all possible functions

      Hi,
      Does anyone know how to get a full list of all possible functions that can be assigned to a shortcut?
      Like the list in System Preferences/Shortcuts/Function/... If possible even those functions that are only visible in a certain UI situation.

      I want to make a better shortcut editor, looking like a excel/html table, something like <A HREF="http://www.martinrinehart.com/models/tutorial/tutorial_ar.html">this[/A]:
      But with more futures:

      • With JS: Editable, sortable, filterable, resizable, fixed header scrollable table
      • Added columns for combined modifying keys
      • Warnings for double used shortcut-keys or functions
      • Marking of standard SU shortcuts or overwritten ones
      • Marking of shortcuts that have lost their connection from changed or uninstalled plugins
      • List of All possible functions
      • Using one shortcut to swap between multiple functions, example: [space] = Selection/Move
      • Assignable multi-button mouse

      All links to existing things are welcome 😉

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: Calculate the needed width of a WebDialog

      Hey Dan, Nice that I get a question from a guru 😎

      So no, I didn't use msg.length. I let a DIV auto-resize around the message, then I read the width of the DIV and reset the window-size. This way I know exactly what size the text takes, never mind what system. At least that's what I'm thinking. Someone needs to test it on a Mac...
      There is however still the size of the window-frame that I can't predict, so I added 30 & 60 to width & height. It would be nice if I find a solution to have my own narrow border without the header, if anyone has an idea, let me now...

      You can see what is happening with the DIV if you add border:1px solid black; into the style, as this will show a frame around the message where I get the size from. To be able to resize the popup window, you need to change the last falseto trueas this stands for resizable!

      Now I like to make my own advanced but simple UI.messagebox with input, checkboxes and radio's.

      PS: I've added some remarks to the code above.

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: Calculate the needed width of a WebDialog

      Thanks.
      I'm trying to make a method that pop-ups a given message for a short time. I like it to have a auto width and height. Maybe I could use a DIV that automatically changes his size of what's inside. But how can I read the displayed size of that DIV back into Ruby?

      
      msg = "
      <html>
        <div id='msg' style='border;1px solid black;  float;left'> 
          All plugins reloaded from;<br>
          #{folder}
        </div>
        <script type='text/javascript'>
          width=document.getElementById('msg').offsetWidth;
        </script>
      </html>"
      popup = UI;;WebDialog.new("", false, "WebDialog", 800, 200, 50, 150, false)
      popup.set_html(msg)
      popup.show
      UI;;start_timer(2, false) { popup.close }
      

      So how do I get that Javascipt variable: width back into Ruby?

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • Calculate the needed width of a WebDialog

      Hi,

      I like to calculate the width I should make a WebDialog to hold a certain sentence. Now it seems to be 8 times the amount of characters +20 for the border. But is this always the same on every computer? windows+mac?
      What if I add some html formatting? So I was maybe thinking on using a hmtl DIV with auto-fit, but how do I read that back, calculate and resize the WebDialog?

      Can I even lose the title-bar and/or the borders of a WebDialog?

      thanks

      myVar="Hello World" popup = UI::WebDialog.new("", false, "WebDialog", 20+8*myVar.length, 100, 50, 150, false) popup.set_html( myVar ) popup.show UI::start_timer(0.5, false) { popup.close }

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: Model in model sharing methods

      Thank you, but even reading that twice and playing with it, I still don't see how to do it. I don't know if it's even possible what I'm trying.

      module MR
        def self.p(msg=nil)
          puts msg
        end
      end
      module MR_test
        include MR
        MR;;p "hello" #working
        p "hello" #still not working ;(
      end
      
      posted in Developers' Forum
      onidarbeO
      onidarbe
    • RE: Model in model sharing methods

      mix-in module? How do I do that?

      posted in Developers' Forum
      onidarbeO
      onidarbe
    • Model in model sharing methods

      Hi,
      I've written my own method p(msg) which adds information above and a line-number before the printed values, as in:
      4 p "hello" 5 p "world"
      ┌─┬─ filename ─ module::method ─ time.msec ─
      │ 4│ hello
      │ 5│ world

      I placed this in a separate plugin-file but under the same module name. So all p ... are printed now with more information, though when not having this plugin it still has normal p ... -puts

      Now I was wondering if I could have the p-method also in other modules of mine without making it global by not putting it in a module at all?

      #mr_main.rb;
      module MR
        def self.p(msg=nil)
          # Organises puts with line-numbers in a frame; ┌─┬─ filename ─ module;;method ─ time ─
          puts "┌───┬─ " # ... full version attached to this post ...
          puts msg
        end
      end
      
      #mr_test.rb;
      module MR
        module MR_test
          def self.test
            MR;;p "working"
            p "not working as I like it to call MR;;p"
          end
          test
        end
      end
      
      posted in Developers' Forum
      onidarbeO
      onidarbe
    • 1 / 1