⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • SU7: Sketchup#set_status_text() broken on Mac

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    SkalpS
    @adamb said: Anyone got any good ideas as to how to get around this bug in SU7? Basically, if you have a Ruby that is working hard and wants to show progress by updating the status text in the lower left, in SU7 on Mac its broken (bug logged SU-0282). Now I guess it will get fixed sometime, but in the meantime I'm trying to find a way of encouraging the window to refresh. A quick demo of what the bug is, is to run the following at the Ruby console: 5.times {Sketchup.set_status_text rand(); sleep 0.5} On PC, it updates the status text, on Mac it only shows the last one when the loop is completed. Any ideas gratefully received! Adam Adam, We have found a solution for this problem. If you put the actions inside a UI.timer, the set_status_text can be updated between the timers. Kind regards, Guy
  • Pickray

    2
    0 Szavazatok
    2 Hozzászólások
    869 Megtekintések
    thomthomT
    Maybe due to precision issue? Not sure, but you don't have to convert between screenpoints like that: mod = Sketchup.active_model view = mod.active_view ents = mod.entities ents.clear! edges = ents.add_edges([0, 0, 0] , [100, 100, 100]) edge = edges[0] pt1 = edge.start.position pt2 = view.camera.eye Geom.intersect_line_line(edge.line, [pt1, pt2])
  • Localization

    2
    0 Szavazatok
    2 Hozzászólások
    767 Megtekintések
    D
    I have recently been switching any of mine over to lang_handler... the main reason is concern over the new 'security' measures and where they will go next... I have a plugin that does most the hard work for you, but you still need to do some work... I'll PM it if you want... john
  • Changing Command Icons of the Toolbar

    19
    0 Szavazatok
    19 Hozzászólások
    4k Megtekintések
    M
    Thanks Anton, I was thinking, that I'm doing something wrong, but it seems that this behaviour is not changed yet.
  • Transform face to a known plane

    15
    0 Szavazatok
    15 Hozzászólások
    2k Megtekintések
    C
    @fredo6 said: > tr_axe_inv = Geom;;Transformation.axes(face.vertices[0].position, *(face.normal.axes)).inverse > Neat! Just saved fifteen lines of code in a script...
  • Webdialog losing focus in V16?

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    K
    I think I have a fix for the textbox input losing focus. Just a few lines in the html/Javascript. In the body: <body onblur= go_focus();> And in the Javascript part: function go_focus(){ document.getElementById("textbox").focus(); } Doing a self.focus() or window.focus() doesn't seem to work. Edit: applying the same code to some more complex plugins doesn't seem to work...
  • Module-class

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    M
    Mario, This might help (I reformatted your code a bit), see the last couple of lines -- # require 'sketchup.rb'   # why?  not needed for this code module McF3D   class McF3DTools      def initialize       @mod = Sketchup.active_model  # Open model       @ent = @mod.entities          # All entities in model       @sel = @mod.selection         # Current selection     end     def perceOuv       unless @sel[0].is_a?(Sketchup;;ComponentInstance) &&           @sel[0].definition.behavior.cuts_opening?         UI.messagebox "Sélectionnez un composant F3D !"       end       end    end # class McF3DTools end # module McF3D obj = McF3D;;McF3DTools.new() obj.perceOuv()   The topic of modules & classes in programming is very complex. Conversely, what most people writing a SketchUp extension need to do is a very small subset of that topic. HTH, Greg SUMD SketchUp Misc Docs
  • Enable Web Inspector in WebDialog on Mac

    9
    0 Szavazatok
    9 Hozzászólások
    3k Megtekintések
    TommyKT
    @driven said: Tommy, just set it as a global preference and it works for SU and Safari... defaults write NSGlobalDomain WebKitDeveloperExtras -bool true paste into Terminal or wrap in %x() from Ruby Console... john YES! IT WORKS! SO SIMPLE! THANK YOU!
  • SQLite in SketchUp Ruby

    17
    0 Szavazatok
    17 Hozzászólások
    5k Megtekintések
    D
    you can set the format for the output, so for a webDialog you can use... html = %x(/usr/bin/sqlite3 -html /private/tmp/sp500-data.sqlite "SELECT * FROM companies;") or there's -csv -list -line -column...
  • Creating a Solid with a set of points

    6
    0 Szavazatok
    6 Hozzászólások
    859 Megtekintések
    medeekM
    Wow, I need to come here more often. I'm going to look into the "intersect_with" method further and see if this might not be the key to overcoming this hurdle.
  • Profile Builder API?

    6
    0 Szavazatok
    6 Hozzászólások
    1k Megtekintések
    TommyKT
    Whaat, It would be amazing to have an API. Could you also perhaps include a callback system when a profile member or assembly is created/edited, so that other plugins could do their magic? On the information side of things, it could be things like updating a "price" attribute, which is based on the volume of the profile output, for instance. For such a callback, the useful variables would be: the geometry representing the path of a PM the group for the outputted member the face of the profile / components that make up the assembly.
  • Hidden Face Removal

    2
    0 Szavazatok
    2 Hozzászólások
    606 Megtekintések
    bomastudioB
    [image: 2DVectorVIEW.png] I'm on the road, I can draw the view and project exactly what I can see on the XY plane. But the problem is how to implement one the "hidden face removal" algorithms.....like the "painter algorithm", or the "Z-buffer" and so on.... In the MAKE version of SU I can't use the boolean operators so I'm in stall.....any ideas? EDIT: In this procedure I'm using the back-face culling algorithm in order to improve performaces.
  • [New scripter] Will need help on my project (now and then)

    21
    0 Szavazatok
    21 Hozzászólások
    3k Megtekintések
    Dan RathbunD
    @ruts said: In my calculations ... I want to use the base ruby class Matrix which is made for such operations. I found out that it's not just adding require 'matrix' to your code. Because SketchUp was not distributed with the Ruby Standard Library until version 2014. @ruts said: I did copy the matrix.rb and e2mmap.rb (which is required by matrix.rb) from the ruby2.2.2 folder ... This will not work, as you need to use the library compiled and distributed with the Ruby version that SketchUp uses. The constants RUBY_VERSION and RUBY_PATCHLEVEL typed at the console tell you what SketchUp embedded Ruby is. @ruts said: ... I believe this is the right way to require 'matrix'. Nope (when the standard library is properly installed,) just a simple require 'matrix' will do (because it will load it's own dependencies as it is evaluated.) @ruts said: I think I already have a solution for my problem. NO you don't, because you "don't have time to read the book," all this basic Ruby 101 knowledge is escaping you. So just go to my GitHub repo and get the Standard Ruby 1.8.6-p287 Library packaged for SketchUp 2013 and earlier on Windows ONLY. https://github.com/DanRathbun/sketchup-ruby186-stdlib-extension/releases/tag/2 With SketchUp closed: (1) Put the RBZ archive someplace where you can navigate easily to it. (2) Delete any manually copied library files (such as those you mentioned copying above.) (3) Then start SketchUp 8 and use the manual "Install Extension ..." button from Window > Preferences > Extensions (3a) Navigate to where you saved the RBZ archive, and select it, click OK. (4) Open the console and test that the paths are correctly set in $LOAD_PATH (aka $:) by typing: puts $: and ENTER You should see a listing similar to: puts $:%(green)[C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins C:/Program Files (x86)/SketchUp/SketchUp 8/Tools C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/1.8 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/1.8/i386-mswin32 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/site_ruby/1.8 C:/Program Files (x86)/SketchUp/SketchUp 8/Plugins/Ruby186/lib/ruby/site_ruby/1.8/i386-msvcrt]nil The actual program files path might also look like: %(green)[C:/Program Files (x86)/Google/Google SketchUp 8/...] (5) Then further test the loading of "matrix.rb" via: require "matrix" You should see true returned.
  • Plugin load residue, ruby

    5
    0 Szavazatok
    5 Hozzászólások
    918 Megtekintések
    M
    Thanks for the information, the problem is solved. A hidden bakup copy of the .tb file had been created in the Plugin folder. Sketchup kept trying to open that file. After making all the files visible in windows, and deleting the file, the problem was solved. With kindest regards.
  • Surface area of a component/group made up of groups

    2
    0 Szavazatok
    2 Hozzászólások
    681 Megtekintések
    JQLJ
    Fredo has a plugin for area labelling under his Fredo tools. It works rather well and probably the functionallity can be adapted to your needs. Sketchup also has the ability to report material areas, so if your outer shell is all made from certain materials you can add up your areas.
  • Raise left click

    4
    0 Szavazatok
    4 Hozzászólások
    708 Megtekintések
    bomastudioB
    It's a new feature of SU2015 BTW?
  • Simple question: Click to create a point

    3
    0 Szavazatok
    3 Hozzászólások
    739 Megtekintések
    B
    Thanks alot! I will give it a try.
  • Width, height and center of face?

    2
    0 Szavazatok
    2 Hozzászólások
    637 Megtekintések
    TIGT
    In the old days there were two conventions for describing XYZ in 3d CAD. Oddly the bounding-box uses the older convention, which is not used elsewhere within SketchUp. SketchUp uses the more obvious convention, that is, as if you were looking at the 3d object in the real world 'through' the screen as if it were a 'window-frame' - X=left-right/red, Y=in-out/green and Z=up-down/blue. The other 3d CAD convention grew from 2d - it assumed you drew 'on the screen' as if looking down in plan - so bounds.width [~screen-width] is equivalent to SketchUp's X-red, and bounds.height [~screen-height] is equivalent to SketchUp's Y-green; the remaining bounds.depth is SketchUp's Z-blue - originally assumed to project in/out of the plane of the screen - to add the 3d element to a 2d plan ! A '2d' face's bounds has no 'depth' - only width and height [and center] etc Make a note of these odd naming conventions and use them accordingly.
  • Layer Transparency ?

    3
    0 Szavazatok
    3 Hozzászólások
    629 Megtekintések
    WhyDiW
    thanks for the reply but bad news! anyone knows any make up for that, even hard? i easily deal with ruby have a good day
  • How to see the results of this method?

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    TIGT
    @Jim Thanks, I knew there was something somewhere - but it was six and a half years ago ! To précis a version of AdamB's [much cleverer] code: def self.face_area(mat, context, tr) area = 0.0 context.entities.grep(Sketchup;;Group).each{|e| area += self.face_area(mat, e, e.transformation) } context.entities.grep(Sketchup;;Component_Instance).each{|i| area += self.face_area(mat, i.definition, i.transformation) } context.entities.grep(Sketchup;;Face).select{|f| f.material == mat }.each{|f| normal = f.normal binormal = Geom;;Vector3d.new(normal.y, normal.z, normal.x) tangent = (normal * binormal).normalize areascale = (tr * binormal).length * (tr * tangent).length area += ( f.area * areascale ) } return area end The 'mat' must be a reference to a model.material [or nil]... The 'context' must be either the model or a group or a definition [i.e. something that will have 'entities'] The transformation 'tr' must be a 'Geom::Transformation' - even it's 'blank', so the arguments are: (material, model, Geom::Transformation.new()) (material, group, group.transformation) (material, instance.definition, instance.transformation) The method returns the area of all faces within the context, included nested containers, and adjusts them to allow for any scaling of those containers... To apply transformations of nested containers which themselves are within transformed containers etc, you need to iterate the method within itself, passing/reapplying transformations [similar to the earlier example 'sum_area' method] which I have botched in here... Note how its 'self.' assumes it's called as a method within a module.

Advertisement